Class NextAction

java.lang.Object
io.nflow.engine.model.ModelObject
io.nflow.engine.workflow.definition.NextAction

public class NextAction extends ModelObject
  • Method Details

    • getActivation

      public org.joda.time.DateTime getActivation()
      Return the time after which the workflow should be activated. There is no guarantee that the workflow will be activated exactly at the given time.
      Returns:
      The activation time.
    • getNextState

      public WorkflowState getNextState()
      Return the next state of the workflow.
      Returns:
      The workflow state.
    • getReason

      public String getReason()
      Return the reason for the next action.
      Returns:
      The reason.
    • retryAfter

      public static NextAction retryAfter(org.joda.time.DateTime activation, String reason)
      Schedule retry for current state at time activation.
      Parameters:
      activation - The time after which the workflow can be activated.
      reason - The reason for the action.
      Returns:
      A valid NextAction value.
    • moveToStateAfter

      public static NextAction moveToStateAfter(WorkflowState nextState, org.joda.time.DateTime activation, String reason)
      Schedule processing of state nextState at time activation.
      Parameters:
      nextState - The next workflow state.
      activation - The time after which the workflow can be activated.
      reason - The reason for the action.
      Returns:
      A valid NextAction value.
    • moveToState

      public static NextAction moveToState(WorkflowState nextState, String reason)
      Schedule processing of state nextState immediately.
      Parameters:
      nextState - The next workflow state.
      reason - The reason for the action.
      Returns:
      A valid NextAction value.
    • stopInState

      public static NextAction stopInState(WorkflowState finalState, String reason)
      Set next state to finalState and do not schedule its processing. The finalState workflow state type must be final, e.g. it must be either end state or manual state. The state handler method of the state, even if it exists, is not executed. Additionally, there is no workflow action recorded for the finalState. If you want to execute the state handler method and record a workflow action, use one of the moveToState methods instead.
      Parameters:
      finalState - Final workflow state (end state or manual state).
      reason - The reason for the action.
      Returns:
      A valid NextAction value.
    • isRetry

      public boolean isRetry()
      Return true if this action is a retry of the current state.
      Returns:
      True if action is a retry, false otherwise.