Interface STM<StateEntityType extends StateEntity>

All Known Implementing Classes:
STMImpl

public interface STM<StateEntityType extends StateEntity>
An implementation of a state transition machine. This would allow the caller to proceed from one state to the other. The implementation is designed to support two types of states: Auto state - a state whose transitions can be computed automatically by calling a method in a class. Manual state - a state that requires some triggering event (ex: user input in a form, user responding to an email etc.) to progress further.

The STM also supports the notion of an initial state

Author:
Raja Shankar Kolluru
  • Field Details

  • Method Details

    • proceed

      StateEntityType proceed(StateEntityType stateEntity) throws Exception
      This method allows the user to specify no starting state and feed it to the STM. This would start with the default flow and the initial state in it. It would then recursively process thru all "auto states" and finally returns the new state to which it transitioned.

      The new state is either an end state or a manual state (i.e. a state that requires a user triggered action to determine the transitioning event)

      This proceed() method supports the following kinds of behavior:

      If the state passed is null, then the initial state of the default flow is chosen.
      Parameters:
      stateEntity - - the parameter required by the transition action
      Returns:
      the transitioned state.
      Throws:
      Exception
    • proceed

      StateEntityType proceed(StateEntityType stateEntity, Object actionParam) throws Exception
      This method allows the user to specify a starting state and feed it to the STM. This would recursively process thru all "auto states" and finally returns the new state to which it transitioned.

      The new state is either an end state or a manual state (i.e. a state that requires a user triggered action to determine the transitioning event)

      This proceed() method supports the following kinds of behavior: If the state passed is null, then the initial state of the default flow is chosen.

      Parameters:
      stateEntity - - the entity with a state that needs to be processed by the STM
      actionParam - - the parameter required by the transition action
      Returns:
      the transitioned state.
      Throws:
      Exception
    • proceed

      StateEntityType proceed(StateEntityType stateEntityType, String startingEventId, Object actionParam) throws Exception
      This method allows the user to specify a starting state and feed it to the STM. This would recursively process thru all "action states" and finally returns the new state to which it transitioned.

      The new state is either an end state or a view state (i.e. a state that requires a user triggered action to determine the transitioning event)

      This proceed() method uses the specified state in the specified flow.

      Parameters:
      stateEntityType - - the entity with a state that needs to be processed by the STM
      startingEventId - - the event that needs to start the flow. This would have been most probably obtained by the user.
      actionParam - - the parameter required by the transition action
      Returns:
      the transitioned state.
      Throws:
      Exception
    • setStmFlowStore

      void setStmFlowStore(STMFlowStore stmFlowStore)
      Initialization method. The flow needs to be read by a flow configurator which needs to be set into the STM.
      Parameters:
      stmFlowStore -