4 Replies Latest reply on Jun 8, 2007 3:15 AM by neilac333

    Interrupting a Conversation to Start Another


      I am writing an application where a user might be in the midst of a conversation and then may need to stop that one and jump to another page to initiate a new one. Upon completing that new conversation, the user could then go to a list of unfinished conversations and complete them.

      As a contrived example, say I start to order a pizza for myself which consists of figuring toppings, choosing sides if any, and payment. Then I get a request from my boss that we need pizza for a company gathering later today. So I somehow save my current order (explicitly or implicitly) and then go back to the original pizza order page to order for the company. Somehow then I can retrieve my original order and complete it.

      My question is simply if Seam makes such a thing even possible. Can I save the original order? If so, must I do so explicitly? How many conversations can I interrupt (i.e. in the above example, can I interrupt the order for my company to initiate a third order?)? When I am ready, can I produce a list of unfinished conversations for me to click on so I can complete them?


        • 1. Re: Interrupting a Conversation to Start Another
          Gavin King Master

          Yes it is totally possible.

          "jump to new": propagation="none"
          "list of unfinished": conversationList

          There is plenty of info about these features in the documentation.

          • 2. Re: Interrupting a Conversation to Start Another

            Reading Chapter 6 of the documentation now. Thanks, Gavin.

            How could I access the conversationList object in code? This would be useful for me so that if the user logs off, then I could persist the data related to the conversations and then retrieve later at next logon so the user could see what needs his attention. Of course, in that case I am not sure how to put these items in conversation scope again. Hmm.

            Is there a better approach to this scenario then the one I just suggested?

            • 3. Re: Interrupting a Conversation to Start Another
              Andy Gibson Novice

              Personally, I would consider this a data issue, not so much a framework issue.

              Just put a "completed" field in your Order entity that is only set when the order is completed.

              Then you can call "select * from orders o where completed = null" or whatever to see the incompleted orders.

              • 4. Re: Interrupting a Conversation to Start Another

                Your approach is certainly viable and pretty simple, and it has occurred to me as a possible solution. Of course, I would argue a lot of the solutions provided by Seam could be accomplished through clever persistence mechanisms as well.

                My question therefore was meant to address the possibility that Seam had something to address this requirement "out-of-the-box" so that I didn't have to. After all, from what I have read, the business process context manages the state of a business process across roles and logins, and something similar could be in play for the scenario I described.

                If that isn't the case, then the solution you suggested is probably where I would go. However, I would still need to know how to access and manipulate the conversationList in code.