Review and Approval workflow process

cancel
Showing results for 
Search instead for 
Did you mean: 
aishu
Active Member

Review and Approval workflow process

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);

4 Replies
sanjaybandhniya
Intermediate

Re: Review and Approval workflow process

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>

aishu
Active Member

Re: Review and Approval workflow process

Can u suggest me in which location i should write this file?

sanjaybandhniya
Intermediate

Re: Review and Approval workflow process

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.

aishu
Active Member

Re: Review and Approval workflow process

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 ?