07-09-2015 05:05 AM
<userTask id="reviewTask" name="Review Task" activiti:assignee="${reviewAssignee.properties.userName}" activiti:formKey="wf:activitiReviewTask">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
bpm_package.children[0].properties["ct:assigned"] = reviewAssignee.properties.userName;;
bpm_package.children[0].save();
]]></activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[if(task.getVariableLocal('wf_reviewOutcome') == 'Approve') {
var newApprovedCount = wf_approveCount + 1;
var newApprovedPercentage = (newApprovedCount / wf_reviewerCount) * 100;
execution.setVariable('wf_approveCount', newApprovedCount);
execution.setVariable('wf_actualPercent', newApprovedPercentage);
}else{
execution.setVariable('wf_actualPercent', wf_requiredApprovePercent);
}]]></activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<multiInstanceLoopCharacteristics isSequential="true" activiti:collection="bpm_assignees" activiti:elementVariable="reviewAssignee">
<completionCondition>${wf_actualPercent >= wf_requiredApprovePercent}</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
07-09-2015 05:47 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.