4 Replies Latest reply on Sep 14, 2006 3:19 PM by asachde

    Accessing <variable> in ActionHandlers the SEAM Way

      What is the SEAM way of accessing variables created in the start tasks? Currently I am doing the following:

      CustomerBean cust = (CustomerBean) arg0.getContextInstance().getVariable("cust");


      Is that right? If I use @In annotation the variable is always null. Please advise.

        • 1. Re: Accessing <variable> in ActionHandlers the SEAM Way

          Are you sure you have associated a task with the conversation?

          • 2. Re: Accessing <variable> in ActionHandlers the SEAM Way

            The process is a long running one and cant be in the conversation scope.

            • 3. Re: Accessing <variable> in ActionHandlers the SEAM Way
              andygrav

              I am just starting with seam but as I understood you can inject something from a business scope into a conversation scope.

              From the docs:
              @BeginTask(taskIdParameter="taskId")

              Resumes work on an incomplete jBPM task. Specifies that a long-running conversation begins when this method returns a non-null outcome without exception. This conversation is associated with the jBPM task specified in the named request parameter. Within the context of this conversation, a business process context is also defined, for the business process instance of the task instance.

              The jBPM TaskInstance will be available in a request context variable named taskInstance. The jPBM ProcessInstance will be available in a request context variable named processInstance
              taskIdParameter ? the name of a request parameter which holds the id of the task. Default to "taskId", which is also the default used by the Seam taskList JSF component.

              After doing the above
              I would have thought that
              @In
              CustomerBean cust;
              would do exactly the same as the code you have?

              Is that not the case?

              I would be interested to know how you get on.

              Andy Bailey
              www.hazlorealidad.com

              • 4. Re: Accessing <variable> in ActionHandlers the SEAM Way

                Seems like you have to use jbpm (original post) calls in the action handlers as the seam interceptors do not fire and hence cant us @In in the ActionHandler