AnsweredAssumed Answered

User Task Enhancment to invoke custom code on task creation

Question asked by manchandap on Oct 9, 2015
Latest reply on Oct 12, 2015 by martin.grofcik
Respected Activiti Experts,

I have a requirement where in I want to execute a custom piece of code when a User Task is created. This custom code will make a call back to the mother application from where the workflow was initiated.

Looking at the user guide I found that Task Listeners (http://www.activiti.org/userguide/#taskListeners) can be used to enhance the User Code.

However, these task listeners need to specified as part of the template definition:

<b>
<userTask id="myTask" name="My Task" >
  <extensionElements>
    <activiti:taskListener event="create" class="org.activiti.MyTaskCreateListener" />
  </extensionElements>
</userTask>
</b>

In my case, I need this custom code to be executed for all the User tasks and don't want to rely on the inclusion of task listeners in the template definition.

So, I am looking for:

# Is there a way to enhance/customize the engine side Task or task service to achieve the same effect OR
# Is it possible to invoke the task listener for all user task without relying on the template definition

Thanks and Regards
P Manchanda

Outcomes