Is there any way to programmatically hook a CDI-enabled task listener to any task creation? I 've tried with AbstractBpmnParseListener but TaskDefinition.addTaskListener() requires me to instantiate the actual bean.
You can add a "DelegateExpressionTaskListener" instance instead of your CDI-bean instance. When this task-listener is called, the expression-manager will be used to fetch the BEAN instance from CDI.
You can pass in an Expression to the constructor of the DelegateExpressionTaskListener class, using expressionManager.createExpression("${cdiTaskListenerName}");