2 Replies Latest reply on Dec 20, 2007 9:28 AM by henrik lindberg

    how to send events between natural conversations

    henrik lindberg Apprentice

      If I have understood things correctly, it is only possible to send events from a conversation / scope to the hierarchy of conversations that led to the conversation that sends an event. (Is this correct?)

      In my case I want to send an event from a conversation with a natural conversation id - (a conversation identified by a particular object), and I want to send the event so another natural conversation can pick this up with an @Observer (preferably).

      Since the two conversations are neither nested or joined - I wonder if I can do this.

      When I try, nothing happens, the @observer is never called.

      Is it possible to find a conversation (since I know the conversation id) and find a particular bean (by its name) and call a method on that bean?

      Any other ideas on how to get this done? (Or have I misunderstood how it is supposed to work?)

      - henrik

        • 1. Re: how to send events between natural conversations
          Pete Muir Master

          If I understand you correctly, you have conversation A and conversation B. In conversation A you have some Seam component foo, and in conversation B you have some instantiated some component bar.

          bar has an observer method that listens for fooEvent. You call a method on foo, which raises fooEvent. The observer method on bar will be called, but it won't be *the same instance* of bar that you have conversation B, but rather a new instance.

          You can't observe an event raised in one conversation in another. If the observer was in the session scope or application scope this would work.

          • 2. Re: how to send events between natural conversations
            henrik lindberg Apprentice

            ok, so, how can I achieve some sort of "global event". Basically, I just need the bean in the "other conversation" to update from the DB so it can present fresh information if the user returns to this conversation.