A top-level instance of a flow definition that carries out definition
execution on behalf of a single client. Typically used to support the
orchestration of a web conversation.
This is the central facade interface for manipulating one runtime execution
of a flow definition. Implementations of this interface are the finite state
machine that is the heart of Spring Web Flow.
Typically, when a client wants to launch a flow execution at production time,
she passes the id of the governing
FlowDefinition flow definition to
a coordinating
org.springframework.webflow.executor.FlowExecutor.launch(StringExternalContext) flow executor .
This coordinator then typically uses a
FlowExecutionFactory flow execution factory to create an object
implementing this interface, initializing it with the requested flow
definition which becomes the execution's "root" or top-level flow.
After execution creation, the
FlowExecution.start(MutableAttributeMap,ExternalContext) start operation is
called, which causes this execution to activate a new
FlowSession session for its root flow definition. That session is
then said to become the active flow. An execution
RequestContext request context is created, the Flow's
FlowDefinition.getStartState start state is entered, and the
request is processed.
In a distributed environment such as HTTP, after a call into this object has
completed and control returns to the caller, this execution object (if still
active) is typically saved out to a repository 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. This
execution persistence is the responsibility of the
org.springframework.webflow.execution.repository.FlowExecutionRepository flow execution repository subsystem.
Subsequent requests from the client to manipuate this flow execution trigger
restoration of this object, followed by an invocation of the
FlowExecution.signalEvent(String,ExternalContext) signal event operation. The
signalEvent operation resumes this execution by indicating what action the
user took from within the current state; for example, the user may have
pressed the "submit" button, or pressed "cancel". After the user
event is processed, control again goes back to the caller and if this
execution is still active, it is again saved out to the repository.
This process continues until a client event causes this flow execution to end
(by the root flow reaching an end state). At that time this object is no
longer active, and is removed from the repository and discarded.
Flow executions can have their lifecycle observed by
FlowExecutionListener listeners .
See Also: FlowDefinition See Also: FlowSession See Also: RequestContext See Also: FlowExecutionListener See Also: org.springframework.webflow.execution.repository.FlowExecutionRepository See Also: org.springframework.webflow.executor.FlowExecutor author: Keith Donald author: Erwin Vervaet |