Class PublishDelegate
java.lang.Object
io.axoniq.framework.workflow.runtime.execution.PublishDelegate
- All Implemented Interfaces:
PublishPrimitive
Implements the
PublishPrimitive.
The delegate publishes the user's event enriched with workflow metadata directly through
WorkflowExecution.appendWorkflowEvent(org.axonframework.messaging.eventhandling.EventMessage, org.axonframework.messaging.core.Context), bypassing the step guards of AbstractStepExecutor: there is no
started/completed pair, the single event is the completed step. The replay-skip gate
(WorkflowState.containsStep(java.lang.String)) and the drift guard (ReachedSteps.assertNoReplayDrift(java.lang.String, io.axoniq.framework.workflow.dsl.api.WorkflowState, java.lang.String)) mirror
PayloadDelegate.
- Since:
- 5.4.0
- Author:
- Stefan Dragisic
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.axoniq.framework.workflow.runtime.api.execution.context.PublishPrimitive
PublishPrimitive.PublishCommand -
Constructor Summary
ConstructorsConstructorDescriptionPublishDelegate(WorkflowExecution workflowExecution, ReachedSteps reachedSteps) Constructs the delegate. -
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.
-
Constructor Details
-
PublishDelegate
Constructs the delegate.- Parameters:
workflowExecution- workflow executionreachedSteps- reached steps tracker
-
-
Method Details
-
publish
Description copied from interface:PublishPrimitivePublishes 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.- Specified by:
publishin interfacePublishPrimitive- Parameters:
command- parameter object carrying thestepNameand theEventMessageto publish- Returns:
- a
WorkflowStepResultthat resolves once the published step is part of the workflow state
-