Interface IEventsState

All Known Implementing Classes:
StateMachine

public interface IEventsState
This interface expose the action to be executed by the ProcessManager
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancel as soon as possible the processWorkflow, To do that, the step pauseCancelAction is updated to be PauseOrCancelAction.ACTION_CANCEL Unlike pause, - The final step should be executed, - PauseOrCancelAction.ACTION_CANCEL have no impact on the final step - The final step cannot be cancelled
     
     
    int
     
     
     
    boolean
     
    boolean
     
    boolean
     
    void
    next(WorkerParameters workerParameters)
    Like a resume but pause at the next step
    void
    Pause the processWorkflow, If the last step the just wait the final step Else pause the processWorkflow as soon as possible Do not wait all elements of the current step to be executed The step pauseCancelAction will be updated to PauseOrCancelAction.ACTION_PAUSE If all elements of the current step are executed then stop correctly and step pauseCancelAction will be updated to PauseOrCancelAction.ACTION_COMPLETE After next or resume occurs on paused processWorkflow, It will starts from the step pauseCancelAction equals to PauseOrCancelAction.ACTION_PAUSE if exists and update pauseCancelAction to be PauseOrCancelAction.ACTION_RECOVER Else starts normally from the next step
    void
    replay(WorkerParameters workerParameters)
    Replay the last executed step, or if it s stated, the step passed as a parameter
    void
    resume(WorkerParameters workerParameters)
    Do an evaluation of the State RUNNING If the state is not permitted a StateNotAllowedException is thrown Else call doRunning method
    void
    Should used only when server is shutting down To prevent deadlock, this method is not synchronized, Because onComplete and onPauseOrCancel are synchronized and called from ProcessEngine
  • Method Details

    • resume

      void resume(WorkerParameters workerParameters) throws StateNotAllowedException, ProcessingException
      Do an evaluation of the State RUNNING If the state is not permitted a StateNotAllowedException is thrown Else call doRunning method
      Parameters:
      workerParameters -
      Throws:
      StateNotAllowedException
      ProcessingException
    • next

      void next(WorkerParameters workerParameters) throws StateNotAllowedException, ProcessingException
      Like a resume but pause at the next step
      Parameters:
      workerParameters -
      Throws:
      StateNotAllowedException
      ProcessingException
    • pause

      void pause() throws StateNotAllowedException
      Pause the processWorkflow, If the last step the just wait the final step Else pause the processWorkflow as soon as possible Do not wait all elements of the current step to be executed The step pauseCancelAction will be updated to PauseOrCancelAction.ACTION_PAUSE If all elements of the current step are executed then stop correctly and step pauseCancelAction will be updated to PauseOrCancelAction.ACTION_COMPLETE After next or resume occurs on paused processWorkflow, It will starts from the step pauseCancelAction equals to PauseOrCancelAction.ACTION_PAUSE if exists and update pauseCancelAction to be PauseOrCancelAction.ACTION_RECOVER Else starts normally from the next step
      Throws:
      StateNotAllowedException
    • replay

      void replay(WorkerParameters workerParameters) throws StateNotAllowedException, ProcessingException
      Replay the last executed step, or if it s stated, the step passed as a parameter
      Parameters:
      workerParameters -
      Throws:
      StateNotAllowedException
      ProcessingException
    • shutdown

      void shutdown()
      Should used only when server is shutting down To prevent deadlock, this method is not synchronized, Because onComplete and onPauseOrCancel are synchronized and called from ProcessEngine
    • cancel

      void cancel() throws StateNotAllowedException
      Cancel as soon as possible the processWorkflow, To do that, the step pauseCancelAction is updated to be PauseOrCancelAction.ACTION_CANCEL Unlike pause, - The final step should be executed, - PauseOrCancelAction.ACTION_CANCEL have no impact on the final step - The final step cannot be cancelled
      Throws:
      StateNotAllowedException
    • isDone

      boolean isDone()
      Returns:
      true is processWorkflow is completed or Pause
    • isRecover

      boolean isRecover()
      Returns:
      true is processWorkflow is Pause
    • isStepByStep

      boolean isStepByStep()
      Returns:
      true if processWorkflow is running in stepByStep (next) mode or in continue mode (resume)
    • getLogbookTypeProcess

      LogbookTypeProcess getLogbookTypeProcess()
      Returns:
      The LogbookTypeProcess
    • getTenant

      int getTenant()
      Returns:
      The tenantId of the processWorkflow
    • getWorkflowId

      String getWorkflowId()
      Returns:
      The workflow Id
    • getContextId

      String getContextId()
    • getWorkflowParameters

      Map<String,String> getWorkflowParameters()