Search in sources :

Example 1 with CaseExecutionListenerInvocation

use of org.camunda.bpm.engine.impl.cmmn.delegate.CaseExecutionListenerInvocation in project camunda-bpm-platform by camunda.

the class DelegateExpressionCaseExecutionListener method notify.

public void notify(DelegateCaseExecution caseExecution) throws Exception {
    // Note: we can't cache the result of the expression, because the
    // caseExecution can change: eg. delegateExpression='${mySpringBeanFactory.randomSpringBean()}'
    Object delegate = expression.getValue(caseExecution);
    applyFieldDeclaration(fieldDeclarations, delegate);
    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);
    }
}
Also used : CaseExecutionListenerInvocation(org.camunda.bpm.engine.impl.cmmn.delegate.CaseExecutionListenerInvocation) CaseExecutionListener(org.camunda.bpm.engine.delegate.CaseExecutionListener) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Example 2 with CaseExecutionListenerInvocation

use of org.camunda.bpm.engine.impl.cmmn.delegate.CaseExecutionListenerInvocation in project camunda-bpm-platform by camunda.

the class ClassDelegateCaseExecutionListener method notify.

public void notify(DelegateCaseExecution caseExecution) throws Exception {
    CaseExecutionListener listenerInstance = getListenerInstance();
    Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new CaseExecutionListenerInvocation(listenerInstance, caseExecution));
}
Also used : CaseExecutionListenerInvocation(org.camunda.bpm.engine.impl.cmmn.delegate.CaseExecutionListenerInvocation) CaseExecutionListener(org.camunda.bpm.engine.delegate.CaseExecutionListener)

Aggregations

CaseExecutionListener (org.camunda.bpm.engine.delegate.CaseExecutionListener)2 CaseExecutionListenerInvocation (org.camunda.bpm.engine.impl.cmmn.delegate.CaseExecutionListenerInvocation)2 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1