Class VersionDelegate
java.lang.Object
io.axoniq.framework.workflow.runtime.execution.VersionDelegate
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.axoniq.framework.workflow.runtime.api.execution.context.VersionPrimitive
VersionPrimitive.VersionCommand -
Constructor Summary
ConstructorsConstructorDescriptionVersionDelegate(WorkflowExecutionOperations workflowExecutionOperations, WorkflowExecution workflowExecution, ReachedSteps reachedSteps, EventNameCustomizer parentEventNameCustomizer, Clock clock) Constructs the delegate. -
Method Summary
Modifier and TypeMethodDescriptionversion(VersionPrimitive.VersionCommand command) Records (or reads back) the migration step for the givenstepName.
-
Constructor Details
-
VersionDelegate
public VersionDelegate(WorkflowExecutionOperations workflowExecutionOperations, WorkflowExecution workflowExecution, ReachedSteps reachedSteps, EventNameCustomizer parentEventNameCustomizer, Clock clock) Constructs the delegate.- Parameters:
workflowExecutionOperations- runtime primitive-operation surfaceworkflowExecution- workflow executionreachedSteps- reached steps trackerparentEventNameCustomizer- parent event name customizerclock- clock for time calculations
-
-
Method Details
-
version
Description copied from interface:VersionPrimitiveRecords (or reads back) the migration step for the givenstepName. On the first live invocation with a strictly greaternewVersionthe step is appended; on replay (or past the call) the previously recorded value is returned via the result handle.- Specified by:
versionin interfaceVersionPrimitive- Parameters:
command- parameter object carrying thestepNameand the desirednewVersion.- Returns:
- a
WorkflowStepResultthat resolves to the version this workflow has committed to for the givenstepName.
-