Interface FlowExecutionContext
- All Known Subinterfaces:
FlowExecution
- All Known Implementing Classes:
FlowExecutionImpl,MockFlowExecutionContext
public interface FlowExecutionContext
Provides contextual information about a flow execution. A flow execution is an runnable instance of a
FlowDefinition. It is the central Spring Web Flow construct for carrying out a conversation with a client.
This immutable interface provides access to runtime information about the conversation, such as it's
status and current state.
An object implementing this interface is also traversable from a execution request context (see
RequestContext.getFlowExecutionContext()).
This interface provides information that may span more than one request in a thread safe manner. The
RequestContext interface defines a request specific control interface for manipulating exactly one
flow execution locally from exactly one request.
- Author:
- Keith Donald, Erwin Vervaet
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the active flow session of this flow execution.Returns runtime execution attributes that may influence the behavior of flow artifacts, such as states and actions.Returns a mutable map for data held in "conversation scope".Returns the root flow definition associated with this executing flow.Returns a mutable map for data held in "flash scope".getKey()Returns the key assigned to this flow execution.Returns the outcome reached by this execution, or null if this execution has not yet ended.booleanhasEnded()Returns a flag indicating if this execution has ended.booleanReturns a flag indicating if this execution has been started.booleanisActive()Is the flow execution active? A flow execution is active once it has anactive sessionand remains active until it has ended.
-
Method Details
-
getKey
FlowExecutionKey getKey()Returns the key assigned to this flow execution. The flow execution key is the flow execution's persistent identity.- Returns:
- the flow execution key; may be
nullif a key has not yet been assigned.
-
getDefinition
FlowDefinition getDefinition()Returns the root flow definition associated with this executing flow.A call to this method always returns the same flow definition -- the top-level "root" -- no matter what flow may actually be active (for example, if subflows have been spawned).
- Returns:
- the root flow definition
-
hasStarted
boolean hasStarted()Returns a flag indicating if this execution has been started. A flow execution that has started and is active is currently in progress. A flow execution that has started and is not active has ended.- Returns:
- true if started, false if not started
- See Also:
-
isActive
boolean isActive()Is the flow execution active? A flow execution is active once it has anactive sessionand remains active until it has ended.- Returns:
- true if active, false if the flow execution has terminated or has not yet been started
-
hasEnded
boolean hasEnded()Returns a flag indicating if this execution has ended. A flow execution that has ended has been started but is no longer active.- Returns:
- true if ended, false if not started or still active
- See Also:
-
getOutcome
FlowExecutionOutcome getOutcome()Returns the outcome reached by this execution, or null if this execution has not yet ended.- Returns:
- the outcome, or
nullif this execution has not yet ended
-
getActiveSession
Returns the active flow session of this flow execution. The active flow session is the currently executing session. It may be the "root flow" session, or it may be a subflow session if this flow execution has spawned a subflow.- Returns:
- the active flow session
- Throws:
IllegalStateException- if this flow execution is not active- See Also:
-
getFlashScope
MutableAttributeMap<Object> getFlashScope()Returns a mutable map for data held in "flash scope". Attributes in this map are cleared out on the next view rendering. Flash attributes survive flow execution refresh operations.- Returns:
- flash scope
-
getConversationScope
MutableAttributeMap<Object> getConversationScope()Returns a mutable map for data held in "conversation scope". Conversation scope is a data structure that exists for the life of this flow execution and is accessible to all flow sessions.- Returns:
- conversation scope
-
getAttributes
AttributeMap<Object> getAttributes()Returns runtime execution attributes that may influence the behavior of flow artifacts, such as states and actions.- Returns:
- execution attributes
-