Alfresco moving document

716 views Asked by At

I have an execution listener script, that moves a file during the workflow to another folder, from In folder to Execut.

When I'm starting workflow from User files it works good, but from document library in site it doesn't work, showing error org.alfresco.scripts.ScriptException: 05190025 Failed to execute supplied script: Destination Node is a mandatory parameter

The folder tree in document library is the same.

var dest = companyhome.childByNamePath("Execut");
    for (var i = 0; i < bpm_package.children.length; i++){
        bpm_package.children[i].move(dest);
    }

What is the problem?

i'm understood what the problem is, this code companyhome.childByNamePath("Execut"); defines path to users folder and than moves documents from document library folders to user files folder. Need to define correct destination folder path in document library. How to do it?


document moves from doc library to users folder, but I need that it moves to folder in document library and I don't know how to define path. I'm trying companyhome.childByNamePath("site/main/documentLibrary/Execut"); but it doesn't work

1

There are 1 answers

0
Krutik Jayswal On BEST ANSWER

Update your process defination with below code.

var dest = companyhome.childByNamePath("Sites/main/documentLibrary/Execut");
for (var i = 0; i < bpm_package.children.length; i++)
{
        bpm_package.children[i].move(dest);
}

You are using wrong path.Path for site is Sites/main/documentLibrary/Execut and not site/main/documentLibrary/Execut