public class SubflowState extends TransitionableState
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 SubflowAttributeMapper
interface definition for
more information on how to do this. The logic for ending a subflow is located in the EndState
implementation.
SubflowAttributeMapper
,
EndState
CAPTION_PROPERTY, DESCRIPTION_PROPERTY
Constructor and Description |
---|
SubflowState(Flow flow,
String id,
Expression subflow)
Create a new subflow state.
|
Modifier and Type | Method and Description |
---|---|
boolean |
handleEvent(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(SubflowAttributeMapper attributeMapper)
Set the attribute mapper used to map model data between the parent and child flow.
|
exit, getExitActionList, getRequiredTransition, getTransition, getTransitions, getTransitionSet
enter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, isViewState, toString
getAttributes, getCaption, getDescription, setCaption, setDescription
getId, getOwner, isViewState
getAttributes, getCaption, getDescription
public SubflowState(Flow flow, String id, Expression subflow) throws IllegalArgumentException
flow
- the owning flowid
- the state identifier (must be unique to the flow)subflow
- the subflow to spawnIllegalArgumentException
- when this state cannot be added to given flow, e.g. because the id is not uniquesetAttributeMapper(SubflowAttributeMapper)
public void setAttributeMapper(SubflowAttributeMapper attributeMapper)
public boolean handleEvent(RequestControlContext context)
handleEvent
in class TransitionableState
context
- the flow execution control context