org.springframework.webflow.execution
Interface FlowExecution

All Superinterfaces:
FlowExecutionContext, FlowExecutionStatistics
All Known Implementing Classes:
FlowExecutionImpl

public interface FlowExecution
extends FlowExecutionContext

Represents a client instance of an executing flow. This is the central facade interface for managing an execution of a single flow.

Typically, when the browser requests to execute a new flow, an instance of an object implementing this interface is created by a controlling FlowExecutionManager. After creation, the start operation is called, which causes this execution to activate the requested flow as the "root flow" and enter that flow's start state. After starting, when control is returned back to the caller, this execution is saved in some form of storage, for example in the HttpSession or a client-side hidden form field for later restoration and manipulation.

Subsequent requests into the web flow system to manipulate an existing executing flow trigger restoration and rehydration of this object, followed by an invocation of the signalEvent operation. This continues until an event causes this flow execution to end, at which time it is removed from storage and discarded.

Author:
Keith Donald, Erwin Vervaet
See Also:
FlowExecutionManager, FlowExecutionStorage

Method Summary
 FlowExecutionListenerList getListeners()
          Return a list of listeners monitoring the lifecycle of this flow execution.
 void rehydrate(FlowLocator flowLocator, FlowExecutionListenerLoader listenerLoader, TransactionSynchronizer transactionSynchronizer)
          Rehydrate this flow execution after deserialization.
 ViewDescriptor signalEvent(Event sourceEvent)
          Signal an occurence of the specified event in the current state of this executing flow.
 ViewDescriptor start(Event sourceEvent)
          Start a flow execution, transitioning the flow to the start state and returning the starting model and view descriptor.
 
Methods inherited from interface org.springframework.webflow.FlowExecutionContext
getActiveFlow, getActiveSession, getCurrentState, getRootFlow
 
Methods inherited from interface org.springframework.webflow.FlowExecutionStatistics
getCaption, getCreationTimestamp, getKey, getLastEventId, getLastRequestTimestamp, getUptime, isActive, isRootFlowActive
 

Method Detail

start

ViewDescriptor start(Event sourceEvent)
                     throws java.lang.IllegalStateException
Start a flow execution, transitioning the flow to the start state and returning the starting model and view descriptor. Typically called by a flow controller, but also from test code.

Parameters:
sourceEvent - the event that occured that triggered flow execution creation
Returns:
the starting view descriptor, which returns control to the client and requests that a view be rendered with model data
Throws:
java.lang.IllegalStateException - if this execution has already been started, or no state is marked as the start state.

signalEvent

ViewDescriptor signalEvent(Event sourceEvent)
                           throws FlowNavigationException,
                                  java.lang.IllegalStateException
Signal an occurence of the specified event in the current state of this executing flow.

Parameters:
sourceEvent - the event that occured within the current state of this flow execution.
Returns:
the next model and view descriptor to display for this flow execution, this returns control to the client and requests that a view be rendered with model data
Throws:
FlowNavigationException - if the signaled event does not map to any state transitions in the current state
java.lang.IllegalStateException - if the flow execution is not active and thus is no longer (or not yet) processing events

rehydrate

void rehydrate(FlowLocator flowLocator,
               FlowExecutionListenerLoader listenerLoader,
               TransactionSynchronizer transactionSynchronizer)
Rehydrate this flow execution after deserialization.

Parameters:
flowLocator - the flow locator
listenerLoader - the flow execution listener loader to use to obtain all listeners that apply
transactionSynchronizer - application transaction synchronization strategy to use

getListeners

FlowExecutionListenerList getListeners()
Return a list of listeners monitoring the lifecycle of this flow execution.

Returns:
the flow execution listeners


Copyright © 2005. All Rights Reserved.