I am trying to execute code via a spring EventListener on a process end event using the the following:
@EventListener(condition = "#execution.eventName.equals('end')")
public void onEnd(DelegateExecution execution)
{
String procInstId = execution.getProcessInstanceId();
// do stuff based on processInstanceId of just finished process
}
It seems to execute after every Activity, thus I am probably listening to the wrong event, one that fires at the end of every activity.
Is there a way to listen explicitly to process end events?
Unfortunately that option is not particularly desirable, as we have a multitude of processes and every process should perform the same actions on the EndEvent. So it would be quite bothersome and error prone to manually add the Listener to each an every EndEvent, particularly for future processes.