if(cancelled || deleted) { for (var i = 0; i < bpm_package.children.length; i++) { if (!bpm_package.children[i].hasAspect("wfl:status")) { bpm_package.children[i].properties["wfl:status"] = "Draft"; bpm_package.children[i].save(); } } } for (var i = 0; i < bpm_package.children.length; i++) { if (!bpm_package.children[i].hasAspect("wfl:status")) { bpm_package.children[i].addAspect("wfl:status"); } } if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate); if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority; for (var i = 0; i < bpm_package.children.length; i++) { if (bpm_package.children[0].hasAspect("wfl:status")) { bpm_package.children[i].properties["wfl:status"] = "In Review"; bpm_package.children[i].save(); } } execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome')); ${bpm_assignee.properties.userName} ${wf_reviewOutcome == 'Approve'} The document was reviewed and approved. if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate); if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority; for (var i = 0; i < bpm_package.children.length; i++) { if (bpm_package.children[0].hasAspect("wfl:status")) { bpm_package.children[i].properties["wfl:status"] = "Approved"; bpm_package.children[i].save(); } } ${initiator.properties.userName} The document was reviewed and rejected. if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate); if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority; for (var i = 0; i < bpm_package.children.length; i++) { if (bpm_package.children[0].hasAspect("wfl:status")) { bpm_package.children[i].properties["wfl:status"] = "Draft"; bpm_package.children[i].save(); } } ${initiator.properties.userName}