AnsweredAssumed Answered

how to add a custom task listener through java code?

Question asked by goutham.pn@cafyne.com on Feb 8, 2017
Latest reply on Feb 8, 2017 by nikmenke

I'm building the usertask and servicetask dynamically

 

default UserTask createUserTask(String id, String name, String assignee) {
UserTask userTask = new UserTask();
userTask.setName(name);
userTask.setId(id);
userTask.setAssignee(assignee);
return userTask;
}

 

 

default ServiceTask createServiceTask(String id, String name, boolean asyn) {
ServiceTask serviceTask = new ServiceTask();
serviceTask.setName(name);
serviceTask.setId(id);
serviceTask.setAsynchronous(asyn);
ActivitiListener al = new ActivitiListener();

ExtensionAttribute ea = new ExtensionAttribute("activti", "abc");
// serviceTask.setExecutionListeners(executionListeners);
return serviceTask;
}

 

 

 

how to add 

 

<extensionElements>
<activiti:taskListener event="create" class="com.xy.z.TaskAssignmentHandler"></activiti:taskListener>
</extensionElements>

 

This dynamically using java code?

Outcomes