Upload related content from APS process to ACS via API

Showing results for 
Search instead for 
Did you mean: 

Upload related content from APS process to ACS via API


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">

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">

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,