1 2 Previous Next 18 Replies Latest reply on Jul 4, 2008 10:25 PM by nathandennis Go to original post
      • 15. Re: Ending a Conversation
        nathandennis

        but is seems to that function of the conversation manager does not advance the conversation until the second redirect after a conversation has been paged across more than one page. in this case.. (which is what is happening at least from observation) if the conversation is ended on a redirect, the address of the next page displayed will retain the previous cid. so if a conversation is begun on that page... the retired cid will be reclaimed in a long running conversation (just as you said before).


        am i the only developer trying to stack up multiple conversations this way? this seems like it should be a very common topic.

        • 16. Re: Ending a Conversation
          andygibson.contact.andygibson.net

          Hey Nathan,


          Yes, I think what you are describing is correct which is why I like to have strong conversation demarcation. I'm also wondering why it isn't that common a problem, but I think people are just building up huge conversations without realizing it, and then having other problems. 


          Cheers,


          Andy Gibson

          • 17. Re: Ending a Conversation
            nathandennis

            I would like to reopen this discussion if possible. not bases on the same code as above but the exact same problem.


            i through out a site i have been using ui:include for a common tool bar. i have a object that must be stateful for ajax and entity editing reasons. it is initialized using a page param and @Create on one of its methods.


            the tool bar contains s links such as


            <s:link view="/index.xhtml" target="_self" propagation="end" 
            



            from the objects page if one navigates away using the tool bar.. i can close the conversation using the propagation end, however, if the object is immediately reopened with a new page param, it initializes dirty. because this is a common tool bar, there is no way to call a close method on this object without having it incorrectly initialize on all other pages that use the tool bar.


            i really need another way of reseting the cid after passing seam the end that will allow me to immediately end that conversation without having to navigate two pages away before the correcting the page param. (besides a redirect because that takes too much time)


            is there some way i can force to increment the cid manually to a new valid cid while ending/killing the existing conversation IN THE SAME ACTION?





            • 18. Re: Ending a Conversation
              nathandennis

              well i answered my own question with some jimi rigging.... i offer this solution for all who follow.


              read the above post for the scenario.
              the stateful bean i was referring will be FooBean


              create a bean with event context


              @Name("fooBeanAction")
              @Synchronized
              @Scope(ScopeType.CONVERSATION)
              @Stateful
              public class FooBeanAction implements FooBeanLocal, Serializable {
                      /**
                       * do some stuff
                       */
              
              
                     @End(beforeRedirect=true)
                     public void end(){}
              
              



              to back the common tool bar use something like this


              @Stateful
              @Name("cidTermAction")
              @Scope(ScopeType.EVENT)
              public class CidTermAction implements CidTermLocal {
              
                      @In(required=false)
                      private FooBeanLocal fooBeanAction;
                      
                      public void cidTerm(){
                              
                              if(fooBeanAction != null){
                                      fooBeanAction.end();
                              }
                      
                      }
                      
              
              
                      @Destroy @Remove
                      public void destroy() {}
              }
              



              call this action from the common tool bar on and although no action was taken on FooBean to end that specific conversation,,, we captured it and ended without the hoopla of a redirect as describe in the above thread. i dont know why it took me this long to think of this.

              1 2 Previous Next