I have extended ServletProcessApplication in Java class to listen to different events happening in Tasks. But I am not able to get when a user ‘claim’ a task.
Following is the way I am getting other events like start, end of a task.
could you post your implementation of the ServletProcessApplication?
Do you know the execution / task listener concept?
You can add a task listener to an user task. In this implementation, it is possible to react on different events.
Thank you for your reply. I have created a listener Java class as shown below. But it is not coming inside that when a claim task happens. My question is after having this Java class where to register this class, in which xml ? Should I have it configured somewhere in my bpmn flow xml ?
public class TaskCreateListener implements TaskListener {
Thank You very much. I will try with this. One more question though
If I have multiple user Tasks, this way I have to go to modeller and add the listener in all of the tasks. But If my implementation is generalised, can I use same listener for all the user tasks instead of configuring for each tasks in bpmn ?
you can use the reactor plugin. Just implement a global Listener like this:
@CamundaSelector(type = "userTask", event = TaskListener.EVENTNAME_ASSIGNMENT)
public class GlobalUserTaskAssignmentListener extends ReactorTaskListener {
public void notify(DelegateTask delegateTask) {
// ... do some generalised stuff
}
}