AnsweredAssumed Answered

Dynamic injcection of values does not work in Spring context

Question asked by pposch on Jun 21, 2011
Latest reply on Jun 24, 2011 by frederikheremans1
Hi,
we are setting up an application using Activiti and Spring. We have problems in injecting dynamic variables at runtime. The variant:

<serviceTask id="javaService"
             name="My Java Service Task"
             activiti:class="xxx.MyTask" >
            <extensionElements>
                       <activiti:field name="user">
                            <activiti:expression>${method.foo()}</activiti:expression>
                       </activiti:field>
           </extensionElements>
</serviceTask>

works fine but the execute method in "xxx.MyTask" is executed outside our Spring context. That means that Spring injections do not work.
In the variant:

<serviceTask id="javaService"
             name="My Java Service Task"
             activiti:delegateExpression="${mybean}">
            <extensionElements>
                       <activiti:field name="user">
                            <activiti:expression>${method.foo()}</activiti:expression>
                       </activiti:field>
           </extensionElements>
</serviceTask>

the task "${mybean}" is executed in our Spring context, but the injection of the variable "user" does not work. Is there any possibility (existing or planned) to have dynamic variable injection and the Spring context at the same time?

Outcomes