public abstract class TransitionableState extends State implements TransitionableStateDefinition
Transition
,
TransitionCriteria
CAPTION_PROPERTY, DESCRIPTION_PROPERTY
Modifier | Constructor and Description |
---|---|
protected |
TransitionableState(Flow flow,
java.lang.String id)
Create a new transitionable state.
|
Modifier and Type | Method and Description |
---|---|
protected void |
appendToString(org.springframework.core.style.ToStringCreator creator)
Subclasses may override this hook method to print their internal state to a string.
|
void |
exit(RequestControlContext context)
Exit this state.
|
ActionList |
getExitActionList()
Returns the list of actions executed by this state when it is exited.
|
Transition |
getRequiredTransition(RequestContext context)
Get a transition in this state for given flow execution request context.
|
TransitionDefinition |
getTransition(java.lang.String eventId)
Returns the transition that matches the event with the provided id.
|
TransitionDefinition[] |
getTransitions()
Returns the available transitions out of this state.
|
TransitionSet |
getTransitionSet()
Returns the set of transitions.
|
boolean |
handleEvent(RequestControlContext context)
Inform this state definition that an event was signaled in it.
|
doEnter, doPreEntryActions, enter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, isViewState, toString
getAttributes, getCaption, getDescription, setCaption, setDescription
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getOwner, isViewState
getAttributes, getCaption, getDescription
protected TransitionableState(Flow flow, java.lang.String id) throws java.lang.IllegalArgumentException
flow
- the owning flowid
- the state identifier (must be unique to the flow)java.lang.IllegalArgumentException
- when this state cannot be added to given flow, for instance when the id is not
uniqueState.State(Flow, String)
,
getTransitionSet()
public TransitionDefinition[] getTransitions()
TransitionableStateDefinition
getTransitions
in interface TransitionableStateDefinition
public TransitionDefinition getTransition(java.lang.String eventId)
TransitionableStateDefinition
getTransition
in interface TransitionableStateDefinition
eventId
- the event idpublic TransitionSet getTransitionSet()
public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException
NoMatchingTransitionException
- when a matching transition cannot be foundpublic ActionList getExitActionList()
public boolean handleEvent(RequestControlContext context) throws NoMatchingTransitionException
RequestContext.getCurrentEvent()
).context
- the flow execution control contextNoMatchingTransitionException
- when a matching transition cannot be foundpublic void exit(RequestControlContext context)
context
- the flow control contextprotected void appendToString(org.springframework.core.style.ToStringCreator creator)
State
appendToString
in class State
creator
- the toString creator, to print properties to stringState.toString()