Hi,
I have created a process which has one service task and one user task in same order.
A user task is configured with 2 task listeners via delegateExpression on create and complete events. The create task listener updates various variables such as assignee , task name etc. The create task listener also updates the task definition key as shown below.
taskEntity.setTaskDefinitionKey(“somekey”);
The issue I am having is that: when the task is marked complete via the rest api then the complete task listener is not firing.
I have discovered that when I remove the code that updates the task definition key, the complete task listener is invoked as expected. I see no errors and execution if flawless. It is important for me to invoke complete task listener since it produces an event which are consumed by downstream business processes.
I can not omit the code which updates the taskDefinitionKey since this key is utilized by other applications.
I am curious why when I update a taskDefinitionKey in create listener then why task completed listener is not being invoked? Is it by design ? or is this a defect?