Class CompositeAction
java.lang.Object
org.springframework.webflow.action.AbstractAction
org.springframework.webflow.action.CompositeAction
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,Action
An action that will execute an ordered chain of other actions when executed.
The event id of the last not-null result returned by the executed actions will be used as the result event id of the composite action. Lacking that, the action will return the "success" event.
The resulting event will have an "actionResults" event attribute with a list of all events returned by the executed actions, including the null events. This allows you to relate an executed action and its result event by their index in the list.
This is the classic GoF composite design pattern.
- Author:
- Keith Donald
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The resulting event whill have an attribute of this name which holds a list of all events returned by the executed actions.Fields inherited from class org.springframework.webflow.action.AbstractAction
logger
-
Constructor Summary
ConstructorDescriptionCompositeAction
(Action... actions) Create a composite action composed of given actions. -
Method Summary
Modifier and TypeMethodDescriptiondoExecute
(RequestContext context) Template hook method subclasses should override to encapsulate their specific action execution logic.protected Action[]
Returns the actions contained by this composite action.boolean
Returns the stop on error flag.void
setStopOnError
(boolean stopOnError) Sets the stop on error flag.toString()
Methods inherited from class org.springframework.webflow.action.AbstractAction
afterPropertiesSet, doPostExecute, doPreExecute, error, error, execute, getActionNameForLogging, getEventFactorySupport, initAction, no, result, result, result, result, success, success, yes
-
Field Details
-
ACTION_RESULTS_ATTRIBUTE_NAME
The resulting event whill have an attribute of this name which holds a list of all events returned by the executed actions. ("actionResults")- See Also:
-
-
Constructor Details
-
CompositeAction
Create a composite action composed of given actions.- Parameters:
actions
- the actions
-
-
Method Details
-
getActions
Returns the actions contained by this composite action.- Returns:
- the actions
-
isStopOnError
public boolean isStopOnError()Returns the stop on error flag. -
setStopOnError
public void setStopOnError(boolean stopOnError) Sets the stop on error flag. This determines whether or not execution should stop with the first action that returns an error event. In the error case, the composite action will also return the "error" event. -
doExecute
Description copied from class:AbstractAction
Template hook method subclasses should override to encapsulate their specific action execution logic.- Specified by:
doExecute
in classAbstractAction
- Parameters:
context
- the action execution context, for accessing and setting data in "flow scope" or "request scope"- Returns:
- the action result event
- Throws:
Exception
- an unrecoverable exception occured, either checked or unchecked
-
toString
-