cancel
Showing results for 
Search instead for 
Did you mean: 

expression to pass activiti variable to spring method

billbert
Champ in-the-making
Champ in-the-making
I am trying to pass the processInstanceId and TaskDefinitionKey to a spring Bean using expression. 

If I call ${springBean.sendMessage("Hello World")} it works great!

When I call ${springBean.sendMessage(" ${task.getTaskDefinitionKey()} ")} my message is
" ${task.getTaskDefinitionKey() " instead of "createOrder"

Listed below is my actual user task.

I'm probably doing something not exactly right.   Any help would be greatly appreciated.  Really enjoy working with the product.


    <userTask id="createOrder" name="Create Order" activiti:assignee="automation">
      <documentation>"Create Order"</documentation>
      <extensionElements>
        <activiti:formProperty id="orderNumber" name="Order Number" type="string" required="true" readable="true" writable="true"></activiti:formProperty>
        <activiti:taskListener event="create" expression="${springBean.sendMessage(&quot;{ \&quot;processinstanceid\&quot;:\&quot;${task.getProcessInstanceId()}\&quot;, \&quot;taskdefinitionkey\&quot;:\&quot;${task.getTaskDefinitionKey()}\&quot; } &quot;)}"></activiti:taskListener>
      </extensionElements>
    </userTask>
4 REPLIES 4

roig
Champ in-the-making
Champ in-the-making
try ${springBean.sendMessage(#{task.getTaskDefinitionKey()})}

sherlockq
Champ in-the-making
Champ in-the-making
Or is

${springBean.sendMessage(task.taskDefinitionKey)}
possible?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
The latter should be the correct one afaik

billbert
Champ in-the-making
Champ in-the-making
${springBean.sendMessage(task.taskDefinitionKey)}

Worked out great!  Thanks for the help.