Hi!
Good Day! I've done my own javascript and I will execute this in workflow and I also added some category name in categories.xml. Here with is the code that I've done and below this script is the category name I've added. Please help. Thank you.
—————————————————————————————————————————————————————'
requiredpercent_actualpercent.js <—- this is the javascript I've created. I'm running this but it has no effect. Maybe I'm calling also the wrong property/id for category. In short, I want my file to be automatically tagged to "Approval" when Required Approval Percent is equal to Actual Approval Percent.
/*IRENE-Tagging file from reviewed to approval*/
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (wf_requiredApprovePercent = 100 && wf_actualPercent = 100)
{
logger.log(“Irene…Reading the if statement”);
cm:generalclassifiable=”Approval”;
logger.log(“enabling the approval”);
if (wf_requiredApprovePercent == wf_actualPercent)
{
logger.log(“Irene…Reading the 2nd if statement”);
cm:generalclassifiable=”Approval”;
logger.log(“enabling the approval.. 2nd if statement”);
}
</activiti:string>
</activiti:field>
</activiti:taskListener>
/*IRENE*/
————————————————————————————————————————————————————————
categories.xml
<!– IRENE-Document Review Status –>
<cm:category>
<cm:name>Document Review Status</cm:name>
<cm:subcategories>
<cm:category>
<cm:name>Draft</cm:name>
<cm:name>Reviewed</cm:name>
<cm:name>Approval</cm:name> <—-here is the name that should be automatically tag in the file.
<cm:name>Approved</cm:name>
<cm:name>Published</cm:name>
<cm:name>Abandoned</cm:name>
</cm:category>
</cm:subcategories>
</cm:category>
————————————————————————————————————————————————————————
Thank you,
Irene