12 Replies Latest reply on May 19, 2008 6:54 PM by janulrich79

    Problem with JPDL. Illegal navigation

    aluduena

      Hello,


      When navigating a link which is not in the pageflow, the framework returns an error: Illegal navigation.


      If a user performs a click on a link that is not within the pageflow, I want to end the conversation and after redirect to the page specified by the link.


      This is possible?


      Thanks,


      Ariel

        • 1. Re: Problem with JPDL. Illegal navigation
          barbacena

          I am waiting a answer for this as well.


          Nesting pageflow

          • 2. Re: Problem with JPDL. Illegal navigation
            blabno

            I guess that this is due to conversation propagation.


            I think you should not use s:link for your links, which by default propagates conversation. If you insist on using that tag, then pass propagation="none" attribute to it. That will not stop conversation, but get out of it's context. Maybe there is an option like propagation="end" but I haven't tried it yet.

            • 3. Re: Problem with JPDL. Illegal navigation
              sleroux

              Hi,


              The problem is that jPDL navigation is constrained (by contrast to JSF or Seam navigation which are free form).


              So, with jPDL, the path that your users can follow is represented by a finite graph, with well defined transitions from state to state (a state being either a page or decision).


              Each time the jPDL/jBPM engine detects that a user took a path that is not defined in the graph, it triggers an Illegal navigation Exception.


              If you provide some kind of escape door for your users (like a cancel button, or back to menu), you should end the pageflow when the user use it. The key point is to end the conversation : that will end the pageflow as well.


              According to the doc, this is done by using <end-conversation> (in your .jpdl.xml file) or by calling an @End method. AFAIK, you could use a s:link to do that. But propagation="none" will not suffice: the conversation will not be propagated thought the link, but will still be active.


              You need an s:link with propagation="end" (yes, it exists !)


              Hope this helps,

              Sylvain

              • 4. Re: Problem with JPDL. Illegal navigation
                aluduena

                Thanks guys... but this is not working well. If you use a s:link with

                propagation=end

                the conversation is ended but this still trigger the IllegalNavigation Exception..
                If you click for second time in the link then works fine..


                this is the correct behaviour?


                Ariel

                • 5. Re: Problem with JPDL. Illegal navigation
                  aluduena

                  Looking the PageFlow class, I realized that this is a pending task   (TODO). I think that in order to achieve the behaviour wanted, we   must to comment the lines 133 to 137 :)


                  Here is the part of the code that we must comment:


                           //now check that the restored view id matches what we expect
                           //from the pageflow node
                           //TODO: we need some way to disable this check, since users
                           //      might want some adhoc nav in and out of a pageflow?
                           String viewId = Pages.getViewId(facesContext);
                           if ( !viewId.equals( getPage().getViewId() ) )
                           {
                              illegalNavigationError();
                           }


                  • 6. Re: Problem with JPDL. Illegal navigation
                    barbacena

                    There should be a way to end the pageflow without ending the conversation.


                    They should be considered different features.

                    • 7. Re: Problem with JPDL. Illegal navigation
                      aluduena

                      Yes, that way exist..As Bernard or Sylvain said in the previous post you must write a s:link with

                      propagation=none




                      • 8. Re: Problem with JPDL. Illegal navigation
                        janulrich79

                        Hi.


                        propagation=end


                        doesn't work - the conversation is closed, but I have Illegal Navigation Error. Tested seam version: 2.1.0.A1.


                        Will it be fixed? When?


                        Thanks!


                        Jan

                        • 9. Re: Problem with JPDL. Illegal navigation
                          aluduena

                          I think this will be fixed in the next release.
                          Anyway, you can fix it following the post that I wrote above.


                          Ariel

                          • 10. Re: Problem with JPDL. Illegal navigation
                            marka4

                            Ariel Ludueña wrote on May 06, 2008 07:44 PM:


                            I think this will be fixed in the next release.
                            Anyway, you can fix it following the post that I wrote above.



                            Is there a JIRA issue opened for this fix?  I can't find one.  How about  a link or number?  If there's no JIRA issue, I don't think it's on the radar to be fixed.


                            And, I don't see an explanation of a fix above for the case where one DOES want to end the conversation with propagation=end.  Or, was the suggested fix for now to comment and recompile the code?


                            Thanks

                            • 11. Re: Problem with JPDL. Illegal navigation
                              aluduena

                              There is no JIRA issue for this bug.. I thought that there was..
                              Can you report this?


                              The suggested fix is recompile the code :)


                              Comment the line that throw the illegalNavigationError() in the PageFlow class and recompile the code..


                              This is the fastest solution that we have..


                              Ariel



                              • 12. Re: Problem with JPDL. Illegal navigation
                                janulrich79

                                Ariel Ludueña wrote on May 08, 2008 03:14 PM:


                                There is no JIRA issue for this bug.. I thought that there was..
                                Can you report this?



                                I am not able to sign up to Seam Jira. Would anybody report this bug...?
                                I've recompiled seam - it works now! Thanks!


                                Jan