8 Replies Latest reply on Feb 17, 2006 12:11 PM by js8523

    Jpdl Pageflow begginning on @Create method

      Hi All

      I have a SFSB which has a create method which I have annotated as such:

      @Begin(join=true, pageflow="createReservation")
      @Create
      public String create() {
       log.info("create: Initlialised in Conversation Context");
      


      However if I use faces-config.xml to navigate to the page the padeflow does not start, but if I just type in the web address the pageflow starts. I know this because I have placed an action in the start of the pageflow which prints a debug statement out.

      Is this the desired behaviour and should I be doing something else, it just seems perculiar that it should work one way and not the other.

      Thanks for any help,

      James

      P.S the create method returns a non string, so the begin method should be working correctly, i just think there is a nuiance when the page is navigated to thorugh faces-config.xml navigation entry.

      The navigation entry looks like this.

      <navigation-case>
       <from-outcome>createReservation</from-outcome>
       <to-view-id>/reservation/reservationPlot.xhtml</to-view-id>
      </navigation-case>
      


        • 1. Re: Jpdl Pageflow begginning on @Create method
          gavin.king

          @Create methods are *only* called the first time a component is created. Probably the component already exists.

          • 2. Re: Jpdl Pageflow begginning on @Create method

            The create method is being called on both occasions, as the same print out is shown which ever way I navigate to the page. So the component is being created, but it is just not being promoted to a long running conversation, becuase I then type in the address of the page directly afterwards it runs the create method again, except this time it promotes the component to a long running conversation and starts the pageflow.

            Thanks,

            James

            • 3. Re: Jpdl Pageflow begginning on @Create method
              gavin.king

              Are you sure there is not already a long-running conversation in progress?

              • 4. Re: Jpdl Pageflow begginning on @Create method
                gavin.king

                (What happens if you remove join=true? My guess is: exception!)

                • 5. Re: Jpdl Pageflow begginning on @Create method

                  when debuggin it says that the longrunningconversation is true. So something must be triggering it?

                  But then why would it work just afterwards when I direct straight to the page using the page address?

                  I shall try the nested attribute, but I think your right it will throw an exception, i've just got to find out where the longrunningconversation is coming from?

                  James

                  • 6. Re: Jpdl Pageflow begginning on @Create method

                    Hi Gavin

                    Thanks for your help. I've now released that I had slightly the wrong impression of a conversation, I assumed each SFSB had it's own conversation context and you used join=true if you were restarting an old conversation.

                    Resulting from this I fixed the problem by ensuring all conversation contexts are shut down before I invoke the create/begin method for the reservationWizard.

                    But actually a conversation holds any beans marked as conversation scope that are invoked while the existing conversation is active (unless nested=true), therefore a bean starting within an existing conversation could not start a new pageflow (unless nested=true).

                    I apologise for the miscomprehension of the core principal.

                    Thanks,

                    James

                    • 7. Re: Jpdl Pageflow begginning on @Create method
                      gavin.king

                      np

                      • 8. Re: Jpdl Pageflow begginning on @Create method

                        Is there any way of making a @Begin call create a new conversation (when an existing long running conversation is alive). this would be useful, for fliting about over an application.

                        Any ideas (apart from passing conversationid=new as a request parameter.

                        Thanks,

                        James