public class EndState extends State
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.
SubflowState
CAPTION_PROPERTY, DESCRIPTION_PROPERTY
Constructor and Description |
---|
EndState(Flow flow,
java.lang.String id)
Create a new end state with no associated view.
|
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 LocalAttributeMap<java.lang.Object> |
createSessionOutput(RequestContext context)
Returns the subflow output map.
|
protected void |
doEnter(RequestControlContext context)
Specialization of State's
doEnter 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.
|
doPreEntryActions, enter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, isViewState, toString
getAttributes, getCaption, getDescription, setCaption, setDescription
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAttributes, getCaption, getDescription
public EndState(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. because the id is not uniqueState.State(Flow, String)
,
setFinalResponseAction(Action)
,
setOutputMapper(Mapper)
public void setFinalResponseAction(Action finalResponseAction)
public void setOutputMapper(Mapper outputMapper)
protected void doEnter(RequestControlContext context) throws FlowExecutionException
doEnter
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.
doEnter
in class State
context
- the control context for the currently executing flow, used by this state to manipulate the flow
executionFlowExecutionException
- if an exception occurs in this stateprotected LocalAttributeMap<java.lang.Object> createSessionOutput(RequestContext context)
protected void appendToString(org.springframework.core.style.ToStringCreator creator)
State
appendToString
in class State
creator
- the toString creator, to print properties to stringState.toString()