Global Listener for End of All Processes Without Requiring Code in Process

Does anyone know of a way to fire a custom class at the end (normal termination, cancellation, etc.) of a process in a manner that would not require the process developer to do anything?

What I want is something at the “engine level” that would always fire when a process ends (however that may be). Sort of a universal listener that wasn’t dependent upon a inclusion of delegate code in the process itself.

In simple terms, I want this to happen whenever a process ends no matter what process it is.

Thanks.

Hi Michael,

You can use a BPMN parse listener to programmatically register an execution listener for every parsed process. See https://github.com/camunda/camunda-bpm-examples/tree/master/process-engine-plugin/bpmn-parse-listener for an example. Note that you can register a listener in BpmnParseListener#parseProcess via ProcessDefinitionEntity#addListener that will be invoked whenever the process ends.

Cheers,
Thorben