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.
ActionCAPTION_PROPERTY, DESCRIPTION_PROPERTY| Constructor and Description |
|---|
ActionState(Flow flow,
java.lang.String id)
Creates a new action 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.
|
protected void |
doEnter(RequestControlContext context)
Specialization of State's
doEnter template method that executes behavior specific to this state type
in polymorphic fashion. |
ActionList |
getActionList()
Returns the list of actions executable by this action state.
|
Transition |
getRequiredTransition(RequestContext context)
Get a transition in this state for given flow execution request context.
|
exit, getExitActionList, getTransition, getTransitions, getTransitionSet, handleEventdoPreEntryActions, enter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, isViewState, toStringgetAttributes, getCaption, getDescription, setCaption, setDescriptionclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetId, getOwner, isViewStategetAttributes, getCaption, getDescriptionpublic ActionState(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, e.g. beasue the id is not uniquegetActionList()public ActionList getActionList()
public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException
TransitionableStategetRequiredTransition in class TransitionableStateNoMatchingTransitionException - when a matching transition cannot be foundprotected void doEnter(RequestControlContext context) throws FlowExecutionException
doEnter template 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.
doEnter in class Statecontext - the control context for the currently executing flow, used by this state to manipulate the flow
executionFlowExecutionException - if an exception occurs in this stateprotected void appendToString(org.springframework.core.style.ToStringCreator creator)
StateappendToString in class TransitionableStatecreator - the toString creator, to print properties to stringState.toString()