Search in sources :

Example 1 with ExecutionListenerInvocation

use of org.camunda.bpm.engine.impl.bpmn.delegate.ExecutionListenerInvocation in project camunda-bpm-platform by camunda.

the class ClassDelegateExecutionListener method notify.

// Execution listener
public void notify(DelegateExecution execution) throws Exception {
    ExecutionListener executionListenerInstance = getExecutionListenerInstance();
    Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new ExecutionListenerInvocation(executionListenerInstance, execution));
}
Also used : ExecutionListenerInvocation(org.camunda.bpm.engine.impl.bpmn.delegate.ExecutionListenerInvocation) ExecutionListener(org.camunda.bpm.engine.delegate.ExecutionListener)

Example 2 with ExecutionListenerInvocation

use of org.camunda.bpm.engine.impl.bpmn.delegate.ExecutionListenerInvocation in project camunda-bpm-platform by camunda.

the class DelegateExpressionExecutionListener method notify.

public void notify(DelegateExecution execution) throws Exception {
    // Note: we can't cache the result of the expression, because the
    // execution can change: eg. delegateExpression='${mySpringBeanFactory.randomSpringBean()}'
    Object delegate = expression.getValue(execution);
    applyFieldDeclaration(fieldDeclarations, delegate);
    if (delegate instanceof ExecutionListener) {
        Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new ExecutionListenerInvocation((ExecutionListener) delegate, execution));
    } else if (delegate instanceof JavaDelegate) {
        Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new JavaDelegateInvocation((JavaDelegate) delegate, execution));
    } else {
        throw LOG.resolveDelegateExpressionException(expression, ExecutionListener.class, JavaDelegate.class);
    }
}
Also used : JavaDelegateInvocation(org.camunda.bpm.engine.impl.bpmn.delegate.JavaDelegateInvocation) ExecutionListenerInvocation(org.camunda.bpm.engine.impl.bpmn.delegate.ExecutionListenerInvocation) JavaDelegate(org.camunda.bpm.engine.delegate.JavaDelegate) ExecutionListener(org.camunda.bpm.engine.delegate.ExecutionListener)

Aggregations

ExecutionListener (org.camunda.bpm.engine.delegate.ExecutionListener)2 ExecutionListenerInvocation (org.camunda.bpm.engine.impl.bpmn.delegate.ExecutionListenerInvocation)2 JavaDelegate (org.camunda.bpm.engine.delegate.JavaDelegate)1 JavaDelegateInvocation (org.camunda.bpm.engine.impl.bpmn.delegate.JavaDelegateInvocation)1