I have created a process that has multiple service tasks in a sequence. When I start the process, first and 2nd tasks are executed however, the rest of them are not executed. I thought this is a simple flow but couldn't figure out what is blocking some of the tasks. Here is my process. Anything wrong in the process definition?
Figured out the issue. There is no problem with Process Definition. My Implementation classes were implementing the ActivityBehavior interface instead of JavaDelegate interface. Only the first task is implementing the JavaDelegate.
Whichever has implementation for JavaDelegate interface, ran successfully and which has ActivityBehavior implementation did not run.
After changing everything to JavaDelegate implementation, everything is working fine.
What is the difference between them and can't we use interchangeably?
This is from the user guide, sounds like they are quite different.
[INTERNAL: non-public implementation classes]It is also possible to provide a class that implements theorg.activiti.engine.impl.pvm.delegate.ActivityBehaviorinterface. Implementations have then access to the more powerfulActivityExecutionthat for example also allows to influence the control flow of the process. Note however that this is not a very good practice, and should be avoided as much as possible. So, it is advised to use theActivityBehaviorinterface only for advanced use cases and if you know exactly what you’re doing.