if (delegate instanceof CaseExecutionListener) {
CaseExecutionListener listenerInstance = (CaseExecutionListener) delegate;
Context
.getProcessEngineConfiguration()
.getDelegateInterceptor()
.handleInvocation(new CaseExecutionListenerInvocation(listenerInstance, caseExecution));
} else {
throw new ProcessEngineException("Delegate expression " + expression
+ " did not resolve to an implementation of " + CaseExecutionListener.class);
}
}