Tackle Berry
Tackle Berry

Reputation: 113

Alfresco moving document

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

Upvotes: 2

Views: 718

Answers (1)

Krutik Jayswal
Krutik Jayswal

Reputation: 3175

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

Upvotes: 2

Related Questions