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

public class DefaultWorkflowRunner extends Object implements WorkflowRunner
  • Field Summary

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
     
    com.broadleafcommerce.orchestration.client.SimpleWorkflow
    replay(String id, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Rebuild the state for a workflow from previous runs (without actually executing any activities)
    org.springframework.util.concurrent.ListenableFuture<String>
    run(Informational workflow)
    Execute the SimpleWorkflow.start(Map) call asynchronously.
    void
     
    void
     

    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 interface org.springframework.context.Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • isAutoStartup

      public boolean isAutoStartup()
      Specified by:
      isAutoStartup in interface org.springframework.context.SmartLifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • run

      @Async("workflowThreadPoolTaskExecutor") public org.springframework.util.concurrent.ListenableFuture<String> run(Informational workflow)
      Description copied from interface: WorkflowRunner
      Execute the SimpleWorkflow.start(Map) call asynchronously.
      Specified by:
      run in interface WorkflowRunner
      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 interface WorkflowRunner
      Parameters:
      id - The primary key for the workflow
      contextInfo - Data tracking context information
      Returns:
      The reconstituted state