cancel
Showing results for 
Search instead for 
Did you mean: 

Starting a script

irene08
Champ in-the-making
Champ in-the-making
Good Day!

I really need your help in this script. I know the flow but I'm not sure how to start. I will execute a script. This is the content of my codes/javascript. To be short, I need the category to auto change from category(Reviewed) to category(Approval) if requiredapprovepercent is equal to actualpercent. This is inside the workflow process.


<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
    <activiti:field name="script">
       <activiti:string>
               
        var Approval = file.properties["cm:category"];
               
        if (workflowname = activitiParallelReview || workflowname = activitiParallelGroupReview)
        {
          if (wf:requiredApprovePercent = 100 && wf:actualPercent = 100)
             {
              Alfresco.logger.debug(“Irene…Reading the if statement”);
              getCategory("Approval");
              Alfresco.logger.debug(“enabling the approval”);
             }
           if (wf_requiredApprovePercent == wf_actualPercent)
             {
              Alfresco.logger.debug(“Irene…Reading the 2nd if statement”);
              getCategory("Approval");
              Alfresco.logger.debug(“enabling the approval.. 2nd if statement”);
             }
      }
       </activiti:string>
    </activiti:field>
</activiti:taskListener>


Thank you. Please help.

Irene Smiley Happy
10 REPLIES 10

irene08
Champ in-the-making
Champ in-the-making
Hi Axel!

I've been working this for weeks. It really consumed my time. I'm really having a hard time. Different codes, different approach. If you'll see it. I just need the file to be automatically tag as Approval, if the actualPercent is equal to 100. Simply as that. I don't know why Manage Rule is not working. I'll let you know what will happen. Thank you for your time. Very much appreciated.


Again, Thank you.

Irene