4 Replies Latest reply on Jun 8, 2007 3:24 PM by Gavin King

    Question about explicit conversation id

    Bradley Smith Master

      I have the following SeamTest (FacesRequest) method:

       @Override
       protected void invokeApplication() throws Exception {
      
       AccessRequestManager2 arm2 = (AccessRequestManager2) getInstance("accessRequestManager2");
       assert arm2 != null;
       arm2.startRequest();
       log.info("conversationId = "+getConversationId());
      
       }
      
      


      and AccessRequestManager2.startRequest() looks like this:

       @Begin(id="#{draftAccessRequestMaster.id}",join=true)
       public void startRequest() {
       log.info("draftAccessRequestMaster.id = "+draftAccessRequestMaster.getId());
       }
      


      Furthermore, I use the @Factory pattern to create a persistent instance of draftAccessRequestMaster which is @In(jected) to AccessRequestManager2. When I run the test, I get the following in the log output:

      10:36:40,265 INFO com.evergreen.accesscontrol.AccessRequestManager2Test.(info:94) - updateModelValues()
      10:36:40,812 INFO com.evergreen.accesscontrol.impl.AccessRequestManager2Bean.(startRequest:54) - draftAccessRequestMaster.id = 5
      10:36:40,875 INFO com.evergreen.accesscontrol.AccessRequestManager2Test.(info:94) - conversationId = 1
      


      My question here is ....

      Why isn't the conversationId equal to the explicit id that I created in the @Begin(...) annotation?

      Thanks,
      Brad Smith

        • 1. Re: Question about explicit conversation id
          Bradley Smith Master

          I @In(jected) the conversation component into my bean and then added some code to dump the conversation id in the method invokation. It looks like that's working correctly, it's the SeamTest.FacesRequest that appears to be losing track of the conversation id.

          New AccessRequestManager2.startRequest() Code:

           @Begin(id="DraftAccessRequestID:#{draftAccessRequestMaster.id}",join=true)
           public void startRequest() {
           log.info("draftAccessRequestMaster.id = "+draftAccessRequestMaster.getId());
           log.info(conversation);
           log.info("conversation.id = "+conversation.getId());
           log.info("conversation.parentId = "+conversation.getParentId());
           }
          


          with the following output during execution:

          14:12:28,093 INFO com.evergreen.accesscontrol.impl.AccessRequestManager2Bean.(startRequest:59) - draftAccessRequestMaster.id = 6
          14:12:28,093 INFO com.evergreen.accesscontrol.impl.AccessRequestManager2Bean.(startRequest:60) - org.jboss.seam.core.Conversation@1fcb845
          14:12:28,093 INFO com.evergreen.accesscontrol.impl.AccessRequestManager2Bean.(startRequest:61) - conversation.id = DraftAccessRequestID:6
          14:12:28,093 INFO com.evergreen.accesscontrol.impl.AccessRequestManager2Bean.(startRequest:62) - conversation.parentId = null
          14:12:28,124 INFO com.evergreen.accesscontrol.AccessRequestManager2Test.(info:94) - conversationId = 1
          


          So I see that the desired conversation id, DraftAccessRequestID:6, is being created the way I would like, however, the SeamTest.FacesRequest is not reflecting this.



          • 2. Re: Question about explicit conversation id
            Gavin King Master

            Are you using nested conversations?

            • 3. Re: Question about explicit conversation id
              Bradley Smith Master

              nested conversations? no - I wasn't planning on it in this use case. The main thing here is that I was trying to test from SeamTest.FacesRequest that the explicit (custom-generated) conversation id is the conversation id. It looks like the expression for my explicit id is being evaluated the way I want, I was (am) confused as to why the test case doesn't reflect that when I call getConversationId() after invoking the business method.

              Thanks

              • 4. Re: Question about explicit conversation id
                Gavin King Master

                I'm not sure. How about submitting a simple, runnable version of your test to JIRA