03-06-2020 08:01 AM
Hi,
I'm struggling with the upload of content inside a process in APS (1.9, Enterprise) to ACS via the REST-API. Until now I could use the "publish to Alfresco"-Task, but I'm not able to set the site if the sitename is created inside this process - even if I add the variable to the bpmn20.xml like
<activiti:field name="site"> <activiti:string><![CDATA[${sitename}]]></activiti:string> </activiti:field>
The error message is: "/sites/${sitename} does not exist". So I think Alfresco treats the variable as a string. Funny thing is, that this works for a subfolder:
<activiti:field name="createFolder"> <activiti:expression><![CDATA[${foldername}]]></activiti:expression> </activiti:field>
That's why I have to use REST Calls for more flexibility. What I've found and tried out is this: Link . Now I'm able to create a site, to add members, to create folders - everything what I need apart from uploading files belonging to some upload formfield in process. Uploading from local storage is not a big deal (see link) and creating a blank file is a piece of cake.
I know that the processfiles are relatedContent and that they have a contentId. During execution this is the only variable I have about the uploaded file. So I tried to add it like this to the JSON with POST /nodes/{id}/children:
{ "name": ${contentId}, "nodeType": "cm:content", }
but this did not work. The contentId is not directly the file. So where is the file or where is its content stored? And at the end: How could I upload this relatedContent to ACS via API?
Cheers and thanks a lot,
Jannik
Explore our Alfresco products with the links below. Use labels to filter content by product module.