Interface WorkflowExecutionRepository
- All Superinterfaces:
DescribableComponent
- All Known Implementing Classes:
InMemoryWorkflowExecutionRepository
Repository for retrieving workflow executions, storing new ones, and removing them.
Each workflow execution is identified by a unique workflow identifier and is represented as a
WorkflowExecution bundling configuration, context, and execution state.
- Since:
- 5.4.0
- Author:
- Stefan Dragisic
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all stored workflow executions.default Set<WorkflowExecution> findAll()Returns all stored workflow executions, with at most one execution per workflow identifier.findAll(WorkflowStateQuery query) Returns all stored workflow executions whose state matches a query.findAll(Predicate<WorkflowExecution> predicate) Returns all stored workflow executions matching the given predicate, with at most one execution per workflow identifier.Finds a workflow execution by its identifier.Removes the workflow execution associated with the given identifier.voidremoveAll(Predicate<WorkflowExecution> predicate) Removes all workflow executions matching the given predicate.save(String workflowId, Supplier<WorkflowExecution> factory) Atomically stores a new workflow execution if no execution exists for the given workflow identifier.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
findById
Finds a workflow execution by its identifier.- Parameters:
workflowId- the workflow identifier- Returns:
- an
Optionalcontaining the workflow execution, or empty if not found
-
findAll
Returns all stored workflow executions, with at most one execution per workflow identifier.- Returns:
- an unmodifiable collection of all workflow executions
-
findAll
Returns all stored workflow executions whose state matches a query.- Parameters:
query- state criteria to apply- Returns:
- a future completing with an unmodifiable collection of matching workflow executions
-
findAll
Returns all stored workflow executions matching the given predicate, with at most one execution per workflow identifier.- Parameters:
predicate- the predicate to match workflow executions against- Returns:
- an unmodifiable collection of all workflow executions
-
save
Atomically stores a new workflow execution if no execution exists for the given workflow identifier. If an execution already exists, returns the existing one without invoking the factory.- Parameters:
factory- the factory to create a new workflow execution if absent- Returns:
- the existing or newly created workflow execution
-
remove
Removes the workflow execution associated with the given identifier.- Parameters:
workflowId- the identifier of the workflow to remove- Returns:
- the removed
WorkflowExecution, ornullif no execution was found
-
removeAll
Removes all workflow executions matching the given predicate.- Parameters:
predicate- the predicate to match workflow executions against
-
clear
void clear()Removes all stored workflow executions.
-