Class WorkflowStateQuery
java.lang.Object
io.axoniq.framework.workflow.query.api.WorkflowStateQuery
Immutable value-based criteria for selecting workflow states.
Start with the by... factory for the first restriction, then add restrictions using the instance methods.
Each restriction is combined with the existing restrictions using logical AND. For example:
WorkflowStateQuery query = WorkflowStateQuery.byWorkflowId(orderId)
.workflowStatus(WorkflowStatus.STARTED)
.stepStatus("reserve-funds", StepStatus.COMPLETED);
Use all() only for an unrestricted search. Queries contain data only; they intentionally do not accept
predicates or other executable filters. The same query can be supplied to workflow-management
finders and workflow-state repositories, which interpret the criteria in their own storage
model.- Since:
- 5.4.0
- Author:
- Simon Zambrovski
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA value-based condition used to select workflow instances.static final recordSelects workflows by an exact payload entry value.static final recordSelects workflows containing a named step.static final recordSelects workflows by a named step's status.static final recordSelects workflows by the effective version of a change identifier.static final recordSelects workflows with a recorded version migration for a change identifier.static final recordSelects workflows by their definition identity.static final recordSelects a workflow by its identifier.static final recordSelects workflows by their status. -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkflowStateQueryall()Creates a query without restrictions.static WorkflowStateQuerybyPayloadValue(String key, @Nullable Object value) Creates a query restricted to an exact payload value.static WorkflowStateQueryCreates a query restricted to workflows containing a step.static WorkflowStateQuerybyStepStatus(String stepName, StepStatus stepStatus) Creates a query restricted to a status of a named step.static WorkflowStateQueryCreates a query restricted to an effective version recorded for a change identifier.static WorkflowStateQuerybyVersionMigration(String changeId) Creates a query restricted to workflows with a recorded version migration.static WorkflowStateQuerybyWorkflowDefinitionId(VersionedType workflowDefinitionId) Creates a query restricted to a workflow definition identity.static WorkflowStateQuerybyWorkflowId(String workflowId) Creates a query restricted to a workflow identifier.static WorkflowStateQuerybyWorkflowStatus(WorkflowStatus workflowStatus) Creates a query restricted to a workflow status.criteria()Returns the value-based criteria in this query.payloadValue(String key, @Nullable Object value) Restricts this query to a payload value.Restricts this query to workflows containing a step.stepStatus(String stepName, StepStatus stepStatus) Restricts this query to a status of a named step.Restricts this query to an effective version recorded for a change identifier.versionMigration(String changeId) Restricts this query to a recorded version migration.workflowDefinitionId(VersionedType workflowDefinitionId) Restricts this query to a workflow definition identity.workflowId(String workflowId) Restricts this query to a workflow identifier.workflowStatus(WorkflowStatus workflowStatus) Restricts this query to a workflow status.
-
Method Details
-
all
Creates a query without restrictions.- Returns:
- an unrestricted workflow state query
-
byWorkflowId
Creates a query restricted to a workflow identifier.- Parameters:
workflowId- workflow identifier to match- Returns:
- a query with the workflow identifier restriction
-
byWorkflowDefinitionId
Creates a query restricted to a workflow definition identity.- Parameters:
workflowDefinitionId- workflow definition identity to match- Returns:
- a query with the workflow definition identity restriction
-
byWorkflowStatus
Creates a query restricted to a workflow status.- Parameters:
workflowStatus- workflow status to match- Returns:
- a query with the workflow status restriction
-
byStep
Creates a query restricted to workflows containing a step.- Parameters:
stepName- step name that must exist- Returns:
- a query with the step existence restriction
-
byStepStatus
Creates a query restricted to a status of a named step.- Parameters:
stepName- step name to inspectstepStatus- step status to match- Returns:
- a query with the step status restriction
-
byPayloadValue
Creates a query restricted to an exact payload value.- Parameters:
key- payload entry name to inspectvalue- payload value to match, which may benull- Returns:
- a query with the payload value restriction
-
byVersion
Creates a query restricted to an effective version recorded for a change identifier.- Parameters:
changeId- change identifier to inspectversion- effective version to match- Returns:
- a query with the effective-version restriction
-
byVersionMigration
Creates a query restricted to workflows with a recorded version migration.- Parameters:
changeId- change identifier that must have a recorded migration- Returns:
- a query with the version-migration restriction
-
workflowId
Restricts this query to a workflow identifier.- Parameters:
workflowId- workflow identifier to match- Returns:
- query with the workflow identifier restriction
-
workflowDefinitionId
Restricts this query to a workflow definition identity.- Parameters:
workflowDefinitionId- workflow definition identity to match- Returns:
- query with the workflow definition identity restriction
-
workflowStatus
Restricts this query to a workflow status.- Parameters:
workflowStatus- workflow status to match- Returns:
- query with the workflow status restriction
-
step
Restricts this query to workflows containing a step.- Parameters:
stepName- step name that must exist- Returns:
- query with the step existence restriction
-
stepStatus
Restricts this query to a status of a named step.- Parameters:
stepName- step name to inspectstepStatus- step status to match- Returns:
- query with the step status restriction
-
payloadValue
Restricts this query to a payload value.- Parameters:
key- payload entry name to inspectvalue- payload value to match, which may benull- Returns:
- query with the payload value restriction
-
version
Restricts this query to an effective version recorded for a change identifier.- Parameters:
changeId- change identifier to inspectversion- effective version to match- Returns:
- query with the effective version restriction
-
versionMigration
Restricts this query to a recorded version migration.- Parameters:
changeId- change identifier that must have a recorded migration- Returns:
- query with the version migration restriction
-
criteria
Returns the value-based criteria in this query.- Returns:
- immutable criteria in their declaration order
-