Class WorkflowLifecycleControlDelegate

java.lang.Object
io.axoniq.framework.workflow.runtime.execution.WorkflowLifecycleControlDelegate
All Implemented Interfaces:
WorkflowLifecycleControl

@Internal public class WorkflowLifecycleControlDelegate extends Object implements WorkflowLifecycleControl
Delegate that applies workflow and step lifecycle-control commands on the workflow control thread.

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
  • 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 surface
      workflowExecution - workflow execution
      runningSteps - running step registry
      reachedSteps - reached steps tracker
      terminalTransition - owner of workflow terminal-transition execution mechanics
  • Method Details