Interface PublishPrimitive
- All Known Subinterfaces:
WorkflowExecutionOperations
- All Known Implementing Classes:
PublishDelegate,WorkflowExecutionOperationsDelegation
public interface PublishPrimitive
Primitive publishing a business event as a durable workflow step.
Exactly one event is appended: the given EventMessage itself, enriched with the workflow metadata
(workflowId, stepName, stepType=COMPLETED, stepPrimitive=PUBLISH). The event's
MessageType, payload, identifier and timestamp are left untouched, so the
event consumers receive is the event the workflow published. Workflow metadata keys override user metadata keys of
the same name.
The appended event acts both as the business event and as the replay-safe checkpoint of the step: on replay the step is found in the workflow state and the event is not published again. Because the event is routed like any other business event, other workflows may start on it or be woken by it.
- Since:
- 5.4.0
- Author:
- Stefan Dragisic
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceParameter object for the primitive. -
Method Summary
Modifier and TypeMethodDescriptionpublish(PublishPrimitive.PublishCommand command) Publishes the event carried by the givencommandas a durable step and waits until the step is recorded in the workflow state.
-
Method Details
-
publish
Publishes the event carried by the givencommandas a durable step and waits until the step is recorded in the workflow state. On replay, or when the step is already recorded, nothing is published.- Parameters:
command- parameter object carrying thestepNameand theEventMessageto publish- Returns:
- a
WorkflowStepResultthat resolves once the published step is part of the workflow state
-