Hello, I am currently developing a process flow that includes a Generate Document task and a bunch of others that happen before and after.
My idea with this flow, is to generate a pdf document (using the Generate Document task of course) and use a native task (HTTP Task, Service Registry Task or even a Script Task) to upload into an external data-store.
What I currently have is a groovy script that reads the generated document data with ContentEngines.getDefaultContentEngine().getContentService().getContentItemData(documentId); and streams it directly to the request implemented in that groovy script.
I read quite a bit on the documentation and other posts in the forum and I could not find anything related to having native multipart support in flowable tasks.
Is my idea possible, or should I just keep the working groovy script as a solution?
Your question is about the Enterprise version of Flowable and this forum is for the Open Source version. I would advise you to use the Enterprise Forum for Enterprise related questions.
In any case, at the moment we do not have native support for uploading documents using the HTTP or Service Registry task. You could try using the Request Handler of the REST Service and modify the flwHttpRequest.
This is going to use a multipart/form-data for the request.
Keep in mind that this script is just an example. I would advise you to raise a change request so that this can be done in an easier way by you just defining the document as part of the input parameters.
Hi @filiphr, thank you for your answer and I realised after posting that I should have posted in the other forum.
Just as a last reply, I did try your method and concluded that despite being able to set multipart values manually in a service registry task script, the headers for the multipart still do not get set. Even manually setting the content-type header, we still miss the boundary property for multipart parsers to be able to parse the body.
But anyway, that was helpful and thank you. Next question I’ll post directly in the other Forum.