public class FlowHandlerImpl
extends jakarta.faces.flow.FlowHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
ABANDONED_FLOW |
static String |
FLOW_RETURN_DEPTH_PARAM_NAME |
| Constructor and Description |
|---|
FlowHandlerImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFlow(jakarta.faces.context.FacesContext context,
jakarta.faces.flow.Flow toAdd)
Add the argument |
void |
clientWindowTransition(jakarta.faces.context.FacesContext context)
Allow for flow transitions in the case of components rendered by the renderers from component-family
|
int |
getAndClearReturnModeDepth(jakarta.faces.context.FacesContext context) |
jakarta.faces.flow.Flow |
getCurrentFlow(jakarta.faces.context.FacesContext context)
Return the currently active |
Map<Object,Object> |
getCurrentFlowScope()
Return the |
jakarta.faces.flow.Flow |
getFlow(jakarta.faces.context.FacesContext context,
String definingDocumentId,
String id)
Return the |
String |
getLastDisplayedViewId(jakarta.faces.context.FacesContext context)
Return the last displayed viewId for the current flow, as returned by
|
boolean |
isActive(jakarta.faces.context.FacesContext context,
String definingDocumentId,
String id)
Return |
void |
popReturnMode(jakarta.faces.context.FacesContext context)
Enable the correct handling of navigation when processing a return node. |
void |
pushReturnMode(jakarta.faces.context.FacesContext context)
Enable the correct handling of navigation when processing a return node. |
void |
transition(jakarta.faces.context.FacesContext context,
jakarta.faces.flow.Flow sourceFlow,
jakarta.faces.flow.Flow targetFlow,
jakarta.faces.flow.FlowCallNode outboundCallNode,
String toViewId)
Perform a transition in the flow graph for the current user's |
public static final String ABANDONED_FLOW
public static final String FLOW_RETURN_DEPTH_PARAM_NAME
public Map<Object,Object> getCurrentFlowScope()
jakarta.faces.flow.FlowHandler
Return the Map that backs the #{flowScope} Jakarta Expression Language implicit object or
null if no flow is currently active.
getCurrentFlowScope in class jakarta.faces.flow.FlowHandlerMap for this flow scope.public jakarta.faces.flow.Flow getFlow(jakarta.faces.context.FacesContext context,
String definingDocumentId,
String id)
jakarta.faces.flow.FlowHandler
Return the Flow whose id is equivalent to the argument id, within the scope of the argument definingDocument.
getFlow in class jakarta.faces.flow.FlowHandlercontext - the FacesContext for the current request.definingDocumentId - An application unique identifier for the document in which the returned flow is defined.id - the id of a Flow, unique within the scope of the definingDocument.Flow for the argument identifiers.public void addFlow(jakarta.faces.context.FacesContext context,
jakarta.faces.flow.Flow toAdd)
jakarta.faces.flow.FlowHandler
Add the argument Flow to the collection of Flows known to the current application. The implementation
must be thread safe.
addFlow in class jakarta.faces.flow.FlowHandlercontext - the FacesContext for the current request.toAdd - the Flow to add.public boolean isActive(jakarta.faces.context.FacesContext context,
String definingDocumentId,
String id)
jakarta.faces.flow.FlowHandler
Return true if and only if the flow referenced by the argument definingDocument and id is
currently active.
isActive in class jakarta.faces.flow.FlowHandlercontext - the FacesContext for the current request.definingDocumentId - An application unique identifier for the document in which the returned flow is defined.id - the id of a Flow, unique within the scope of the definingDocument.public jakarta.faces.flow.Flow getCurrentFlow(jakarta.faces.context.FacesContext context)
jakarta.faces.flow.FlowHandler
Return the currently active Flow for the argument FacesContext, or null if no flow is active.
A Flow must always be associated with exactly one ClientWindow, but a
ClientWindow may have multiple Flows.
If FlowHandler.pushReturnMode(jakarta.faces.context.FacesContext) had been called with true as the argument before invoking this method, return the
preceding flow on the stack instead of the actual current flow, or null if there is no preceding flow.
Otherwise, return the current flow.
getCurrentFlow in class jakarta.faces.flow.FlowHandlercontext - the FacesContext for the current request.Flow or null if no flow is activepublic String getLastDisplayedViewId(jakarta.faces.context.FacesContext context)
jakarta.faces.flow.FlowHandler
Return the last displayed viewId for the current flow, as returned by
FlowHandler.getCurrentFlow(jakarta.faces.context.FacesContext), or null if there is no current flow.
getLastDisplayedViewId in class jakarta.faces.flow.FlowHandlercontext - the FacesContext for the current request.public int getAndClearReturnModeDepth(jakarta.faces.context.FacesContext context)
public void pushReturnMode(jakarta.faces.context.FacesContext context)
jakarta.faces.flow.FlowHandler
Enable the correct handling of navigation when processing a return node. The default
NavigationHandler specification requires calling this method before processing the
navigation rules for the flow return, and calling FlowHandler.popReturnMode(jakarta.faces.context.FacesContext), from a finally block, immediately
afterward.
pushReturnMode in class jakarta.faces.flow.FlowHandlercontext - the FacesContext for the current request.public void popReturnMode(jakarta.faces.context.FacesContext context)
jakarta.faces.flow.FlowHandler
Enable the correct handling of navigation when processing a return node. The default
NavigationHandler specification requires calling this method from a finally
block, immediately attempting to process the navigation rules in the context of a flow return.
popReturnMode in class jakarta.faces.flow.FlowHandlercontext - the FacesContext for the current request.public void transition(jakarta.faces.context.FacesContext context,
jakarta.faces.flow.Flow sourceFlow,
jakarta.faces.flow.Flow targetFlow,
jakarta.faces.flow.FlowCallNode outboundCallNode,
String toViewId)
jakarta.faces.flow.FlowHandler
Perform a transition in the flow graph for the current user's ClientWindow. Obtain
references to the Flow instances corresponding to the origin and destination arguments. If
the origin Flow is equal to the destination Flow, take no action and return null. Otherwise,
if the outboundCallNode argument is non-null save aside the outbound parameters. For discussion
evaluatedParams is a data structure that stores the evaluated values of any outbound parameters. It
is necessary to evaluate these values before popping any flow scopes because the values may refer to scoped instances
that need to be passed to the target flow, but will not be available once the new scope is activated. Save aside the
outbound parameters using the following algorithm.
If the
outboundParametersproperty ofoutboundCallNodeis non-nulland not empty, and theinboundParametersproperty of the target flow is non-nulland not empty, for each entry in the outbound parameters whose name matches an entry in the inbound parameters, evaluate the value of the parameter, and put the evaluated value into evaluatedParams under the corresponding name. Otherwise, consider evaluatedParams to be empty.
If the destination Flow is a sub-flow of the origin Flow push the destination Flow onto the flow data structure and return the destination Flow.
Otherwise, pop the current Flow from the flow data structure. If the destination Flow is
non-null, make the destination Flow the current flow, pushing it onto the data structure. If evaluatedParams is not
empty, for each entry, find the corresponding parameter in the target flow's inbound parameters and call its
setValue method, passing the value from evaluatedParams.
transition in class jakarta.faces.flow.FlowHandlercontext - the FacesContext for the current request.sourceFlow - the current Flow, or null if there is no source flow.targetFlow - the destination Flow, or null if there is no destination flow.outboundCallNode - the flow call node causing this transition, or null if this transition is not caused
by a flow call.toViewId - the viewId of the view being displayed as a result of this transition. This parameter makes it
possible to implement FlowHandler.getLastDisplayedViewId(jakarta.faces.context.FacesContext).public void clientWindowTransition(jakarta.faces.context.FacesContext context)
jakarta.faces.flow.FlowHandler
Allow for flow transitions in the case of components rendered by the renderers from component-family
jakarta.faces.OutcomeTarget. These transitions must happen at the front of the request processing
lifecycle due to the HTTP GET based nature of such components. Therefore, this method is called from the restore view
phase of the lifecycle.
Let flowId be the value in the request parameter map for the parameter whose name is given by the value of
FlowHandler.FLOW_ID_REQUEST_PARAM_NAME. Let toFlowDocumentId be the value in the request parameter map for the
paramater whose name is given by the value of FlowHandler.TO_FLOW_DOCUMENT_ID_REQUEST_PARAM_NAME. If
toFlowDocumentId is null, take no action and return. Otherwise, let sourceFlow be the
return from FlowHandler.getCurrentFlow(jakarta.faces.context.FacesContext). A null value indicates there is
no current flow, which will be the case if this navigation is trying to enter a flow. If flowId is not
null and toFlowDocumentId is not equal to the value of FlowHandler.NULL_FLOW, let
targetFlow be the result of calling
FlowHandler.getFlow(jakarta.faces.context.FacesContext, java.lang.String, java.lang.String), passing
toFlowDocumentId and flowId as the last two arguments, respectively. If the result is
non-null, let flowCallNode be the return from calling Flow.getFlowCall(jakarta.faces.flow.Flow) on the
sourceFlow, passing targetFlow as the argument. Otherwise, targetFlow and
flowCallNode must remain null, indicating that this is a flow return. Call
FacesContext.getViewRoot() and let toViewId be the the return from calling
UIViewRoot.getViewId() on it.
Call, FlowHandler.transition(jakarta.faces.context.FacesContext, jakarta.faces.flow.Flow, jakarta.faces.flow.Flow, jakarta.faces.flow.FlowCallNode, java.lang.String), passing the arguments gathered in the preceding algorithm.
clientWindowTransition in class jakarta.faces.flow.FlowHandlercontext - the FacesContext for the current request.Copyright © 2010–2022 JBoss by Red Hat. All rights reserved.