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 ?
I think your script you have put is not correct it seems and something is undefined. like companyhome where this variable is declared or used.
Hello Tabrez,
I know that there is an issue with the code, i am not able to figure it out. I am searching for any solution to publish a document to a path i specify each time (variable folder path)
Are you trying to publish a document from APS or Embedded Activiti in Alfresco
for APS: you need to create a REST API (webscript) in alfresco which you can call from your APS, the script in alfresco should do the publishing.
for Embedded Activiti: you must use "org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate" class in `activiti:class` for accessing Alfresco root objects such as `companyhome`
Hello Abbas,
Thanks for the feedback , but i am trying to set a rule now.. and i am unable to get a specific property from a custom type i created
var name = document.properties["ptrojectname"]; it returns null any idea please?
do you see this property applied on the document in UI? probably the property is not available when you are trying to access it.
I am actually able to see it ...and it really is a weird behaviour , i put the property via APS.. and i can see it in the document...but when i try to show it , it doesnt work.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
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.