Generic TaskListener to use with definitions outside the WAR

I’ve managed to create a TaskListener which will work with process definitions defined with the same Maven project and deployed via a WAR file.

I’d like to be able to use that TaskListener with process definitions created separately and not deployed via the same WAR file.

When I create a definition within Modeler and reference my Java class I see the following

Cannot instantiate process definition Process_1xu8hvt:1:dc522249-f9ad-11ea-9b3b-0242ac110002: ENGINE-03051 There was an exception while invoking the TaskListener. Message: 'ENGINE-09008 Exception while instantiating class 'xxx.TestListener.TestTaskListener': ENGINE-09017 Cannot load class 'xxx.TestListener.TestTaskListener': xxx.TestListener.TestTaskListener from [Module "deployment.camunda-webapp-jboss-7.13.0.war" from Service Module Loader]'```

Hi @SimonHickling,

you can register your TaskListener in a process engine plugin: https://docs.camunda.org/manual/7.13/user-guide/process-engine/process-engine-plugins/

Have a look at this example: https://github.com/camunda/camunda-bpm-examples/tree/master/process-engine-plugin/bpmn-parse-listener-on-user-task

Hope this helps, Ingo

Thanks Ingo, I’ve got it all working now using a parser to add the listeners. I’d looked at the docs (a lot) but missed the registration of the plugin.