.getDelegateInterceptor()
.handleInvocation(new ExecutionListenerInvocation((ExecutionListener) delegate, execution));
} else if (delegate instanceof JavaDelegate) {
Context.getProcessEngineConfiguration()
.getDelegateInterceptor()
.handleInvocation(new JavaDelegateInvocation((JavaDelegate) delegate, execution));
} else {
throw new ProcessEngineException("Delegate expression " + expression
+ " did not resolve to an implementation of " + ExecutionListener.class
+ " nor " + JavaDelegate.class);
}