-
Bug
-
Resolution: Done
-
Major
-
jBPM 6.1.0.Beta4
-
None
I have created two custom producers, one for ProcessEventListener and the other for TaskLifeCycleEventListener. Also I am using InjectableRegisterableItemsFactory. jBPM calls the callback methods of the ProcessEventListener during various phases of the process lifecycle but the callback methods of TaskLifeCycleEventListener are not called during various phases of the task.
The reason being what I observed in InjectableRegisterableItemsFactory, the get getProcessEventListeners iterates over all the injected process event listener producers but getTaskListeners does not take into consideration of the injected taskListenerProducer hence the injected beans of task life cycle never make it to the defaultListeners list. Also the name of the method should be changed from getTaskListeners to getTaskEventListeners to be in sync with other getter methods for listeners.
I have attached my java files.
@Override
public List<ProcessEventListener> getProcessEventListeners(RuntimeEngine runtime) {
List<ProcessEventListener> defaultListeners = new ArrayList<ProcessEventListener>();
if(auditlogger != null)
else if (getAuditBuilder() != null) {
AbstractAuditLogger aLogger = getAuditLoggerInstance(runtime);
if (aLogger != null)
}
try {
for (EventListenerProducer<ProcessEventListener> producer : processListenerProducer)
} catch (Exception e) {
logger.warn("Exception while evaluating ProcessEventListener producers {}", e.getMessage());
}
// add listeners from descriptor
defaultListeners.addAll(getEventListenerFromDescriptor(runtime, ProcessEventListener.class));
return defaultListeners;
}
@Override
public List<TaskLifeCycleEventListener> getTaskListeners()