See javadocs of FlowExecution, FlowSession, and RequestContext specifically. (recently updated):
FlowExecution
Code:
/**
* Represents a <i>client instance</i> of an executing top-level flow.
* <p>
* This is the central facade interface for managing one runtime execution of a Flow.
* This is the finite state machine that is the heart of Spring Web Flow.
* <p>
* Typically, when a browser wants to launch a new instance of a Flow at runtime, it passes in the
* id of the Flow definition to launch to a governing <code>FlowExecutionManager</code>.
* The manager then creates an instance of an object implementing this interface for
* the requested Flow, which becomes this execution's "root flow". After creation,
* the start operation is called, which causes this execution to activate a new session for its
* root flow definition. That session is then pushed onto a stack and its definition
* becomes the "active flow" for this execution. A local, internal StateContext object (which extends
* ({@link org.springframework.webflow.RequestContext}) is then created
* and the active Flow's start State is entered.
* <p>
* In a distributed environment such as HTTP, after the start operation has completed
* and control returns to the caller (manager), this execution is typically saved out to some form of
* storage before the server request ends. For example it might be saved out to the HttpSession,
* a Database, or a client-side hidden form field for later restoration and manipulation.
* <p>
* Subsequent requests from the client to manipulate this runtime object, trigger restoration
* and rehydration of this object, followed by an invocation of the signalEvent operation.
* The signalEvent operation tells this state machine what action the user took from
* within the context of the current state: e.g a submit button was pressed, or the cancel button was
* pressed. After the event is processed, control again goes back to the client.
* This continues until an client event causes this flow execution to end, at which time this
* object is removed from storage and discarded.
*
* @see org.springframework.webflow.execution.FlowExecutionManager
* @see org.springframework.webflow.execution.FlowExecutionStorage
* @see org.springframework.webflow.Flow
* @see org.springframework.webflow.State
* @see org.springframework.webflow.FlowSession
* @see org.springframework.webflow.StateContext
*
* @author Keith Donald
* @author Erwin Vervaet
*/
FlowSession
Code:
/**
* A runtime object that represents a single client session of a
* specific <code>Flow</code> definition. This object maintains all the
* state of the session, including its status within exactly one
* governing FlowExecution and its current State. This object also acts
* "flow scope" data model. Data in "flow scope" lives for the life
* of this object, and is cleaned up automatically when this object is
* destroyed. Destruction happens when this session reaches a end state.
* <p>
* This object is fully managed by a FlowExecution within a stack-based
* data structure, where each session in the stack is a spawned
* flow at a specific state. The session at the top of the
* stack is the currently active flow. This stack of flow sessions captures the
* complete and current state (snapshot) of an executing flow.
* <p>
* A flow session will go through several status changes during its lifecycle.
* Initially it will be {@link FlowSessionStatus#CREATED}. For example, when
* a new <code>FlowExecution</code> is created to launch a new root
* <code>Flow</code> definition a new <code>FlowSession</code> is created.
* <p>
* When a flow session is activated (about to be manipulated), it's status becomes
* {@link FlowSessionStatus#ACTIVE}. In the case of a new FlowExecution,
* session activation happens immediately after creation to put the "root flow" at
* the top of the stack and transition it to its start state.
* <p>
* When control returns to the client for user think time, the status is updated
* to {@link FlowSessionStatus#PAUSED}. The flow is no longer actively
* processing: it's stored off somewhere waiting on the user to do something.
* <p>
* If a flow session is pushed down in the stack because a subflow is spawned, it's
* status becomes {@link FlowSessionStatus#SUSPENDED} until the subflow returns (ends)
* and is popped off the stack. The resuming flow session then becomes active once
* again.
* <p>
* When a flow session is terminated because an EndState is reached, its status
* becomes {@link FlowSessionStatus#ENDED}, ending its lifecycle. The session is
* popped off the stack and discarded, and any allocated resources in "flow scope" are
* automatically cleaned up.
* <p>
* Note that a flow <i>session</i> is in no way linked to an HTTP session! It
* just uses the familiar "session" naming convention to denote a stateful
* interaction.
*
* @author Keith Donald
* @author Erwin Vervaet
*/
public interface FlowSession {
RequestContext
Code:
/**
* Central interface that allows clients to access contextual information about
* an ongoing flow execution within the context of a client request. The term
* <i>request</i> is used to describe a single call (thread) into the flow system to
* manipulate exactly one flow execution.
* <p>
* A new instance of this object is created when one of the operations on a
* <code>FlowExecution</code> facade invoked, either
* ({@link org.springframework.webflow.execution.FlowExecution#start(Event)}
* to activate a newly created flow execution, or
* {@link org.springframework.webflow.execution.FlowExecution#signalEvent(Event)}) to
* signal an event in the current state of an restored flow execution.
* <p>
* Once created this context object is passed around throughout request
* processing where it may be accessed and reasoned upon, typically by
* user-implemented action code and/or state transition criteria.
* <p>
* When a call into a flow execution returns, this object goes out of scope
* and is disposed of automatically. Thus, this object is an internal artifact
* used within a FlowExecution: this object is NOT directly exposed to to external
* client code.
* <p>
* Note: the "requestScope" property may be used as a store for arbitrary data that
* should exist for the life of this object. Such request-local data, along with
* all data in flow scope, is available for exposing to view templates via a
* ViewDescriptor, returned when a ViewState or EndState is entered.
* See ({@link org.springframework.webflow.ViewState}) for an example using
* a specific ({@link org.springframework.webflow.ViewDescriptorCreator}) strategy.
* <p>
* Note: the <i>request</i> context is in no way linked to an HTTP or Portlet request!
* It uses the familiar "request" naming convention to indicate a single call to
* manipulate an runtime execution of a flow.
*
* @see org.springframework.webflow.execution.FlowExecution
* @see org.springframework.webflow.Action
* @see org.springframework.webflow.TransitionCriteria
*
* @author Keith Donald
* @author Erwin Vervaet
*/