In our project - we are going to use our own logic and configuration to decide on the assignee or candidates for all UserTasks.
I wrote a Bean that can be used to return the list of users for a given task based on the taskDefId + a few additional parameters we set on the context and have in our configuration.
So far i have used it by setting the assignee/candidate on each UserTask as an expression that calls that method - and it works fine.
But in order to avoid the need to set it on each task - i wanted to add a task listener on all UserTasks - that will run on task create - and will call that logic and assign the values. This will save use setting the method on each task - give use flexibility (and avoid mistakes).
So i created my EngineConfigurationConfigurer - and in it i used setCustomDefaultBpmnParseHandlers
to set my UserTaskBpmnParseHandler which extends UserTaskParseHandler.
But inside my handler - i could not manage to add a new execution listener. I tried using different examples - but still could not make it work ( i do arrive inside the handler - just no listener added).
UserTask as a method of getTaskListener - but it returns a list of FlowableListener (and not TaskListener) - and did not know how to use it to add my listener.
Am i using a correct approach for this task - or is there a better way to achieve that ?
Is there any example i could use as reference on how to do that ?