3 Replies Latest reply on Jun 19, 2009 3:51 AM by kapitanpetko

    non-deterministic use case and conversation management

    gonorrhea

      I have a use case (page flow) in which there is no guaranted order of pages like there is in the seam booking example app.


      My approach in terms of conversation management was to use @Begin(join=true) but no @End.


      I need to promote the temp conversations to LRC so I can use SMPC and Hibernate manual flush with atomic conversations.


      Has anybody else run into use cases like this one (where you don't know exactly what order of actions the user may execute after the LRC begins and there is no end as such)?  How did you approach the solution in terms of conversation mgmt?  thx.

        • 1. Re: non-deterministic use case and conversation management
          kapitanpetko

          I've found out that using pages.xml for cases like this makes your life a lot easier. @Begin and @End are overrated anyways.
          So I have no @End's, and starting a different use case destroys the current conversation. That is done in pages.xml like this:
          before-redirect clears all 'leftovers' from your previous usecase, so you can both start with a clean state and free up some
          memory.


          <rule if-outcome="usecase1">
            <end-conversation before-redirect="true" />
            <redirect view-id="/usecase1.xhtml" />
          </rule>
          
          <rule if-outcome="usecase2">
            <end-conversation before-redirect="true" />
            <redirect view-id="/usecase2.xhtml" />
          </rule>
          



          HTH

          • 2. Re: non-deterministic use case and conversation management
            gonorrhea

            how do you start (promote) the temp conversation to LRC?


            and does if-outcome value correspond to a returned String from a business method??

            • 3. Re: non-deterministic use case and conversation management
              kapitanpetko

              Arbi Sookazian wrote on Jun 18, 2009 06:11:


              how do you start (promote) the temp conversation to LRC?


              I use @Begin (usually) with a page action for this.
              Here loadStuff is annotated with @Begin:


              <page view-id="/usecase2.xhtml">
                  <action on-postback="false" execute="#{manager.loadStuff}" />
              




              and does if-outcome value correspond to a returned String from a business method??


              Yes. Although sometimes just a link is enough:


              <s:link action="usecase2" value="UseCase2" />