Class EventSourcedWorkflowStore
java.lang.Object
io.axoniq.framework.workflow.runtime.execution.EventSourcedWorkflowStore
- All Implemented Interfaces:
WorkflowStore
Event-sourcing repository-backed workflow store.
Loads the projection of workflow instances that have started without reaching a terminal state and the durable event-sourced state for an individual workflow instance.
- Since:
- 5.4.0
- Author:
- Simon Zambrovski
-
Constructor Summary
ConstructorsConstructorDescriptionEventSourcedWorkflowStore(Repository<String, EventSourcedRunningWorkflows> runningWorkflowsRepository, Repository<String, EventSourcedWorkflowState> workflowStateRepository) -
Method Summary
Modifier and TypeMethodDescriptionfindWorkflow(String workflowId, ProcessingContext processingContext) Sources the state of a workflow that may not exist.loadRunningWorkflows(ProcessingContext processingContext) Loads the singleton running-workflows projection.loadWorkflow(String workflowId, ProcessingContext processingContext) Loads the event-sourced durable state for a workflow id.
-
Constructor Details
-
EventSourcedWorkflowStore
public EventSourcedWorkflowStore(Repository<String, EventSourcedRunningWorkflows> runningWorkflowsRepository, Repository<String, EventSourcedWorkflowState> workflowStateRepository)
-
-
Method Details
-
loadRunningWorkflows
public CompletableFuture<RunningWorkflows> loadRunningWorkflows(ProcessingContext processingContext) Description copied from interface:WorkflowStoreLoads the singleton running-workflows projection.- Specified by:
loadRunningWorkflowsin interfaceWorkflowStore- Parameters:
processingContext- processing context used for sourcing- Returns:
- current running workflow ids
-
loadWorkflow
public CompletableFuture<WorkflowState> loadWorkflow(String workflowId, ProcessingContext processingContext) Description copied from interface:WorkflowStoreLoads the event-sourced durable state for a workflow id.- Specified by:
loadWorkflowin interfaceWorkflowStore- Parameters:
workflowId- workflow identifierprocessingContext- processing context used for sourcing- Returns:
- durable workflow state
-
findWorkflow
public CompletableFuture<Optional<WorkflowState>> findWorkflow(String workflowId, ProcessingContext processingContext) Description copied from interface:WorkflowStoreSources the state of a workflow that may not exist.- Specified by:
findWorkflowin interfaceWorkflowStore- Parameters:
workflowId- identifier of the workflow to sourceprocessingContext- processing context the sourcing runs in- Returns:
- a future completing with the sourced state, or empty when the store holds no events for the workflow
-