public interface RequestControlContext extends RequestContext
This interface acts as a facade for core definition constructs such as the central Flow
and
State
classes, abstracting away details about the runtime execution machine.
Note this type is not the same as the FlowExecutionContext
. Objects of this type are request specific:
they provide a control interface for manipulating exactly one flow execution locally from exactly one request. A
FlowExecutionContext
provides information about a single flow execution (conversation), and it's scope
is not local to a specific request (or thread).
Flow
,
State
,
FlowExecution
,
FlowExecutionContext
Modifier and Type | Method and Description |
---|---|
FlowExecutionKey |
assignFlowExecutionKey()
Assign the ongoing flow execution its flow execution key.
|
void |
endActiveFlowSession(java.lang.String outcome,
MutableAttributeMap output)
End the active flow session of the current flow execution.
|
boolean |
execute(Transition transition)
Execute this transition out of the current source state.
|
boolean |
getEmbeddedMode()
Returns true if the flow current flow execution was launched in embedded page mode.
|
boolean |
getRedirectInSameState()
Returns the value of the 'redirect in same state' flow execution attribute if set or otherwise it falls back on
the value returned by
getRedirectOnPause() . |
boolean |
getRedirectOnPause()
Returns true if the 'redirect on pause' flow execution attribute is set to true, false otherwise.
|
boolean |
handleEvent(Event event)
Signals the occurrence of an event in the current state of this flow execution request context.
|
void |
removeAllFlowExecutionSnapshots()
Remove all flow execution snapshots associated with the ongoing conversation.
|
void |
removeCurrentFlowExecutionSnapshot()
Remove the current flow execution snapshot to invalidate the current state.
|
void |
setCurrentState(State state)
Record the current state that has entered in the executing flow.
|
void |
setCurrentTransition(Transition transition)
Record the transition executing in the flow.
|
void |
setCurrentView(View view)
Sets the current view.
|
void |
start(Flow flow,
MutableAttributeMap input)
Spawn a new flow session and activate it in the currently executing flow.
|
void |
updateCurrentFlowExecutionSnapshot()
Update the current flow execution snapshot to save the current state.
|
void |
viewRendered(View view)
Called when the current view has completed rendering in the current view state.
|
void |
viewRendering(View view)
Called when the current view is about to be rendered in the current view state.
|
getActiveFlow, getAttributes, getConversationScope, getCurrentEvent, getCurrentState, getCurrentTransition, getCurrentView, getExternalContext, getFlashScope, getFlowExecutionContext, getFlowExecutionUrl, getFlowScope, getMatchingTransition, getMessageContext, getRequestParameters, getRequestScope, getViewScope, inViewState
void setCurrentState(State state)
state
- the current stateState.enter(RequestControlContext)
FlowExecutionKey assignFlowExecutionKey()
void setCurrentView(View view)
view
- the current view, or null to mark the current view as null
void viewRendering(View view)
view
- the view to be renderedvoid viewRendered(View view)
view
- the view that renderedboolean handleEvent(Event event) throws FlowExecutionException
onEvent()
method of the flow involved in the flow execution will be called.event
- the event that occurredFlowExecutionException
- if an exception was thrown within a state of the flow during execution of this
signalEvent operationFlow.handleEvent(RequestControlContext)
boolean execute(Transition transition)
transition
- the transitionTransition.execute(State, RequestControlContext)
void setCurrentTransition(Transition transition)
transition
- the transition being executedTransition.execute(State, RequestControlContext)
void updateCurrentFlowExecutionSnapshot()
void removeCurrentFlowExecutionSnapshot()
void removeAllFlowExecutionSnapshots()
void start(Flow flow, MutableAttributeMap input) throws FlowExecutionException
This will start a new flow session in the current flow execution, which is already active.
flow
- the flow to start, its start()
method will be calledinput
- initial contents of the newly created flow session (may be null
, e.g. empty)FlowExecutionException
- if an exception was thrown within a state of the flow during execution of this
start operationFlow.start(RequestControlContext, MutableAttributeMap)
void endActiveFlowSession(java.lang.String outcome, MutableAttributeMap output) throws java.lang.IllegalStateException
end()
method of the flow involved in the flow execution will be
called.outcome
- the logical outcome the ending session should returnoutput
- output the ending session should returnjava.lang.IllegalStateException
- when the flow execution is not activeFlow.end(RequestControlContext, String, MutableAttributeMap)
boolean getRedirectOnPause()
boolean getRedirectInSameState()
getRedirectOnPause()
.boolean getEmbeddedMode()