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 TypeMethodDescriptionboolean
boolean
com.broadleafcommerce.orchestration.client.SimpleWorkflow
Rebuild the state for a workflow from previous runs (without actually executing any activities)org.springframework.util.concurrent.ListenableFuture<String>
run
(Informational workflow) Execute theSimpleWorkflow.start(Map)
call asynchronously.void
start()
void
stop()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.SmartLifecycle
getPhase, 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:
start
in interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartup
in interfaceorg.springframework.context.SmartLifecycle
-
stop
public void stop()- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
-
run
@Async("workflowThreadPoolTaskExecutor") public org.springframework.util.concurrent.ListenableFuture<String> run(Informational workflow) Description copied from interface:WorkflowRunner
Execute theSimpleWorkflow.start(Map)
call asynchronously.- Specified by:
run
in 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:WorkflowRunner
Rebuild the state for a workflow from previous runs (without actually executing any activities)- Specified by:
replay
in interfaceWorkflowRunner
- Parameters:
id
- The primary key for the workflowcontextInfo
- Data tracking context information- Returns:
- The reconstituted state
-