2 Replies Latest reply on Feb 17, 2012 2:05 PM by numerico

    End conversation on navigation

    andrewwheeler

      I the good old seam 2 days you could end a conversation as part of a navigation rule:



                     <rule if-outcome="person.list">
                          <end-conversation before-redirect="true" />
                          <redirect view-id="/personList.xhtml" />
                     </rule>



      This was really handy because if a user was editing a form in a conversation and used the main menu to navigate to another page it would end the conversation rather than propagate.


      Using this paradigm I can implement the one-conversation-at-a-time model or prevent one conversation from propagating to another. In fact it is quite possible to navigate from one long running conversation to another without explicitly ending the previous conversation. You can easily end up with lots of disparate concerns in one conversation. This is what I call snowballing conversations.


      Now, to overcome this I could code every bean to end a conversation if it already exists and start one if it is conversation scoped, but this strikes me as a lot of hassle.


      Perhaps a better way of achieving this is to use page actions:


      <s:viewAction action="#{conversationManager.end}"/>



      The conversationManager (my bean, not seam provided) will end a conversation if it is not transient. Is there a more elegant solution? Could something be done in Seam Faces?


        • 1. Re: End conversation on navigation
          shane.bryzak

          I believe that Brian had planned to implement this as part of the ViewConfig features that he was working on.  Unfortunately I don't think that this got documented in time for the 3.0.0.Final release, however you can see it as a work in progress here.

          • 2. Re: End conversation on navigation
            numerico

            Hello,

            The link to github is broken...

            is it already included on the latest seam-faces releases?

            i've read the docs but there isn't no reference to this

            issue. i'm taking Andrew's work-around for now

            but it would be great to have a general solution.
            I think this must be quite a common use case.

             

            greetings