public class CompositeAction extends AbstractAction
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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
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.
|
logger
Constructor and Description |
---|
CompositeAction(Action... actions)
Create a composite action composed of given actions.
|
Modifier and Type | Method and Description |
---|---|
Event |
doExecute(RequestContext context)
Template hook method subclasses should override to encapsulate their specific action execution logic.
|
protected Action[] |
getActions()
Returns the actions contained by this composite action.
|
boolean |
isStopOnError()
Returns the stop on error flag.
|
void |
setStopOnError(boolean stopOnError)
Sets the stop on error flag.
|
java.lang.String |
toString() |
afterPropertiesSet, doPostExecute, doPreExecute, error, error, execute, getActionNameForLogging, getEventFactorySupport, initAction, no, result, result, result, result, success, success, yes
public static final java.lang.String ACTION_RESULTS_ATTRIBUTE_NAME
public CompositeAction(Action... actions)
actions
- the actionsprotected Action[] getActions()
public boolean isStopOnError()
public void setStopOnError(boolean stopOnError)
public Event doExecute(RequestContext context) throws java.lang.Exception
AbstractAction
doExecute
in class AbstractAction
context
- the action execution context, for accessing and setting data in "flow scope" or "request scope"java.lang.Exception
- an unrecoverable exception occured, either checked or uncheckedpublic java.lang.String toString()
toString
in class java.lang.Object