Hey. This is a relevant and interesting topic for me, so lets give this a shot:
Two goals:
- Upload a File to the ECM (lets use Alfresco in this example)
- The file has related metadata about the task and process the file came from.
So Alfresco has the following:
http://docs.alfresco.com/5.0/references/RESTful-UploadUploadPost.html
If you were to POST to alfresco (using java delegate, Script task, or service task) the file that is uploaded as a attachment or process variable, you can pass the attachment as the file data.
You would want to use a Custom content type: Working With Custom Content Types in Alfresco | ECM Architect | Alfresco Developer Tutorials
or you can use the Description field as listed in Alfresco Docs - Repository Web Scripts Tutorials. The preference would be to use a custom content type.
In that content type you would have fields for Process ID, Task ID, Deployment ID, etc. (whatever data you wanted to transfer along). You would then generate/create a URL on the Alfresco/ECM side that links back to Camunda using the metadata you stored.
If you stored the metadata in the description field, I would recommend storing it as a JSON string. See this example for getting Process ID, Task ID, etc metadata:
@choibc @douglascrp @fherpertz see the following for a example of how you could using scripting in your form to post your file. Loading previous data in process start form - #2 by StephenOTT. This example using GET, but basics are there.
Personally i have preference for POSTing using Java Delegate / Script task / service task, but there are good use cases for posting from the form as well.