AnsweredAssumed Answered

Publish document to Alfresco Folder

Question asked by marwen on Feb 15, 2019
Latest reply on Feb 20, 2019 by marwen

Hello All,

 

I am new to Alfresco and i am trying  to put a document inside a folder , but my folder is a variable so using "Publish to Alfresco task " is not going to work because the destination is fixed or at max you can define only 1 subfolder.

 

So i am thinking of using a listener at the end of my task execution and here is the code :

 

var test = execution.getVariable('DocumentPath');
var strDestFolder ="sites/swsdp/Projects";
var objDestFolder = companyhome.childByNamePath(strDestFolder);
test.move(objDestFolder);

 

the code is not working and i am having this error : org.activiti.engine.ActivitiException: problem evaluating script: ReferenceError: "companyhome" is not defined in <eval> at line number 3.

Any body can help me in fix this code ? or providing me with a solution to putting a document in a variable folder path ?

Outcomes