cancel
Showing results for 
Search instead for 
Did you mean: 

Upload Content - REST API

eramesh
Champ on-the-rise
Champ on-the-rise
Hi,

Using Activiti REST API to upload content to process instance, I get the response back with id, name, created, creted by etc…

But when I view the task I not seeing the this uploaded document attachment but its displayed in the process instance screen.

How I can relate this uploaded content to my form display value variable so that this document will be displayed to the users in the following tasks in the process?

Tried both REST service Process-instance

http://localhost:8080/activiti-app/api/enterprise/process-instances/182651/raw-content

And the tasks
http://localhost:8080/activiti-app/api/enterprise/tasks/182609/raw-content


Am I missing any parameter? Please let me know.

Thanks in advance!




4 REPLIES 4

shagufta1
Champ in-the-making
Champ in-the-making
Hi,

Not sure it will help or not… just append ?isRelatedContent=true in your url and that document will show as a related content for particular task. by default it sets to false.

eramesh
Champ on-the-rise
Champ on-the-rise
Thank you!

Tried that option with "/api/enterprise/tasks/" but it shows only in that particular task not in the following tasks that's in the flow.

I get the ID back in the response object when checked in the database table "RELATED_CONTENT" for that ID see the record with "field" value as null but for the one that I attach as part of the form from UI I see the value as the field name that I defined in the form.

cjose
Elite Collaborator
Elite Collaborator
Hi Ramesh,
May I know your use case for this scenario of uploading a document outside of the workflow? Is this a case where you have already started a process and the user might have forgotten to add an attachment. Then you would like to add an attachment from outside your process? If it is such a use case, I don't think any of the existing REST APIs can do this. This is because, the related content is linked to a form field when you submit a form from UI. However there are ways to work around this by using the Java APIs. So, please let me know your use case for me to suggest a solution.

Regards,
Ciju

eramesh
Champ on-the-rise
Champ on-the-rise
Hi Ciju,

This is related to the other posted that you responded earlier "Attach Document to the process in Java service" I found the solution for this by caling  "relatedContentService.createRelatedContent"  and setting the "fileattach" variable to display in the subsequent task.

Thank you for taking time and posting comments…Really Appreciate your help!!

Regards,
Ramesh