Issue Details (XML | Word | Printable)

Key: GLASSFISH-19942
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Ed Burns
Reporter: Sreekanth
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

fails to match the navigation case when a method-call node is called from a view node and method-call node directs to flow-return node

Created: 19/Mar/13 05:43 PM   Updated: 20/Mar/13 05:21 PM   Resolved: 20/Mar/13 02:33 PM
Component/s: jsf
Affects Version/s: 4.0_b80_EE7MS6
Fix Version/s: 4.0_b82_EE7MS7

Time Tracking:
Not Specified

Environment:

Glassfish 4.0 b80,Mojarra 2.2.0-m11


Tags:
Participants: Ed Burns and Sreekanth


 Description  « Hide

Hi,

Here is my flow definition xml file from a flow .

<faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="
        http://xmlns.jcp.org/xml/ns/javaee
        http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">

    <flow-definition id="registration">
        <start-node>registration</start-node>
        <view id="registration">
            <vdl-document>/registration/registration.xhtml</vdl-document>
        </view>
        
        <flow-return id="Create">
            <from-outcome>#{registrationFlowBean.returnValue}</from-outcome>
        </flow-return>
            
        <method-call id="saveUserData">
            <method>#{usersController.create}</method>                     
            <default-outcome>switch</default-outcome>            
        </method-call>
        
         <switch id="switch">
          <case>
              <if>#{usersController.create} eq "Create1"}</if>
              <from-outcome>/index.xhtml</from-outcome>
          </case>
          <default-outcome>/registration</default-outcome>
        </switch>
            
    </flow-definition>

</faces-config>

This is my face flow directory.

registration/
|-- confirm.xhtml
|-- proceed.xhtml
|-- registration-flow.xml
`-- registration.xhtml

In this app, when the user clicks on a button in confirm.xhtml file, the flow will navigate to method-call node as declared in the above xml file and at the end of the process it should return to index.xhtml page at the root of the web application.

It returns to the index.xhtml file as expected but the navigation cases are not matched, when returned back from flow.



Ed Burns added a comment - 20/Mar/13 02:33 PM

M jsf-ri/src/main/java/com/sun/faces/application/ApplicationAssociate.java

  • Instead of considering XML as the only means for determining the
    existence of flows in an app, use XML or the builder API.

M jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java

  • Handle the case of flow popping when a another node calls a
    <flow-return>.

M jsf-ri/src/main/java/com/sun/faces/flow/FlowImpl.java

  • Facilitate the above mentioned change in NavigationHandler by
    providing a constant that can be checked to accurately trap the case.
    Sending jsf-ri/src/main/java/com/sun/faces/application/ApplicationAssociate.java
    Sending jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java
    Sending jsf-ri/src/main/java/com/sun/faces/flow/FlowImpl.java
    Transmitting file data ...
    Committed revision 11774.

Ed Burns added a comment - 20/Mar/13 05:21 PM

Committed to MOJARRA_2_0_0_GLASSFISH_4_0 branch.

merge from trunk

SECTION: Modified Files
----------------------------
M jsf-ri/src/main/java/com/sun/faces/application/ApplicationAssociate.java

  • Instead of considering XML as the only means for determining the
    existence of flows in an app, use XML or the builder API.

M jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java

  • Handle the case of flow popping when a another node calls a
    <flow-return>.

M jsf-ri/src/main/java/com/sun/faces/flow/FlowImpl.java

  • Facilitate the above mentioned change in NavigationHandler by
    providing a constant that can be checked to accurately trap the case.
    Sending jsf-ri/src/main/java/com/sun/faces/application/ApplicationAssociate.java
    Sending jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java
    Sending jsf-ri/src/main/java/com/sun/faces/flow/FlowImpl.java
    Transmitting file data ...
    Committed revision 11775.