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

    End conversation on navigation

    Andrew Wheeler Newbie

      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" />

      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?