Custom Activity Behavior


#1

In Activiti it was possible (at least in version 5.14) to define custom behavior for a specific node. This was done by extending the org.activiti.engine.impl.bpmn.parser.factory.DefaultActivityBehaviorFactory where I could redefine whatever I wanted and then by overriding org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl#getDefaultDeployers
I was able to set that custom factory in the org.activiti.engine.impl.bpmn.parser.BpmnParser

For Camunda I can’t find an easy way of doing the same thing.
My goal is to extend the org.camunda.bpm.engine.impl.bpmn.behavior.UserTaskActivityBehavior class and by doing this I want to be able to set candidates or to set assignee at runtime globally for the process engine.

Is there a way to do this in Camunda?


#2

Hi @sfolter,

You could use a task listener on the CREATE event. You can programmatically add the listener to all user tasks via a parse listener.

Cheers,
Thorben


#3

Thank you, that’s exactly what I want! And I did not mention but we’ll be integrating Camunda with CDI, so after a little bit of digging, I’ve found that those events are piped as CDI events so I guess I can just observe for BusinessProcessEvent and check if it’s a task creation event.

Have a nice day!