2 Replies Latest reply on Apr 20, 2007 6:19 AM by avbentem

    Can I tell which event invoked my action?

      Is there any way to tell which event has triggered my action?

      Like when using:

      <task name="survey" swimlane="client">
       <event type="task-create">
       <action name="taskCreate" expression="#{swimlaneAssigner.setSwimlane}" />
       </event>
      </task>

      ...then I'd like to know that task-create made my swimlaneAssigner.setSwimlane fire.

      Thanks,
      Arjan.


        • 1. Re: Can I tell which event invoked my action?
          koen.aers

          Arjan,

          You can do this by querying the event from the ExecutionContext.

          Regards,
          Koen

          • 2. Re: Can I tell which event invoked my action?

             

            "koen.aers@jboss.com" wrote:
            You can do this by querying the event from the ExecutionContext.

            I took me some time trying to retrieve the jBPM execution context from within a Seam application (which can inject things like JbpmContext, ProcessInstance and TaskInstance, in which I could not easily find a reference to the ExecutionContext), but it's really easy when forgetting about Seam's injection for a second:
            ExecutionContext jbpmExecutionContext =
             ExecutionContext.currentExecutionContext();
            log.debug("Event: #0", jbpmExecutionContext.getEvent());

            Thanks,
            Arjan.