public class ActionState extends TransitionableState
If more than one action is configured they are executed in an ordered chain until one returns a result event that matches a state transition out of this state. This is a form of the Chain of Responsibility (CoR) pattern.
The result of an action's execution is typically the criteria for a transition out of this state. Additional
information in the current
RequestContext may also be tested as part of custom transitional criteria,
allowing for sophisticated transition expressions that reason on contextual state.
|Constructor and Description|
Creates a new action state.
|Modifier and Type||Method and Description|
Subclasses may override this hook method to print their internal state to a string.
Specialization of State's
Returns the list of actions executable by this action state.
Get a transition in this state for given flow execution request context.
exit, getExitActionList, getTransition, getTransitions, getTransitionSet, handleEvent
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
public ActionState(Flow flow, java.lang.String id) throws java.lang.IllegalArgumentException
flow- the owning flow
id- the state identifier (must be unique to the flow)
java.lang.IllegalArgumentException- when this state cannot be added to given flow, e.g. beasue the id is not unique
public ActionList getActionList()
public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException
protected void doEnter(RequestControlContext context) throws FlowExecutionException
doEntertemplate method that executes behavior specific to this state type in polymorphic fashion.
This implementation iterates over each configured
Action instance and executes it. Execution
continues until an
Action returns a result event that matches a transition in this request context,
or the set of all actions is exhausted.
protected void appendToString(org.springframework.core.style.ToStringCreator creator)