I decided to try and make my life a bit easier and add a @EventListener for every task, which is being executed during the flow. I found this topic - Global event listener on Process Engine Server - #4 by aravindhrs, and although it covers a good portion of the question, I realized that those listeners DO NOT capture script/service tasks.
So here’s my question of the day - is there a way to listen to all tasks, which are being executed. In particular, script tasks. The reason for this is that my bpmn model is a bit not on the small side, and contains sections with script tasks, following each other.
And every time when something goes wrong, COMPUTER says “There was an exception in a script”, which leaves me with the joyful opportunity to guess WHICH ONE made my day.
Task Event listeners allow to react to Task Events (Tasks are Created, Assigned, Completed). Execution Listeners allow to react to events fired as execution progresses through the diagram: Activities are Started, Ended and Transitions are being taken.
@hassang
Still can’t get a grip on how to get the scripts.
Going for
@EventListener
void print(Object obj)
got me close to solving this via HistoricActivityInstanceEventEntity, but I can’t get information about the script that is being executed (inline/resource). And I’m currently in a situation, where “something” is giving me (a headache) a NPE in console (Sorry Dave, but I can’t tell you which one), and the flow has several scripts as input params in a line.