1 Reply Latest reply on Apr 22, 2006 1:53 PM by koen.aers

    Listening for task creation from ANY process

    joelkoz

      I have a need to centralize the event handling of task creation events. Basically, I've got some code that needs to be notified if ANY process creates ANY tasks for ANY user.

      If I understand the way jBPM works, I can create a process definition like this:

      <process-definition name="processA">
       <event type="task-assign">
       <action class="com.example.GlobalAssignmentListener">
       </event>
      </process-definition>
      


      and "GlobalAssignmentListener" will be called any time "processA" assigns a task to some user (or user group). First, is this assumption correct?

      Second, is there any way to "register" GlobalAssignmentListener to be notified of assignment events on ANY process? Or, does the above boilerplate code need to be placed in every single process definition before it is deployed?


        • 1. Re: Listening for task creation from ANY process
          koen.aers

          First assumption is correct.
          As for your second question, I would say that the above boilerplate code indeed needs to be placed in every processdefinition. If you don't want to do this, I think you could do something with runtime actions. Create a custom deployer that does not merely deploys the processdefinitions, but also creates a runtime action and associates this action with the task-assign event on the deployed process...
          Let us know if this works.

          Regards,
          Koen