我正在使用JBPM 5.4,我想创建一个代码,每次启动人工任务时都会执行。我搜索了它,发现有一个叫做任务事件监听器的类
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);
}
这是接口T可以实现它但我不知道如何部署或注册它。有人可以帮忙吗?
答案 0 :(得分:0)
您可以使用LocalTaskService注册TaskEventListener,如:
LocalTaskService localTaskService = new LocalTaskService(taskService);
taskService.addEventListener(new MyTaskEventListener(localTaskService, ksession));