Good day.
I created a variable instance 'TaskAssignee' which will be utilize across task and flow. TaskAssignee will store the task assignee name and show it in the next user task (via form). I used the execution.setVariable inside the task listener but it didn't work. How am i able to do it?
Here's the code :
<process id="GetAssigneePerTask2" name="Get Assignee Per Task" isExecutable="true">
<documentation>undefined</documentation>
<extensionElements>
<activiti:executionListener event="start" expression="${execution.setVariable("TaskAssignee", "MyData"}"/>
<modeler:executionvariables xmlns:modeler="http://activiti.com/modeler" modeler:variableName="TaskAssignee" modeler:variableType="string"/>
</extensionElements>
<startEvent id="startEvent1"/>
<userTask id="sid-F533EC22-E107-49D2-ABDE-AE3BA402E8A4" name="Show Task User" activiti:assignee="$INITIATOR" activiti:formKey="2661">
<extensionElements>
<modeler:allow-send-email>true</modeler:allow-send-email>
<modeler:form-reference-id>2661</modeler:form-reference-id>
<modeler:form-reference-name>Show Data form</modeler:form-reference-name>
<modeler:initiator-can-complete>true</modeler:initiator-can-complete>
</extensionElements>
</userTask>
<sequenceFlow id="sid-F6A4A4AA-3075-4FA2-BE69-5109B340E3A8" sourceRef="sid-CB8D41DC-E2C6-4D60-A247-62630B0EF758" targetRef="sid-F533EC22-E107-49D2-ABDE-AE3BA402E8A4"/>
<endEvent id="sid-C23D6404-68B8-4C5C-8469-562C63E363AA"/>
<sequenceFlow id="sid-70DA56B6-5156-4CF1-8B36-DE0CB28096C5" sourceRef="sid-F533EC22-E107-49D2-ABDE-AE3BA402E8A4" targetRef="sid-C23D6404-68B8-4C5C-8469-562C63E363AA"/>
<userTask id="sid-CB8D41DC-E2C6-4D60-A247-62630B0EF758" name="Get User of this task" activiti:assignee="$INITIATOR">
<extensionElements>
<activiti:taskListener event="complete" class="org.activiti.engine.impl.bpmn.listener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[var dataValue = task.assignee;
execution.setVariable("TaskAssignee", dataValue);]]></activiti:string>
</activiti:field>
<activiti:field name="language">
<activiti:string><![CDATA[javascript]]></activiti:string>
</activiti:field>
</activiti:taskListener>
<modeler:allow-send-email>true</modeler:allow-send-email>
<modeler:initiator-can-complete>true</modeler:initiator-can-complete>
</extensionElements>
</userTask>
<sequenceFlow id="sid-9B8DB7EE-D9CD-4FA8-96C8-ED62ECED5404" sourceRef="startEvent1" targetRef="sid-CB8D41DC-E2C6-4D60-A247-62630B0EF758"/>
</process>
I'm using activiti 5.19
Thank you in advance for those who will respond.
Anyone to check on my question? Thank you
Oh...same problem......
My groovy script can not run execution script on activiti 5.22.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.