Class EndState
java.lang.Object
org.springframework.webflow.core.AnnotatedObject
org.springframework.webflow.engine.State
org.springframework.webflow.engine.EndState
- All Implemented Interfaces:
Annotated
,StateDefinition
A state that ends a flow when entered. This state ends the active flow session of an ongoing flow execution.
If the ended session is the "root flow session" the entire flow execution ends, signaling the end of a logical conversation.
If the terminated session was acting as a subflow, the flow execution continues and control is returned to the parent flow session. In that case, this state returns an ending result event the resuming parent flow responds to.
An end state may be configured with a renderer to render a final response. This renderer will be invoked if the end state terminates the entire flow execution.
- Author:
- Keith Donald, Colin Sampaleanu, Erwin Vervaet
- See Also:
-
Field Summary
Fields inherited from class org.springframework.webflow.core.AnnotatedObject
CAPTION_PROPERTY, DESCRIPTION_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendToString
(org.springframework.core.style.ToStringCreator creator) Subclasses may override this hook method to print their internal state to a string.protected LocalAttributeMap<Object>
createSessionOutput
(RequestContext context) Returns the subflow output map.protected void
doEnter
(RequestControlContext context) Specialization of State'sdoEnter
template method that executes behavior specific to this state type in polymorphic fashion.void
setFinalResponseAction
(Action finalResponseAction) Sets the renderer that will render the final flow execution response.void
setOutputMapper
(Mapper outputMapper) Sets the attribute mapper to use for mapping output attributes exposed by this end state when it is entered.Methods inherited from class org.springframework.webflow.engine.State
doPreEntryActions, enter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, isViewState, toString
Methods inherited from class org.springframework.webflow.core.AnnotatedObject
getAttributes, getCaption, getDescription, setCaption, setDescription
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.webflow.core.Annotated
getAttributes, getCaption, getDescription
-
Constructor Details
-
EndState
Create a new end state with no associated view.- 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. because the id is not unique- See Also:
-
-
Method Details
-
setFinalResponseAction
Sets the renderer that will render the final flow execution response. -
setOutputMapper
Sets the attribute mapper to use for mapping output attributes exposed by this end state when it is entered. -
doEnter
Specialization of State'sdoEnter
template method that executes behavior specific to this state type in polymorphic fashion.This implementation pops the top (active) flow session off the execution stack, ending it, and resumes control in the parent flow (if necessary). If the ended session is the root flow, a final response is rendered.
- Specified by:
doEnter
in 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
-
createSessionOutput
Returns the subflow output map. This will invoke the output mapper (if any) to map data available in the flow execution request context into a newly created empty map. -
appendToString
protected void appendToString(org.springframework.core.style.ToStringCreator creator) Description copied from class:State
Subclasses may override this hook method to print their internal state to a string. This default implementation does nothing.- Overrides:
appendToString
in classState
- Parameters:
creator
- the toString creator, to print properties to string- See Also:
-