Class DefaultWorkflowRunner
java.lang.Object
com.broadleafcommerce.workflow.service.DefaultWorkflowRunner
- All Implemented Interfaces:
WorkflowRunner,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
See
WorkflowRunner-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultWorkflowRunner(SideEffectRepository<com.broadleafcommerce.data.tracking.core.Trackable> sideEffectRepository, WorkflowRepository<com.broadleafcommerce.data.tracking.core.Trackable> workflowRepository, com.broadleafcommerce.orchestration.internal.SideEffectHandler sideEffectHandler, com.broadleafcommerce.orchestration.spring.SimpleWorkflowFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancom.broadleafcommerce.orchestration.client.SimpleWorkflowRebuild the state for a workflow from previous runs (without actually executing any activities)run(Informational workflow) Execute theSimpleWorkflow.start(Map)call asynchronously.voidstart()voidstop()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
getPhase, isPauseable, stop
-
Constructor Details
-
DefaultWorkflowRunner
public DefaultWorkflowRunner(SideEffectRepository<com.broadleafcommerce.data.tracking.core.Trackable> sideEffectRepository, WorkflowRepository<com.broadleafcommerce.data.tracking.core.Trackable> workflowRepository, com.broadleafcommerce.orchestration.internal.SideEffectHandler sideEffectHandler, com.broadleafcommerce.orchestration.spring.SimpleWorkflowFactory factory)
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
run
@Async("workflowThreadPoolTaskExecutor") public CompletableFuture<String> run(Informational workflow) Description copied from interface:WorkflowRunnerExecute theSimpleWorkflow.start(Map)call asynchronously.- Specified by:
runin interfaceWorkflowRunner- Parameters:
workflow- Information about the workflow to execute- Returns:
- A callback for when the thread completes
-
replay
public com.broadleafcommerce.orchestration.client.SimpleWorkflow replay(String id, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:WorkflowRunnerRebuild the state for a workflow from previous runs (without actually executing any activities)- Specified by:
replayin interfaceWorkflowRunner- Parameters:
id- The primary key for the workflowcontextInfo- Data tracking context information- Returns:
- The reconstituted state
-