Class SimpleWorkflowManager
java.lang.Object
io.axoniq.framework.workflow.runtime.execution.SimpleWorkflowManager
- All Implemented Interfaces:
WorkflowManager
Workflow Manager backed by the workflow history projection and live cancellation coordinators.
- Since:
- 5.4.0
- Author:
- Simon Zambrovski
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleWorkflowManager(WorkflowHistoryRepository historyRepository, WorkflowExecutionRepository executionRepository, WorkflowCancellationService cancellationService, WorkflowStore workflowStore, UnitOfWorkFactory unitOfWorkFactory, Executor executor) Creates a Workflow Manager using a history projection and live cancellation delivery. -
Method Summary
Modifier and TypeMethodDescriptionfindMany(WorkflowStateQuery query) Finds every workflow instance matching a query.findOne(WorkflowStateQuery query) Finds the single workflow instance matching a query.
-
Constructor Details
-
SimpleWorkflowManager
public SimpleWorkflowManager(WorkflowHistoryRepository historyRepository, WorkflowExecutionRepository executionRepository, WorkflowCancellationService cancellationService, WorkflowStore workflowStore, UnitOfWorkFactory unitOfWorkFactory, Executor executor) Creates a Workflow Manager using a history projection and live cancellation delivery.- Parameters:
historyRepository- repository containing projected workflow statesexecutionRepository- repository containing live workflow executionscancellationService- service delivering cancellation requests to live workflowsworkflowStore- store the state of a non-live workflow is sourced fromunitOfWorkFactory- factory for the unit of work each such sourcing runs inexecutor- executor used for asynchronous manager operations
-
-
Method Details
-
findOne
Description copied from interface:WorkflowManagerFinds the single workflow instance matching a query.The returned result evaluates the query when
WorkflowInstances.Single.singleState()is invoked. That operation completes withnullwhen no instance matches. When more than one instance matches, callingCompletableFuture.join()throws aCompletionExceptionwhose cause is aNonUniqueWorkflowInstanceMatchException.Use a workflow ID when it uniquely identifies the instance to resolve:
workflowManager.findOne(WorkflowStateQuery.byWorkflowId(workflowId)) .singleState() .thenAccept(state -> { if (state != null) { inspect(state); } });- Specified by:
findOnein interfaceWorkflowManager- Parameters:
query- criteria used to select the workflow instance- Returns:
- lazy result for the single matching workflow instance
-
findMany
Description copied from interface:WorkflowManagerFinds every workflow instance matching a query.- Specified by:
findManyin interfaceWorkflowManager- Parameters:
query- criteria used to select workflow instances- Returns:
- lazy handle for the matching workflow instances
-