cancel
Showing results for 
Search instead for 
Did you mean: 

Update task workflow property inside a scriptTask

theoryoflinkin
Champ on-the-rise
Champ on-the-rise
Hi,

In my workflow (developped with Activiti), I just want to implement a TimerEvent on a UserTask.

After 15 days, I want this TimerEvent to call a ScriptTask.

In this ScriptTask, I just try to update the "priority" property of my UserTask and set it to 1 (high).

Can someone help me please? I can't find what to write inside my ScriptTask…

Thanks in advance
2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator

<serviceTask id="yourscripttask" name="your script task" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
   <extensionElements>
      <activiti:field name="script">
         <activiti:string>
            var taskId = "activiti$yourscripttask";//where yourscripttask is the task id you defined in serviceTask id="yourscripttask"
                var taskInstance = workflow.getTask(taskId);
            taskInstance.priority=***;
            //or just use direclty
            taskInstance.priority=***;
         </activiti:string>
      </activiti:field>
   </extensionElements>
</serviceTask>


theoryoflinkin
Champ on-the-rise
Champ on-the-rise
Thank you!