TaskDefinition taskDefinition = getTaskDefinition();
if (taskDefinition != null) {
List<TaskListener> taskEventListeners = getTaskDefinition().getTaskListener(taskEventName);
if (taskEventListeners != null) {
for (TaskListener taskListener : taskEventListeners) {
CoreExecution execution = getExecution();
if (execution == null) {
execution = getCaseExecution();
}
if (execution != null) {