cancel
Showing results for 
Search instead for 
Did you mean: 

Delegate expression and fields

wslade
Champ in-the-making
Champ in-the-making
After several weeks of using activiti I continually get frustrated that a delegate expression cant have fields.
Being able to define a spring bean namee as the expression and then wire the bean is one of the most useful features of the this tool.
However when defining an activity you almost always need to passin a value specific to that activity instance.

Is there a reason why it is not supported or just on the todo list. If the later I would almost pay money to have it implemented.
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
The issue with the delegateExpression is that it MAY resolve to another bean every single time it's called, so field-injection can't be done just once, as it is with the normal JavaDelegates. However, you get the execution passed in, you can extract all variables you want but I understand the fact that you code the expressions, rather than define them in
your process file.

AFAIK, nothing is planned for this. As I see delegateExpressions, is to have the resolving the of the javaDelegate fully controlled in the developer's hands. Having field-injection on that as well is a valid use case, although not crucial.

You could always suggest a solution based on the current functionality or propose a patch, we're happy to accept contributions in this area.