upload file through REST API is not displaying in UI

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Arun_nmc
Member II

upload file through REST API is not displaying in UI

Hi ,

 

Using the (alfersco activiti exposed API) /activiti-app/api/enterprise/process-instances/52619/raw-content?isRelatedContent=false, i am trying to upload a file  to a process instance id 52619. But only one file(sample.txt) alone is getting  uploaded in the related_content table of the activiti.

 

I am using the alfersco activiti UI  which is having the file upload component  to display the associate file  for the process.

when i am doing upload via UI for a task, i am able to see the document even in the completed task.

However whetn i am trying to upload the file through the API, its content is stored in the content table  but i am not able to see in the UI. There is a column in the related_content table called 'field' this  need to be updated with "fileupload"value. once it updated in the table, then i can able to see the file attachment in the UI.

 

Is there a  way that i can update the field of related_content table  as fileupload while uploading the file using the /activiti-app/api/enterprise/process-instances/52619/raw-content?isRelatedContent=false API

 

Kindly suggest  your thoughts please.

 

Thanks

Arun K

4 Replies
Arun_nmc
Member II

Re: upload file through REST API is not displaying in UI

Hi

 

could you please suggest your thoughts or solutions on this please.

 

Thanks

Arun K

Arun_nmc
Member II

Re: upload file through REST API is not displaying in UI

Hi,

 

There is a GET API activiti-app/api/enterprise/process-instances/{process-instance)/field-content  through we can get the related-content table field column.

is there any API through which we can updated the field conlumn of the related_content table. 

if the API is not there, whether  setting the default  value for the field column to 'fileupload' or create a trigger[ when ever upload is happen and insert valur into related-content] to update the field value after the file upload happens.

 

whether these to resolve this issue. Kindly suggest your thoughts please.

 

Thanks

Arun K

Arun_nmc
Member II

Re: upload file through REST API is not displaying in UI

Hi,

 

i am able to find the solution on this.

whever a file get  uploaded via REST API for a process instance id, the  field column of the related_content table can be updated with the value fileupload  by using data base triggers. could you please suggest  adding data base triggers in the activiti Database is the right approach or not.

 

Kindly suggest your thoughts on this please.

 

Thanks

Arun K

deko
Established Member

Re: upload file through REST API is not displaying in UI

Hi Arun,

I believe you are currently using the wrong API endpoint. Looking at the official documentation at

https://docs.alfresco.com/process-services1.10/topics/content.html

even the documentation states for the endpoint you are trying to use, that it "...currently won’t have any influence on what is visible in the UI".

In order to see content on a task, you should use the other API endpoint for tasks:

POST api/enterprise/tasks/{taskId}/raw-content

This one is also explained at the documentation page mentioned earlier.

Does attaching documents work with this endpoint so that you also see the content in the UI?

Please do not modify the database manually in any way, this is NOT required at all!

Best regards,

Dennis