Search code examples
jsfjakarta-eejsf-2glassfishfaces-flow

JSF FlowFaces Unable to find matching navigation case from view ID 'CURRENT_PAGE' for outcome '<FLOW_NAME>'


I have created a JSF Flow. My definition is as follows:

<flow-definition id="registration">
    <initializer>#{registrationBean.initializeFlow}</initializer>

    <start-node>personalDetails</start-node>

    <view id="personalDetails">
        <vdl-document>/registration/personal-details.xhtml</vdl-document>
    </view>

    <navigation-rule>
        <from-view-id>*</from-view-id>
        <navigation-case>
            <from-outcome>registration</from-outcome>
            <to-view-id>/registration/personal-details.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/registration/personal-details.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>next</from-outcome>
            <to-view-id>/registration/cultural-details.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/registration/cultural-details.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>previous</from-outcome>
            <to-view-id>/registration/personal-details.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>next</from-outcome>
            <to-view-id>/registration/profile-details.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/registration/profile-details.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>previous</from-outcome>
            <to-view-id>/registration/cultural-details.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>next</from-outcome>
            <to-view-id>/registration/preview.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/registration/preview.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>previous</from-outcome>
            <to-view-id>/registration/profile-details.xhtml</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/registration-complete.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

    <flow-return id="cancel">
        <from-outcome>cancel</from-outcome>
    </flow-return>

    <finalizer>#{registrationBean.finalizeFlow}</finalizer>
</flow-definition>

When I move through the Faces Flow, there are no problems in the actual flow pages, but the template is outputting a strange error:

Unable to find matching navigation case from view ID '/registration/personal-details.xhtml' for outcome 'registration' 

Where /registration/personal-details.xhtml is the current file name and registration is the name of the current Flow Scope.

The rendered link I have in my menu is also rendered as:

Sign Up

Outside the flow, or:

Sign Up: This link is disabled because a navigation case could not be matched.

Inside the flow.

At the same time, the Glassfish log is giving me this:

Warning:   JSF1064: Unable to find or serve resource, /registration/registration.xhtml.

This registration.xhtml doesn't exist, but I thought I could override the default file name by changing the <start-node> in the config.

Is there a way I can keep my file structure with the non-default value and get this working? What exactly is the problem?


Solution

  • It seems that the first view must be registration.xhtml (or <FLOW_NAME>.xhtml in general), so I can get rid of the error message, and technically this "answers" my question, but I would prefer to be able to name my views as I see fit, and not have to default if possible, so I'll hold out for a while on selecting an answer in case anybody has any better input on this matter.