Expert Spring MVC and Web Flow

(Dana P.) #1
Figure 12-2.FlowSession life cycle

Table 12-4.Status of the FlowSession
Status Meaning Event
Created The FlowSessionhas been created, Creation of a new FlowExecution.
but is not yet active.
Active The FlowSessionis currently executing. When a flow is resumed.
Paused The FlowSessionis awaiting user input. When the view is rendered.
Suspended The FlowSessionis still valid, but not active. When a new subflow is created, the
existing FlowSessionis suspended.
Ended The FlowSessionis no longer active. When the end state has been reached.

RequestContext
So far we have looked at FlowExecutionwhich represents the execution of an entire top-level
flow including any subflows that are spawned, and FlowSessionwhich represents the execu-
tion of a single flow definition. There is one final lifetimethat hasn’t yet been covered, the
lifetime of a request to manipulate a FlowExecution. This is modeled by org.springframework.
webflow.RequestContext. You may recognize this as the parameter that is passed into the
org.springframework.webflow.Action.execute()method. This object is the one that you will
probably be most familiar with if you have implemented a custom Web Flow artifact such as

FlowExecution
SessionA

SessionB

SessionC

(suspended)
(suspended)

<flow start-state=“...”>
<action-state ....>
....
</action-state>

<subflow-state ....>

<subflow-state ....>

</subflow-state ....>

</subflow-state ....>

<view-state>
....
</view-state>
</flow>

350 CHAPTER 12 ■ADVANCED SPRING WEB FLOW

Free download pdf