How to create & deploy Custom ExecutionListener


#1

Hi,
I am trying to create a custom ExecutionListener which will be invoked inside a start event. I have done the following steps but getting exception to instantiate the custom class (ENGINE-09017 Cannot load class…) . Please suggest.

  1. created a java class -

package com.test.customlistener;
import org.camunda.bpm.engine.delegate.BaseDelegateExecution;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.ExecutionListener;

public class ExampleExecutionListenerOne implements ExecutionListener {

public void notify(DelegateExecution execution) throws Exception {
 System.out.println("ExampleExecutionListenerOne called.");         
}

public void notify(BaseDelegateExecution arg0) throws Exception {
	// TODO Auto-generated method stub		
}

}

exported as jar and put that in /lib. Restart the server.

  1. Add the following lines in a workflow and deployed in camunda.
    <bpmn:startEvent id=“StartEvent_1”>
    bpmn:extensionElements
    <camunda:executionListener class=“com.test.customlistener.ExampleExecutionListenerOne” event=“start” />
    </bpmn:extensionElements>
    </bpmn:startEvent>

#2

It is solved. I put the jar in wrong path.