Interface IEventsState

  • All Known Implementing Classes:
    StateMachine

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void cancel()
      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
      java.lang.String getContextId()  
      LogbookTypeProcess getLogbookTypeProcess()  
      int getTenant()  
      java.lang.String getWorkflowId()  
      java.util.Map<java.lang.String,​java.lang.String> getWorkflowParameters()  
      boolean isDone()  
      boolean isRecover()  
      boolean isStepByStep()  
      void next​(WorkerParameters workerParameters)
      Like a resume but pause at the next step
      void pause()
      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 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
    • Method Detail

      • 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
      • 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

        java.lang.String getWorkflowId()
        Returns:
        The workflow Id
      • getContextId

        java.lang.String getContextId()
      • getWorkflowParameters

        java.util.Map<java.lang.String,​java.lang.String> getWorkflowParameters()