07-17-2019 05:02 AM
Dear Team,
I have written java script for Review and Approval workflow process (activiti$activitiReviewPooled),
Now i need to move files from the current folder to an "approval" folder when the files are approved or to the "rejection" folder when the files are rejected.
What should i do in script,
Please refer the script and suggest!
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "activiti$activitiReviewPooled";
workflow.parameters["bpm:workflowDescription"] = "Please assign approver for "+ document.name;
workflow.parameters["bpm:groupAssignee"] = people.getGroup("GROUP_cadgroup");
workflow.parameters["bpm:sendEMailNotifications"] = true;
workflow.execute(document);
07-18-2019 12:44 AM
That logic you have to write in taskListner(complete).
Ex.
<userTask id="reviewTask" name="Review Task"
activiti:formKey="wf:activitiReviewTask">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
//Move file logic
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
07-18-2019 02:37 AM
Can u suggest me in which location i should write this file?
07-18-2019 03:23 AM
If you are using custom workflow then you need to write this code in bpmn file.
If you are using OOTB workflow then you need to override bpmn file of that workflow.
07-18-2019 08:32 AM
Hi,
I am new to alfresco,
i don't know whether should i create file & how can i execute ,
I have created this script file as test.js and stored in Repository-> Data dictionary -> Scripts folder and
set rule for folder as:
perform action-> execute script-> test.js
can u suggest me in brief ?
Explore our Alfresco products with the links below. Use labels to filter content by product module.