Class WorkflowLifecycleControlDelegate
- All Implemented Interfaces:
WorkflowLifecycleControl
It prepares a workflow for a terminal lifecycle event, publishes that event, and waits for the state projection. For a single-step cancellation it completes the running future, leaving the owning step executor to publish the guarded terminal step event.
Replay-drift invariant: any path that publishes a workflow- or step-level event or mutates
recorded state must be guarded against replay drift first. This applies to both step-level cancellation
(cancelStep → StepStatus.CANCELLED) and workflow-level termination (ctx.fail() /
ctx.cancel() → terminal workflow event), because in-flight workflows replaying older code through removed
steps would otherwise have a terminal event forced onto a history the new body no longer reaches.
- Since:
- 5.4.0
- Author:
- Stefan Dragisic
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.axoniq.framework.workflow.runtime.api.execution.context.WorkflowLifecycleControl
WorkflowLifecycleControl.CancelStepCommand, WorkflowLifecycleControl.CancelWorkflowCommand, WorkflowLifecycleControl.FailWorkflowCommand -
Constructor Summary
ConstructorsConstructorDescriptionWorkflowLifecycleControlDelegate(WorkflowExecutionOperations workflowExecutionOperations, WorkflowExecution workflowExecution, RunningSteps runningSteps, ReachedSteps reachedSteps, io.axoniq.framework.workflow.runtime.execution.WorkflowTerminalTransition terminalTransition) Constructs a lifecycle-control delegate. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCancels a single running step while the workflow itself stays non-terminal.voidCancels the entire workflow, publishing the terminal<workflow>:CANCELLEDevent.voidFails the entire workflow, publishing the terminal<workflow>:FAILEDevent.
-
Constructor Details
-
WorkflowLifecycleControlDelegate
@Internal public WorkflowLifecycleControlDelegate(WorkflowExecutionOperations workflowExecutionOperations, WorkflowExecution workflowExecution, RunningSteps runningSteps, ReachedSteps reachedSteps, io.axoniq.framework.workflow.runtime.execution.WorkflowTerminalTransition terminalTransition) Constructs a lifecycle-control delegate.- Parameters:
workflowExecutionOperations- runtime primitive-operation surfaceworkflowExecution- workflow executionrunningSteps- running step registryreachedSteps- reached steps trackerterminalTransition- owner of workflow terminal-transition execution mechanics
-
-
Method Details
-
cancelWorkflow
Description copied from interface:WorkflowLifecycleControlCancels the entire workflow, publishing the terminal<workflow>:CANCELLEDevent.- Specified by:
cancelWorkflowin interfaceWorkflowLifecycleControl- Parameters:
command- cancellation command.
-
failWorkflow
Description copied from interface:WorkflowLifecycleControlFails the entire workflow, publishing the terminal<workflow>:FAILEDevent.- Specified by:
failWorkflowin interfaceWorkflowLifecycleControl- Parameters:
command- failure command.
-
cancelStep
Description copied from interface:WorkflowLifecycleControlCancels a single running step while the workflow itself stays non-terminal.The control operation completes the step's running future exceptionally. The owning step executor subsequently authors the guarded
<step>:CANCELLEDevent through its normal terminal-event path.- Specified by:
cancelStepin interfaceWorkflowLifecycleControl- Parameters:
command- step cancellation command.- Returns:
trueif cancellation was initiated for a running, non-terminal step, otherwisefalse
-