AnsweredAssumed Answered

What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?

Question asked by viorelhojda on Jan 18, 2017
Latest reply on Jan 19, 2017 by viorelhojda

I'm trying to use a simple ServiceTask with a delegateExpression (a Spring bean) and to inject simple Expressions using activiti fields, I'm following the tutorial from official page : Activiti User Guide  .

The Spring bean is correctly initialized by Spring and I have other beans and services correctly configured. The problem is that I can't inject any Expressions, they are all NULL when executing the Service Task. I'm using Activiti 5.9, so I just just the expressions as private members in my bean class.

I want to mention that it works when using a Java class (activiti:class), it doens't work with delegate expression(activiti:delegateExpression). I need the second approach because I need the Spring context available, I don't know how to get it and if it's possible to obtain it in the simple POJO Class using the first approach.

The code is the one from the User Guide, so I don't think I should post it, but I can if needed.

 

So, what can be the reasons why these Expressions are not injected ? Am I missing something when configuring the Spring context? Also I couldn't find delegateExpressionFieldInjectionMode  setting, I've looked in the Activiti code from different versions and from 2.23 I think it was removed, but the default one should not be DISABLED.

 

Thank you in advance, I really don't know what I've done wrong, it really should work, I've found multiple examples over the net and it's pretty straightforward.

 

Thanks in advance for help!

Outcomes