upload file through REST API is not displaying in UI

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

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

7 Replies
Arun_nmc
Active Member

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
Active Member

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
Active Member

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

Arun_nmc
Active Member

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

Hi,

 

Thanks for your reply.

Yes, we tried for  the task UI  POST api/enterprise/tasks/{taskId}/raw-content , it  get added the file visible in the related content  field of the activiti UI

screenshot_1.jpg

 

But we would like to see the file in the  File upload  filed  of the UI screen.

 

So that’s why  used api/enterprise/process-instances/{processInstanceId}/raw-content

API and  created the  database triggers  specifically for  adding the value fieldupload in the related_content’s field column in order to get display the file in the File Upload[customized]  filed of Activiti UI.

This trigger wont cause any issues, but trying  to understand whether its good practice to add database triggers in the activiti DB.

 

Thanks

Arun K

 

Arun_nmc
Active Member

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

Hi All,

 

could you please suggest creating database trigger and adding the trigger int he activiti database  is the right approach .

Kindly suggest your thoughts.

 

Thanks

Arun K

IPLSchedule
Member II

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

IPL Schedule 2020

Looking for the IPL 2020 Schedule? Finally, you are in the right place. Indian Premier League (IPL 2020) which will be the 13th edition of Vivo IPL. Get IPL Schedule 13, Fixtures and Time Table for Indian Premier League 13. Finally, the wait is over! The most awaited and biggest cricket gala IPL 2020 has been scheduled between March 29, 2020, to May 24, 2020, hosted by Vivo IPL India.

https://iplschedule2020.in