Class ActionState
- All Implemented Interfaces:
Annotated,StateDefinition,TransitionableStateDefinition
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.
- Author:
- Keith Donald, Erwin Vervaet
- See Also:
-
Field Summary
Fields inherited from class org.springframework.webflow.core.AnnotatedObject
CAPTION_PROPERTY, DESCRIPTION_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendToString(org.springframework.core.style.ToStringCreator creator) Subclasses may override this hook method to print their internal state to a string.protected voiddoEnter(RequestControlContext context) Specialization of State'sdoEntertemplate method that executes behavior specific to this state type in polymorphic fashion.Returns the list of actions executable by this action state.getRequiredTransition(RequestContext context) Get a transition in this state for given flow execution request context.Methods inherited from class org.springframework.webflow.engine.TransitionableState
exit, getExitActionList, getTransition, getTransitions, getTransitionSet, handleEventMethods inherited from class org.springframework.webflow.engine.State
doPreEntryActions, enter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, isViewState, toStringMethods inherited from class org.springframework.webflow.core.AnnotatedObject
getAttributes, getCaption, getDescription, setCaption, setDescriptionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.webflow.core.Annotated
getAttributes, getCaption, getDescriptionMethods inherited from interface org.springframework.webflow.definition.StateDefinition
getId, getOwner, isViewState
-
Constructor Details
-
ActionState
Creates a new action state.- Parameters:
flow- the owning flowid- the state identifier (must be unique to the flow)- Throws:
IllegalArgumentException- when this state cannot be added to given flow, e.g. beasue the id is not unique- See Also:
-
-
Method Details
-
getActionList
Returns the list of actions executable by this action state. The returned list is mutable.- Returns:
- the state action list
-
getRequiredTransition
public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException Description copied from class:TransitionableStateGet a transition in this state for given flow execution request context. Throws and exception when there is no corresponding transition.- Overrides:
getRequiredTransitionin classTransitionableState- Throws:
NoMatchingTransitionException- when a matching transition cannot be found
-
doEnter
Specialization of State'sdoEntertemplate method that executes behavior specific to this state type in polymorphic fashion.This implementation iterates over each configured
Actioninstance and executes it. Execution continues until anActionreturns a result event that matches a transition in this request context, or the set of all actions is exhausted.- Specified by:
doEnterin classState- Parameters:
context- the control context for the currently executing flow, used by this state to manipulate the flow execution- Throws:
FlowExecutionException- if an exception occurs in this state
-
appendToString
protected void appendToString(org.springframework.core.style.ToStringCreator creator) Description copied from class:StateSubclasses may override this hook method to print their internal state to a string. This default implementation does nothing.- Overrides:
appendToStringin classTransitionableState- Parameters:
creator- the toString creator, to print properties to string- See Also:
-