Class StateMovement

java.lang.Object
io.iworkflow.core.StateMovement

@Immutable public abstract class StateMovement extends Object
  • Field Details

    • RESERVED_STATE_ID_PREFIX

      public static final String RESERVED_STATE_ID_PREFIX
      See Also:
    • DEAD_END_WORKFLOW_MOVEMENT

      public static final StateMovement DEAD_END_WORKFLOW_MOVEMENT
    • FORCE_FAILING_WORKFLOW_MOVEMENT

      public static final StateMovement FORCE_FAILING_WORKFLOW_MOVEMENT
  • Constructor Details

    • StateMovement

      public StateMovement()
  • Method Details

    • getStateId

      public abstract String getStateId()
    • getStateInput

      public abstract Optional<Object> getStateInput()
    • getStateOptionsOverride

      public abstract Optional<WorkflowStateOptions> getStateOptionsOverride()
    • getWaitForKey

      public abstract Optional<String> getWaitForKey()
    • gracefulCompleteWorkflow

      public static StateMovement gracefulCompleteWorkflow()
    • gracefulCompleteWorkflow

      public static StateMovement gracefulCompleteWorkflow(Object output)
    • forceCompleteWorkflow

      public static StateMovement forceCompleteWorkflow()
    • forceCompleteWorkflow

      public static StateMovement forceCompleteWorkflow(Object output)
    • forceFailWorkflow

      public static StateMovement forceFailWorkflow(Object output)
    • create

      public static <I> StateMovement create(Class<? extends WorkflowState<I>> stateClass, I stateInput, WorkflowStateOptions stateOptionsOverride)
      Type Parameters:
      I - Class type of the WorkflowState input
      Parameters:
      stateClass - required
      stateInput - optional, can be null
      stateOptionsOverride - optional, can be null. It is used to override the defined one in the State class
      Returns:
      state movement
    • create

      public static <I> StateMovement create(Class<? extends WorkflowState<I>> stateClass, I stateInput)
      Type Parameters:
      I - Class type of the WorkflowState input
      Parameters:
      stateClass - required
      stateInput - optional, can be null
      Returns:
      state movement
    • create

      public static <I> StateMovement create(Class<? extends WorkflowState<I>> stateClass)
      Type Parameters:
      I - Class type of the WorkflowState input
      Parameters:
      stateClass - required
      Returns:
      state movement
    • create

      public static StateMovement create(String stateId, Object stateInput, WorkflowStateOptions stateOptionsOverride)
      use the other one with WorkflowState class param if the stateId is provided by default, to make your code cleaner
      Parameters:
      stateId - required
      stateInput - optional, can be null
      stateOptionsOverride - optional, can be null. It is used to override the defined one in the State class
      Returns:
      state movement
    • create

      public static StateMovement create(String stateId, Object stateInput, WorkflowStateOptions stateOptionsOverride, String waitForKey)
    • create

      public static StateMovement create(String stateId)
      use the other one with WorkflowState class param if the stateId is provided by default, to make your code cleaner
      Parameters:
      stateId - stateId
      Returns:
      state movement