3 Replies Latest reply on Jul 27, 2008 7:14 PM by Pete Muir

    Conversation Wrangling

    Matt Davis Newbie
      Ok... is there ever a good time to not use join=true or nested=true?

      I have a page with a
      <begin-conversation pageflow="orgCreateFlow" join="true"/>
      On load.

      If I go to that page, then back out of it, I have a conversation going. Every other conversation I have will cause a crash... unless it joins, or nests.  Is there a way to end that other conversation when a new one starts?

      I'm kinda OCD about this stuff... and dangling conversations being joined and nested in each other with no discernible way to be sure that they're ending kinda makes me twitch.

        • 1. Re: Conversation Wrangling
          Pete Muir Master

          Read about not propagating the conversation.

          • 2. Re: Conversation Wrangling
            Matt Davis Newbie

            I've read about how to stop a conversation when the user follows my links... but what if they hit the backbutton?  I've got a page that starts a conversation when you enter it... using the


            <begin-conversation join="true">
            



            tag.


            I can go to this page, click back, go to it again, click back, and watch the conversations add to the list on debug.seam


            1 I thought join=true would make these merge? Does it do something special for the same conversation entry point being hit multiple times?


            2: Any other conversation entry should cause a crash, unless I make it join or nest.



            Here's the code... I can click the link to this page, and click back, over and over and start as many conversations as I want, despite join=true (which I hadn't even noticed before).


            Then I can click somewhere else that starts a conversation, and watch it crash, unless I have join=true or nested=true on that conversation.


            orgEdit.page.xml:


            <?xml version="1.0" encoding="UTF-8"?>
            <page xmlns="http://jboss.com/products/seam/pages"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd" 
                  view-id="/orgEdit.xhtml"
                  login-required="true">
            
               <begin-conversation pageflow="orgCreateFlow" join="true"/>
            </page>
            



            debug.seam:


            10      3:51:46 PM -3:51:46 PM            /orgEdit.xhtml Select conversation context
            5      3:51:34 PM -3:51:34 PM           /orgEdit.xhtml      Select conversation context
            7      3:51:38 PM -3:51:38 PM           /orgEdit.xhtml      Select conversation context
            9      3:51:44 PM -3:51:44 PM           /orgEdit.xhtml      Select conversation context
            6      3:51:37 PM -3:51:37 PM           /orgEdit.xhtml      Select conversation context
            
            


            • 3. Re: Conversation Wrangling
              Pete Muir Master

              Matt Davis wrote on Jul 27, 2008 17:56:


              1 I thought join=true would make these merge? Does it do something special for the same conversation entry point being hit multiple times?



              No, if you have a foreground long running conversation, having join=true will cause that foreground conversation to be joined (rather than an exception be thrown).



              2: Any other conversation entry should cause a crash, unless I make it join or nest.

              Yes, assuming you have an foreground LRC. However if you click back to page in which you have no foreground LRC and then hit a plain begin, you won't get an exception



              Here's the code... I can click the link to this page, and click back, over and over and start as many conversations as I want, despite join=true (which I hadn't even noticed before).

              Yes. That's because you left the conversation as I described. You can rejoin an explicit conversation if you want.


              Anyway, get a good book on Seam.