public State nextState ( String actionName ) throws IllegalTransitionException { Transition t = currentState . getTransition ( actionName ) ; if ( t == null ) { String msg = "No transition for action: '" + actionName + "' from state: '" + currentState . getName ( ) + "'" ; throw new IllegalTransitionException ( msg ) ; } State nextState = t . getTarget ( ) ; log . trace ( "nextState(" + actionName + ") = " + nextState ) ; currentState = nextState ; return currentState ; }
Transition to the next state given the name of a valid transition .