Package org.sterl.pmw.spring
Class PersistentWorkflowService
java.lang.Object
org.sterl.pmw.AbstractWorkflowService<org.sterl.spring.persistent_tasks.api.TaskId<? extends Serializable>>
org.sterl.pmw.spring.PersistentWorkflowService
- All Implemented Interfaces:
WorkflowService<org.sterl.spring.persistent_tasks.api.TaskId<? extends Serializable>>
public class PersistentWorkflowService
extends AbstractWorkflowService<org.sterl.spring.persistent_tasks.api.TaskId<? extends Serializable>>
-
Field Summary
Fields inherited from class org.sterl.pmw.AbstractWorkflowService
workflowRepository -
Constructor Summary
ConstructorsConstructorDescriptionPersistentWorkflowService(org.sterl.spring.persistent_tasks.PersistentTaskService persistentTaskService, org.sterl.spring.persistent_tasks.trigger.TriggerService triggerService, org.sterl.spring.persistent_tasks.task.TaskService taskService, WorkflowRepository workflowRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel(RunningWorkflowId runningWorkflowId) voidClear all running and registered workflows, mainly used in tests<T extends Serializable>
RunningWorkflowIdexecute(TriggerWorkflowCommand<T> workflowCommand) <T extends Serializable>
RunningWorkflowIdgetWorkflowId(Workflow<?> workflow) <T extends Serializable>
org.sterl.spring.persistent_tasks.api.TaskId<T> Should register a new workflow or throw an exception if the workflow is already known.<T extends Serializable>
booleanResumes the waiting step of the an unknown workflow - ensure error handling in case of a wrong ID and so class cast exceptions<T extends Serializable>
booleanResumes the waiting step of the given workfloworg.sterl.spring.persistent_tasks.api.TriggerStatusstatus(RunningWorkflowId runningWorkflowId) Methods inherited from class org.sterl.pmw.AbstractWorkflowService
execute, execute, execute, execute, execute, listWorkflows, workflowCount
-
Constructor Details
-
PersistentWorkflowService
public PersistentWorkflowService(org.sterl.spring.persistent_tasks.PersistentTaskService persistentTaskService, org.sterl.spring.persistent_tasks.trigger.TriggerService triggerService, org.sterl.spring.persistent_tasks.task.TaskService taskService, WorkflowRepository workflowRepository)
-
-
Method Details
-
execute
@EventListener(TriggerWorkflowCommand.class) public <T extends Serializable> RunningWorkflowId execute(TriggerWorkflowCommand<T> workflowCommand) -
execute
public <T extends Serializable> RunningWorkflowId execute(Workflow<T> workflow, T state, Duration delay) -
status
public org.sterl.spring.persistent_tasks.api.TriggerStatus status(RunningWorkflowId runningWorkflowId) -
cancel
-
register
public <T extends Serializable> org.sterl.spring.persistent_tasks.api.TaskId<T> register(String workflowId, Workflow<T> workflow) throws IllegalStateException Description copied from interface:WorkflowServiceShould register a new workflow or throw an exception if the workflow is already known.- Throws:
IllegalStateException- if the workflow is already known
-
clearAllWorkflows
public void clearAllWorkflows()Description copied from interface:WorkflowServiceClear all running and registered workflows, mainly used in tests- Specified by:
clearAllWorkflowsin interfaceWorkflowService<org.sterl.spring.persistent_tasks.api.TaskId<? extends Serializable>>- Overrides:
clearAllWorkflowsin classAbstractWorkflowService<org.sterl.spring.persistent_tasks.api.TaskId<? extends Serializable>>
-
getWorkflowId
-
resume
public <T extends Serializable> boolean resume(Workflow<T> workflow, String runnngStepId, Function<T, T> stateModifier) Description copied from interface:WorkflowServiceResumes the waiting step of the given workflow -
resume
Description copied from interface:WorkflowServiceResumes the waiting step of the an unknown workflow - ensure error handling in case of a wrong ID and so class cast exceptions
-