3 Replies Latest reply on Oct 24, 2007 3:30 PM by pmuir

    Nested Conversations (tricky interceptor)

    denis-karpov

      From the first look my question seems to be trivial, but it is not.

      How to return some information form the nested conversation to the parent conversation?
      In docs there is line:

      A nested conversation has its own conversation context, and also has read-only access to the context of the outer conversation. (It can read the outer conversation's context variables, but not write to them.)

      I always thought this as that I can't change the Map of the parent context variables, but I can change the state of any object in parent conversation context. And everything works as expected till Seam 2.x.

      After Seam2 there was strange behavior all around in my application. Some fields of some objects unexpectedly becomes nulls or old values. After examining this situation I have found this interceptor ManagedEntityIdentityInterceptor. With this interceptor I have problems with changing state of objects in the parent conversation context.
      Is it intended behavior or a bug?
      If it is intended then how to transmit parameters to the parent conversation in Seam 2.x?


        • 1. Re: Nested Conversations (tricky interceptor)

          Entities references in conversational components are moved from the object to the conversation at the end of a request and are repopulated in the object at the beginning of the next request. I'm looking at the issue now, and I believe there is a bug.

          • 2. Re: Nested Conversations (tricky interceptor)
            denis-karpov

             

            Entities references in conversational components are moved from the object to the conversation at the end of a request and are repopulated in the object at the beginning of the next request.

            As I understand not a request, but method invocation.

            I can tell you where is the problem.
            Suppose that we have component AA in parent conversation with a field reference bb to an another component Q. At some point this reference is moved to conversation context with the name "AA.bb".
            Then we start nested conversation. We can still access field bb in the nested conversation, because in the time of invocation it gets reference from the parent conversation and put it inside the component.
            Then we change the reference of the field. And at the end of an invocation seam moves the reference to the conversation context (nested)
            Then we end the nested conversation. And try to access field bb in the parent conversation. Seam restores a reference from context (parent). And we get the old value.



            • 3. Re: Nested Conversations (tricky interceptor)
              pmuir

              Denis, if you can provide a testcase to show this, please email it to Norman. Thanks!