Attach document-link to process instances via new REST API

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2013 02:43 AM
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
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2014 07:22 AM
Thanks for your quick reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2014 07:48 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2014 09:29 AM
1.) Start a process instance via rest (e.g. a process which has 3 user tasks)
2.) Attach the document link to ONE of those 3 tasks via REST
3.) All 3 tasks will show the related content in the UI
Am I right?
Could you give me a an estimation when the new version will be released?
Thanks for your reply!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2014 10:17 AM
Just out of curiosity, are you actually using Activiti Explorer as a fronted for your users? It's initially intended to be used as a demo-app to get familiar with the API-calls and concepts Activiti offers…

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2014 11:21 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2014 05:15 AM
http://10.120.40.24:8080/activiti-rest/service/runtime/tasks/2626/attachments with the body:
{
"name":"test link",
"description":"test",
"type":"simpleType",
"externalUrl":"https://www.google.de"
}
When I query all attachment of this task with rest with GET http://10.120.40.24:8080/activiti-rest/service/runtime/tasks/2626/attachments, I can see this attachment. But the activiti explorer only shows the comment on the right side, that the link was attached. The link itself is not shown.
When I attach a link in the activiti explorer, I can see this link in the explorer, but not in the rest query. Could it be that the links which are shown in the "related content" section are stored in another table? It seems that the attachments via REST are separated from the attachments created directly in the explorer.
Both web apps use the same database and all other data is consistent.
It would be great if someone could help me. Thank you very much

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2014 07:53 AM
Look at this picture: https://www.dropbox.com/s/6vpoyxssoq90yxx/attachment_rest.png
I have added two attachments to the task with the task_id = 2667. The corresponding process_instance_id is 2662. The activiti explorer shows only those attachments, where the PROC_INST_ID_ is set. Wouldn´t it be better if both variables (task_id and PROC_INST_ID_) were set no matter if the attachment is added via rest or via the activiti explorer?
Should I open an issue in the activiti explorer section?
Would be great if this could be fixed. I hope that I can contribute with this post.
Thank you very much
Ben

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2014 09:54 AM
We make a difference between process instance attachments and task attachments. But the Activiti Explorer could be enriched by also showing the task attachments. We still need to add a REST service to add attachments to a process instance as well.
Best regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2014 10:46 AM
thank you for your quick answer. Will this fix : https://github.com/Activiti/Activiti/commit/57034fa44bfbaefdd2449d70cbe4da668659e687
solve my problem? Because Frederik said that with this fix, all tasks of a certain process will show the corresponding attachments in the activiti explorer
Best regards and thanks
Ben

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2014 01:06 PM
Yes that should solve your problem.
Best regards,
