Hi, I’m attempting to setup an execution listener that will notify if a workflow is cancelled in the cockpit.
The setup is as follows:
- An embedded process engine in an api to which the workflow is deployed.
- An instance of the cockpit running with its own process engine pointing to the same database. However
<property name="jobExecutorActivate">false</property>
If defined a custom execution listener in the api:
package com.test
import org.camunda.bpm.engine.delegate.{DelegateExecution, ExecutionListener}
class WorkflowCancellationExecutionListener(slackNotifier: SlackNotifier) extends ExecutionListener {
override def notify(execution: DelegateExecution): Unit = {
if (execution.isCanceled) do something
}
}
This is linked to the workflow in the process level:
<bpmn:process id=“ExecutionListenerTest” name=“ExecutionListenerTest” isExecutable=“true”>
bpmn:extensionElements
<camunda:executionListener class=“com.allangray.workflow.core.workflow.WorkflowCancellationExecutionListener” event=“end” />
</bpmn:extensionElements>
Once an process instance is started and stopped at the message intermediate catch event, I attempt to cancel the workflow in the Cockpit and deselecting the Skip Custom Listeners
checkbox.
This exception is raised in the Cockpit process engine log:
at org.camunda.bpm.engine.rest.sub.runtime.impl.ProcessInstanceResourceImpl.deleteProcessInstance(ProcessInstanceResourceImpl.java:66)
... 55 more
Caused by: org.camunda.bpm.engine.ClassLoadingException: ENGINE-09017 Cannot load class ‘com.test.WorkflowCancellationExecutionListener’: com.test.WorkflowCancellationExecutionListener
at org.camunda.bpm.engine.impl.util.EngineUtilLogger.classLoadingException(EngineUtilLogger.java:135)
at org.camunda.bpm.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:107)
at org.camunda.bpm.engine.impl.util.ClassDelegateUtil.instantiateDelegate(ClassDelegateUtil.java:42)
Since the custom execution listener is not on the Cockpit instance this makes sense, but I don’t understand why the Cockpit’s engine is doing the execution.