07-15-2012 08:05 PM
function newBatch(assignee, doc){
var workflowPackage = workflow.createPackage();
workflowPackage.addNode(doc);
var workflowDef = workflow.getDefinitionByName("activiti$StartReviewBatch");
var parameters = new Object();
parameters["bpm:assignee"] = assignee;
parameters["bpm:workflowDescription"] = "Please review " + doc.name;
var workflowPath = workflowDef.startWorkflow(workflowPackage, parameters);
}
<userTask id="usertask1" name="Review" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="wf:activitiReviewTask">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>if (task.getVariable('wf_reviewOutcome') == 'Approve'){
var dest= companyhome.childByNamePath("Sites/jstest/documentLibrary/Approved");
bpm_package.children[0].move(dest);
} else if (task.getVariable('wf_reviewOutcome') == 'Reject') {
var dest= companyhome.childByNamePath("Sites/jstest/documentLibrary/Rejected");
bpm_package.children[0].move(dest);</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<endEvent id="endevent1" name="End"></endEvent>
07-16-2012 09:25 AM
08-08-2012 09:42 AM
var dest= companyhome.childByNamePath("Sites/jstest/documentLibrary/Approved");
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.