Interface WorkflowState
- All Superinterfaces:
DescribableComponent
- All Known Implementing Classes:
EventSourcedWorkflowState
A WorkflowState returned by the Workflow Manager is a detached state value. Internal execution state may use
the same contract while changing as workflow events are applied.
- Since:
- 5.4.0
- Author:
- Simon Zambrovski
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsStep(String stepName) Checks if a step with the given name exists in the workflow execution.@Nullable WorkflowStepRetrieves a step by name.booleanhasVersionMigrationStep(String changeId) Returnstrueiff a migration step has been projected into state for the givenchangeId.payload()Retrieves the payload of the workflow execution.voidGuards against invoking any primitive when the workflow has already reached a terminal state.versionFor(String changeId) Returns the effective version for the givenchangeId.Returns the recorded version migrations by change identifier.Returns the workflow definition identity, including its current definition version.Returns the unique workflow execution identifier.Returns the status of the workflow execution.Retrieves a list of step names in the workflow execution.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
workflowId
String workflowId()Returns the unique workflow execution identifier.- Returns:
- workflow identifier
-
workflowDefinitionId
VersionedType workflowDefinitionId()Returns the workflow definition identity, including its current definition version.Use
VersionedType.version()to obtain the definition version.- Returns:
- workflow definition identity
-
workflowStepNames
Retrieves a list of step names in the workflow execution.- Returns:
- list of step names
-
getStep
Retrieves a step by name.- Parameters:
stepName- name of the step- Returns:
- workflow step
-
containsStep
Checks if a step with the given name exists in the workflow execution.- Parameters:
stepName- name of the step- Returns:
- true if the step exists, false otherwise
-
workflowStatus
WorkflowStatus workflowStatus()Returns the status of the workflow execution.- Returns:
- workflow status
-
payload
Retrieves the payload of the workflow execution.- Returns:
- payload of the workflow execution
-
versionFor
Returns the effective version for the givenchangeId.The effective version is the recorded version-migration string when a migration step has been projected for the change. Otherwise, it is
workflowDefinitionId()'s version. This fallback is implicit, so workflows that have never executed actx.migrateVersion(changeId, newVersion)call carry no version-migration step in their event history.- Parameters:
changeId- the change identifier to query- Returns:
- effective version for the change
-
hasVersionMigrationStep
Returnstrueiff a migration step has been projected into state for the givenchangeId.Used by the migration primitive to distinguish "no recorded step, using the definition identity's version" from "an explicit migration step at the effective version". Only the former permits a new step to be written for a different version number.
- Parameters:
changeId- the change identifier to query- Returns:
trueiff a migration step was recorded for thischangeId
-
versionMigrations
Returns the recorded version migrations by change identifier.- Returns:
- immutable map of recorded version migrations
-
throwTerminalCause
void throwTerminalCause()Guards against invoking any primitive when the workflow has already reached a terminal state. Rethrows the original termination cause wrapped in the appropriate exception type.
-