0
votes

I'm working with JBPM 5.4, I want to make a code that will be executed every time a human task is initiated. I searched for it and I found that there is a class called task event listener

public interface TaskLifeCycleEventListener {

    //@TODO: add all the methods
    public void afterTaskActivatedEvent(Task ti);
    public void afterTaskClaimedEvent(Task ti);
    public void afterTaskSkippedEvent(Task ti);
    public void afterTaskStartedEvent(Task ti);
    public void afterTaskStoppedEvent(Task ti);
    public void afterTaskCompletedEvent(Task ti);
    public void afterTaskFailedEvent(Task ti);
    public void afterTaskAddedEvent(Task ti);
    public void afterTaskExitedEvent(Task ti);
}

That is the interface T could implement it but I don't know how to deploy it or register it. Can anyone help?

1

1 Answers

0
votes

You can register TaskEventListener with LocalTaskService, like as: LocalTaskService localTaskService = new LocalTaskService(taskService); taskService.addEventListener(new MyTaskEventListener(localTaskService, ksession));