cancel
Showing results for 
Search instead for 
Did you mean: 

Attach document-link to process instances via new REST API

b_schnarr
Champ in-the-making
Champ in-the-making
Hello at all,

we want to upload attachments to user tasks AND process instances via REST API in a way that the users can see those attachments in the activiti explorer.

Especially, we want to attach links to documents, not the document itself. I know that you can attatch document links to both, user tasks AND process instances via Java API with the method

Attachment createAttachment(String attachmentType,
                          String taskId,
                          String processInstanceId,
                          String attachmentName,
                          String attachmentDescription,
                          String url)


With the new REST API (Activiti 5.14), you can create a new attachment on a task, containing a link to an external resource.
The Question is: Can you attach those links to process instances, too? (like the Java API can?)

We just can communicate with Activiti through REST. Therefore, we need a way to "store" document links in a global process variable so that the user can access those links via the activiti explorer.

I hope that somebody can help.
Thanks and best regards
Ben
24 REPLIES 24

b_schnarr
Champ in-the-making
Champ in-the-making
Is it possible in the meantime to store and retrieve attachments of process instances via REST? Because this would be consistent to the Java-API. In my custom tasklist, I want to have the same behaviour as in the Activiti Explorer. I want to create an attachment for 1 task within the process. But all other tasks should have this attachment, too.

Thanks and best regards
Ben

b_schnarr
Champ in-the-making
Champ in-the-making
Just created a JIRA issue concerning this topic: https://jira.codehaus.org/browse/ACT-2174

b_schnarr
Champ in-the-making
Champ in-the-making
Is there any progress on this?

jbarrez
Star Contributor
Star Contributor
No, not currently. Attachments are not used a lot by customers of Activiti, hence why it isn't as prioritised as other issues at the moment.

ahmed_mahfouz
Champ in-the-making
Champ in-the-making
Just if somebody stumbled upon this question. There is a workaround you can get all the tasks related to a process using the task historic rest endpoint query/historic-task-instances?processInstanceId=<your-process-instance-id> and after that loop on the results array and get the attachments for every task.