4 Replies Latest reply on Jan 3, 2006 9:36 AM by gavin.king

    Joined Conversations

    drapierwim

      I don't understand the joined conversation not well in the booking example.

      I see in the HotelSearchingAction a method with @Begin(join=true) this starts a conversation to be joinend with the HotelBookingAction that also starts a conversation, this conversation is terminated with when calling the confirm method. But I don't see when the HotelSearchingAction @End(clear method) is called. Is this done by Seam when the hotelBookingAction @End(confirm) is called?


      So for now I have this in my head...

      @Begin(join=true) start a conversation that can be used in other conversations, if this conversation is not ended a new one can not be started without getting an exception, right?

      @Begin(nested=true) starts a conversation but needs another conversation that already must have started, right?

      @End ends a conversation like usual, but are joinend conversations also ended?

        • 1. Re: Joined Conversations
          gavin.king

          @Begin(join=true) is a no-op if a conversation already exists.

          @Begin(join=false) throws an exception is a conversation already exists.

          @Begin(nested=true) is way, way, way more subtle and complex. It essentially gives you a stack of continuable states at a particular point of execution, and a tree of continable states globally. Let me write that one up properly, it will take me some time. It is very powerful, but probably only for usage by geniuses.

          • 2. Re: Joined Conversations
            gavin.king

            In the booking example, the reason to have @Begin(join=true) is simply that I can press the search button multiple times. The conversation starts the *first* time i press it, and we stay in the same conversation no matter how many times we press.

            • 3. Re: Joined Conversations
              drapierwim

              So if I'm correct...

              @Begin(join=true) uses the same conversation if one available, if not it creates one

              @Begin(join=false) throws an exception if already started

              as for the @Begin(nested=true) I can't wait to read about it...

              Thanks

              • 4. Re: Joined Conversations
                gavin.king

                Right.


                There is an example app using nested conversations that I just checked into CVS. It is in examples/issues. This is still a bit of a work in progress, but it demonstrates the ideas, I suppose.