public interface TransitionAction<S extends Enum<S>>
TransitionAction encapsulates the actions to be performed as part
of the Transition from one state to another.Transition| Modifier and Type | Method and Description |
|---|---|
void |
onTransition(String sName,
S stateFrom,
S stateTo,
Event<S> event,
ExecutionContext context)
Performs the necessary actions as part of a
Transition from one
state to another, triggered by a specified Event. |
void onTransition(String sName, S stateFrom, S stateTo, Event<S> event, ExecutionContext context) throws RollbackTransitionException
Transition from one
state to another, triggered by a specified Event.
Note: After executing this method the FiniteStateMachine will
automatically move to the state specified by the Transition.
sName - the name of the transitionstateFrom - the state from which the transition is occurringstateTo - the state to which the transition is occurringevent - the Event that triggered the Transitioncontext - the ExecutionContext for the actionRollbackTransitionException - if the Transition should be
aborted and the FiniteStateMachine
should be left in it's current state