Is there a way can subscribe the changes of sepcified activities?

Hi folks.
I want to subscribe the “Changes” of specified activities
What “Changes” means ? That means activity instance created or activity instance complete.

I know there is a way to do this job by add listener to bpmn file.
But in my case which activity should add listener is uncertain that means i need a way to add the listeners to specified activities at runtime.

Is there such way exists ? Thanks.

Hi @himly,

during the listener execution you have access to all process variables.

You can use them to control if the logic should be executed or not.

Hope this helps, Ingo