5 Replies Latest reply on Aug 26, 2009 9:40 PM by Shervin Asgari

    How to end conversation scope?

    Rizwan Mohammad Newbie
      Hi,
      I need some help in ending conversation scope using pages.xml descriptor.
      My requirement is: I will start conversation-scope in page1 and then goto page2. If move out of page 1 or page 2 then I need to end my conversation scope.
      How do we achieve this functionality using pages.xml?
      Thanks & Regards,
      Rizwan.
        • 1. Re: How to end conversation scope?
          Arbi Sookazian Master

          <begin-conversation/> and <end-conversation/>


          e.g.:


          <page view-id="/coursewizard/*">
             <navigation>
                <rule if-outcome="cancel">
                   <end-conversation/>
                   <redirect view-id="/FacilityList.xhtml"/>
                </rule>
              </navigation>
          </page>



          there is also <navigation from-action> embedded inside <page> tag.


          e.g.


          <page view-id="/RecoveredEquipmentManagement.xhtml">     
                  <begin-conversation join="true" flush-mode="manual"/>
                  <navigation from-action="#{recoveredEquipmentManagement.search}">
                          <end-conversation/>
                          <redirect view-id="/RecoveredEquipmentManagement.xhtml"/>
                  </navigation>
              </page>

          • 2. Re: How to end conversation scope?
            Rizwan Mohammad Newbie

            Thanks Arbi. I want to specify redirect-view-id as any page. can I use wild card characters to specify. If so, can you specify me what is the exact syntax.
            Thanks for your help.

            • 3. Re: How to end conversation scope?
              Arbi Sookazian Master

              AFAIK, you must specify exactly one xhtml page as the view-id.  You're telling Seam/JSF which page to redirect to, it must be a page for obvious reasons.


              In terms of a page flow, it is usually pre-defined (like in a shopping cart wizard) what the order of page navigation will be.

              • 4. Re: How to end conversation scope?
                Tim Evers Master

                Disclaimer: I havn't tried this :P


                But couldn't you do something like:


                <redirect view-id="#{MyNavigationController.pageToRedirectTo}"/>
                



                Now you can just have a Session scoped bean that will return the appropriate view ID for you. (Now how you know what view it should be is your problem though :P)

                • 5. Re: How to end conversation scope?
                  Shervin Asgari Master

                  Arbi, I am not sure if this is exactly what he is requesting, other than manually adding every page with an <end-conversation>, then I am not sure how this can be done.


                  I would like the same thing in our project. We have an admin that can start a long running conversation, without a clear end point, and in any moment, the admin can push the admin menu button again, thus creating new long running conversations without ending the previous one. I would like to know how I can either do a does a long-running conversation of this component already exist, then give that to the user, but I am not sure how I can do this since my link has a propagation="begin".