Add attachement to process outside of task

Is it possible (and if so how) to have a delegate add an attachment to the instance? I only found the according api in the taskService, and it requires a taskId …

Hi Jan,

I think you can just set taskId to null in the API call. That said, the attachment API is not so awesome (CAM-5239, CAM-6562), so I personally would prefer a process variable.


Thanks for the answer … we are setting up a solution where the user uploads a file in a multipart rest task-complete and we want to buffer it via camunda before asynchronously calling the document-management system.
First idea was using the taskService.createAttachment method on task-complete (custom controller). But if I understand you correctly, you are suggesting to store the byte[] as a processvariable directly? Wouldn’t that drastically increase the historic db tables (when on level full?)

Indeed, this gives you the regular variables history whereas with attachments once you delete them they are gone.

I will try my luck with attachements then … and if I do not like the api, you get a PR :wink: