2 Replies Latest reply on Mar 26, 2007 12:57 PM by javajoe220

    proper use of asynchronous

    javajoe220

      Hello,

      We have a fairly large app that behaves as follows:

      *A user begins by doing a search
      *A list of results are returned and the user selects one
      *Once a result is selected several other areas are initialized via the Event/Observer pattern
      *The user can now navigate to many other areas with all the necessary initializing having already occurred with either the data available already or the ability to get the data already established

      Question:
      I would really like to alter this initialization phase to use the Event.raiseAsynchronousEvent functionality. If I do this with no changes to the system but using "raiseAsynchronousEvent" rather than just "raiseEvent" the code works how ever the initialzed SSB are not in the conversation context. I read that the asynchronous functionality does not have access to the conversational context so I understand why that does not work, so what would be the best way to go about this? Should the init code place the initialzied objects in the application context then when the conversationally scoped SSB need them pull them out? Is there a better or recommend way?

      Thank you!

        • 1. Re: proper use of asynchronous
          gavin.king

          raiseEvent methods all take varargs arguments, so you can pass whatever state you need as an "event object", which gets mapped to parameters of the listener method.

          • 2. Re: proper use of asynchronous
            javajoe220

            Thank you for your quick response.

            I have been able to get the proper state to the event observer. It is the results I am having issues with.

            I have attempted to pass in the conversation Context object to the event and put the results directly into it but that does not appear to have worked (should it?)

            What do you suggest for storing the results so the conversation context can access it?

            Thanks!