users@javaserverfaces-spec-public.java.net

[jsr344-experts mirror] Re: jsf2.2 feedback: give control back to calling flow

From: David Schneider <david.schneider_at_oracle.com>
Date: Wed, 02 Jan 2013 16:28:02 -0700

Hi Nicolas,

The called flow does not need to know what flow called it. Think of
each flow as a graph of nodes and the edges between the nodes are
defined by the navigation cases.

When a flow returns control to a calling flow it also returns an outcome
value. The navigation rules/cases in the calling flow are then
evaluated using the outcome and id of the flow-call node to determine
what comes next in the calling flow. You won't see what comes next in
the flow-call node, you'll need to look at the navigation cases since
they're what defines the edges in the navigation graph. This allows the
caller to navigate to any page or node following the return based on the
outcome value.

Does that make sense?

Dave

On 01/02/2013 11:33 AM, nromanetti_at_jaxio.com wrote:
> Hello,
>
> I am studying the latest JSF2.2 spec and the examples provided here:
> https://svn.java.net/svn/mojarra~svn/trunk/test/web-profile/flow/
>
> I could not find how a calling flow can take the control back once the
> called flow returns.
>
> I am used to Spring Web Flow... So I was expecting something like this.
>
> In "flow b" definition:
> ================
>
> <j:flow-return id="taskFlowReturn1">
> <outbound-parameter>
> <name>resultFromFlowB</name>
> <value>The returned Value</value>
> </outbound-parameter>
> </j:flow-return>
>
> <!-- note that I have not specified any navigation case as I want to
> go back to the calling flow (the current spec does not allow this)
> From flow B I should not know who called flow-b, I just want to
> give the control back... -->
>
>
> In "flow a" definition:
> ================
>
> <j:flow-call id="callB">
> <j:faces-flow-reference>
> <j:faces-flow-id>flow-b</j:faces-flow-id>
> </j:faces-flow-reference>
> <j:outbound-parameter>
> <j:name>param1</j:name>
> <j:value>param1Value</j:value>
> </j:outbound-parameter>
> <j:outbound-parameter>
> <j:name>param2</j:name>
> <j:value>param2Value</j:value>
> </j:outbound-parameter>
>
> <j:on-flow-return id="taskFlowReturn1">
> <!-- Here I would know that flow-b returned using
> the 'taskFlowReturn1' node. Knowning this I could
> decide what to do... for example call a
> method, select an appropriate node etc..
> -->
> </j:on-flow-return>
> </j:flow-call>
>
>
> I think it is an essential feature, the called flow should not have to
> know who called it. And the caller should know what was the exit node
> of the called flow.
>
> I was relying extensively on such feature when using Spring Web Flow +
> JSF.
>
> Am I missing something?
>
> Hope this helps.
>
> Nicolas
> --
> twitter: @nromanetti