|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.engine.AnnotatedObject
org.springframework.webflow.engine.State
org.springframework.webflow.engine.TransitionableState
org.springframework.webflow.engine.SubflowState
public class SubflowState
A transitionable state that spawns a subflow when executed. When the subflow this state spawns ends, the ending result is used as grounds for a state transition out of this state.
A subflow state may be configured to map input data from its flow -- acting as the parent flow -- down to the subflow
when the subflow is spawned. In addition, output data produced by the subflow may be mapped up to the parent flow
when the subflow ends and the parent flow resumes. See the FlowAttributeMapper
interface definition for more
information on how to do this. The logic for ending a subflow is located in the EndState
implementation.
FlowAttributeMapper
,
EndState
Field Summary |
---|
Fields inherited from class org.springframework.webflow.engine.State |
---|
logger |
Fields inherited from class org.springframework.webflow.engine.AnnotatedObject |
---|
CAPTION_PROPERTY, DESCRIPTION_PROPERTY |
Constructor Summary | |
---|---|
SubflowState(Flow flow,
java.lang.String id,
Flow subflow)
Create a new subflow state. |
Method Summary | |
---|---|
protected void |
appendToString(org.springframework.core.style.ToStringCreator creator)
Subclasses may override this hook method to stringify their internal state. |
protected MutableAttributeMap |
createSubflowInput(RequestContext context)
Create the input data map for the spawned subflow session. |
protected ViewSelection |
doEnter(RequestControlContext context)
Specialization of State's doEnter template method that executes behaviour specific to this state
type in polymorphic fashion. |
FlowAttributeMapper |
getAttributeMapper()
Returns the attribute mapper used to map data between the parent and child flow, or null if no mapping is needed. |
Flow |
getSubflow()
Returns the subflow spawned by this state. |
ViewSelection |
onEvent(RequestControlContext context)
Called on completion of the subflow to handle the subflow result event as determined by the end state reached by the subflow. |
void |
setAttributeMapper(FlowAttributeMapper attributeMapper)
Set the attribute mapper used to map model data between the parent and child flow. |
Methods inherited from class org.springframework.webflow.engine.TransitionableState |
---|
exit, getExitActionList, getRequiredTransition, getTransitions, getTransitionSet, reenter |
Methods inherited from class org.springframework.webflow.engine.State |
---|
enter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, toString |
Methods inherited from class org.springframework.webflow.engine.AnnotatedObject |
---|
getAttributeMap, 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.definition.StateDefinition |
---|
getId, getOwner |
Methods inherited from interface org.springframework.webflow.definition.Annotated |
---|
getAttributes, getCaption, getDescription |
Constructor Detail |
---|
public SubflowState(Flow flow, java.lang.String id, Flow subflow) throws java.lang.IllegalArgumentException
flow
- the owning flowid
- the state identifier (must be unique to the flow)subflow
- the subflow to spawn
java.lang.IllegalArgumentException
- when this state cannot be added to given flow, e.g. because the id is not uniquesetAttributeMapper(FlowAttributeMapper)
Method Detail |
---|
public Flow getSubflow()
public FlowAttributeMapper getAttributeMapper()
public void setAttributeMapper(FlowAttributeMapper attributeMapper)
protected ViewSelection doEnter(RequestControlContext context) throws FlowExecutionException
doEnter
template method that executes behaviour specific to this state
type in polymorphic fashion.
Entering this state, creates the subflow input map and spawns the subflow in the current flow execution.
doEnter
in class State
context
- the control context for the currently executing flow, used by this state to manipulate the flow
execution
FlowExecutionException
- if an exception occurs in this stateprotected MutableAttributeMap createSubflowInput(RequestContext context)
Flow.start(RequestControlContext, MutableAttributeMap)
.
public ViewSelection onEvent(RequestControlContext context)
onEvent
in class TransitionableState
context
- the flow execution control context
protected void appendToString(org.springframework.core.style.ToStringCreator creator)
State
appendToString
in class TransitionableState
creator
- the toString creator, to stringify properties
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |