Wiring up global listeners and boundary events

Hi, I have the following use case. We have a number of process definitions through which we create a number of human tasks. We need to implement some logic around task lifecycle state such as create / complete and delete. We have implemented the listeners and are wiring up the listeners to the task individually. Is there an easy way to assign listeners to all tasks?

Also, for deleting a task, we are using conditional boundary event which is again attached to a specific task. How can we globally wire up the conditional boundary event to all tasks in our processes?

Thanks

Hi @maheshsubramanian,

you can add your listener implementation in a process engine plugin: camunda-bpm-examples/process-engine-plugin/bpmn-parse-listener-on-user-task at master · camunda/camunda-bpm-examples · GitHub.

Hope this helps, Ingo

Thanks for this. We were able to get it working following the above example. However, this requires a module to be installed with listener artefacts and wildfly (our container) configuration updated to use the plugin to weave in the listeners on process definition deployment. Is there another approach available where by we can effect the change without having to make changes to the container? All within application artefact (war file containing the processes)?

Hi @maheshsubramanian,

up to now I only have used the way you described. And wildfly is the most complicated infrastruture to enable process engine plugins with their module structure.

Just a rough idea: Perhaps you could use the deployment method to add the logic of your listener: The Process Application class | docs.camunda.org

Disclaimer: I havn’t tried this by myself, it is just a rough idea.

Hope this helps, Ingo