I’m trying to understand if there is a way to subscribe for notifications about user tasks (create, assign, complete, delete, etc.). If I understand correctly - I can create a TaskListener to listen for those events, but I will need to define/attach this listener to each individual task I’m interested in (within the BPMN definition). I would prefer to not modify the BPMN at all (as I don’t have full control over the definitions), but instead subscribe to all user tasks - is that possible?
This is indeed possible in a few different ways.
If you don’t want to have you models affected, you can build an engine plugin for the history event stream. This is can listen for specific events across the whole engine and then do whatever action it is you’d like to happen.
Another way would be to write a plugin that configures a BpmnParseListener for the engine, which is invoked when parsing any model. That can then be used to add the listeners you mention to each and every task, in the appropriate lifecycle phases.
This option is more of an annotation of the existing model at runtime which prevents you from having to do it manually to the models before deployment; @Niall 's suggestion opts to react to the events as they occur in the history stream, without having to do anything with the model at all.