We are using Enterprise Activiti 1.5, in our process we got task to call external system to retrieve document and attach it the to the current process. Created service to make the call but not able to find the right service to add the document as attachment.
Please let me know what service can be used to attach document to the process in java service task.
RelatedContentService.createRelatedContent() can be used to do this.
I have posted some code in https://forums.activiti.org/content/pass-attachments-sub-process-call-activity which will show you how to add an attachment to a process instance and how to link it to a form field so that it can be viewed in any display value fields in subsequent tasks. Lemme know if this is of any help.
Yes, I looked into your post earlier and had it working by calling the "relatedContentService.createRelatedContent" and setting the "FileAttach" variable to the content ID returned by the "createRelatedContent" method.