Hi All,
I am creating rule to delete node with sleep time is not working on folder.I just checked in java-script console it is working and same code is not working if apply through rule on folder. And also in that document is not able to delete in that sleep period.
var nodeRefs = companyhome.childByNamePath("Test");
if(nodeRefs!=null)
{
var nodes = nodeRefs.children;
for (var i=0; i<nodes.length; i++) {
sleep(50000);
if(nodes[i].isDocument)
{
nodes[i].remove();
}
console.log("i:"+i);
}
}
function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
}
Hi kkumar _,
Alfresco server side java script does not have console.log() function so it is preventing script to run. You can use logger.log() by enabling ScriptLogger to show your logs in server logs.
Thanks,
Kalpesh
not able to open document when it's in sleep 50ms. Actually I am using this for print and download here once print/download is done document need to delete.
It’s hard to understand what you want to achieve. I think this not the right way to handle a document after downloading/printing. Can you describe the „Workflow“ of the documents and the trigger of the rule.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.