As topic, what is the difference between class and delegate expression? Which is better to use?
Asked
Active
Viewed 2,278 times
1 Answers
3
The class attribute for the Service Task is the FQN of the class that implements JavaDelegate
. When this is used Flowable will instantiate the class.
A delegate expression is an expression that resolves a bean that implements JavaDelegate
. This means that you can define any bean of yours in there and you have control for its instantiation.
In my opinion it is better to use delegate expression. The reason is that with a delegate expression you can change the implementation between different versions and you won't need to change your BPMN Models.
More detailed explanation can be found in the Java Service Task section of the Flowable documentation.

Dark Star1
- 6,986
- 16
- 73
- 121

Filip
- 19,269
- 7
- 51
- 60