Class VersionDelegate

java.lang.Object
io.axoniq.framework.workflow.runtime.execution.VersionDelegate
All Implemented Interfaces:
VersionPrimitive

@Internal public class VersionDelegate extends Object implements VersionPrimitive
Implements the VersionPrimitive.

The delegate is intentionally tiny: there is no user-supplied action to run, no async lifecycle to manage, and at most a single event is published per invocation. Correctness hinges on the "downstream-steps guard" — see the algorithm in version(VersionPrimitive.VersionCommand) for details.

Since:
5.4.0
Author:
Stefan Dragisic
  • Constructor Details

    • VersionDelegate

      public VersionDelegate(WorkflowExecutionOperations workflowExecutionOperations, WorkflowExecution workflowExecution, ReachedSteps reachedSteps, EventNameCustomizer parentEventNameCustomizer, Clock clock)
      Constructs the delegate.
      Parameters:
      workflowExecutionOperations - runtime primitive-operation surface
      workflowExecution - workflow execution
      reachedSteps - reached steps tracker
      parentEventNameCustomizer - parent event name customizer
      clock - clock for time calculations
  • Method Details

    • version

      Description copied from interface: VersionPrimitive
      Records (or reads back) the migration step for the given stepName. On the first live invocation with a strictly greater newVersion the step is appended; on replay (or past the call) the previously recorded value is returned via the result handle.
      Specified by:
      version in interface VersionPrimitive
      Parameters:
      command - parameter object carrying the stepName and the desired newVersion.
      Returns:
      a WorkflowStepResult that resolves to the version this workflow has committed to for the given stepName.