Display Files attached in previous Process Instances

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

Display Files attached in previous Process Instances

Given a Process Instance ID OR ContentId, I need to be able to display to the user in a downloadable format all files attached during that workflow. These files are being stored as BLOBs in an Oracle database table. Is there a way I can display these files to the user following a query of that process instance ID? The "link" column of this table is empty.

34 Replies
cjose
Senior Member II

Re: Display Files attached in previous Process Instances

Could you please confirm if you are using the Enterprise version of the Activiti or the community version?

gbanks
Active Member II

Re: Display Files attached in previous Process Instances

Enterprise

cjose
Senior Member II

Re: Display Files attached in previous Process Instances

Check if these APIs are of any help? Content | Alfresco Documentation 

gbanks
Active Member II

Re: Display Files attached in previous Process Instances

Using this API I'm able to GET the details about the documents (ID, name, etc). However, if I try to map the ID to a variable and then use Display Value id_variable in a form, it shows up empty. How do I then display the file?

cjose
Senior Member II

Re: Display Files attached in previous Process Instances

It can be solved in few different ways. Are you able to share a prototype of what you trying to do? If you want to get the actual file itself, you need to invoke the following API with the ID you get from the RELATED_CONTENT table

GET api/enterprise/content/{contentId}/raw
gbanks
Active Member II

Re: Display Files attached in previous Process Instances

Alright so I've used that call and get "Response message: could not parse response to JSON: %PDF-1.7" How then am I able to map the PDF to a variable/ display it to the user in a form?

cjose
Senior Member II

Re: Display Files attached in previous Process Instances

Like I said above, please provide a prototype of your solution so that I

can better help you.

gbanks
Active Member II

Re: Display Files attached in previous Process Instances

Here is a prototype. I have removed the endpoint address.

cjose
Senior Member II

Re: Display Files attached in previous Process Instances

For some reason I cannot download it! Can you attach it in this thread? You can do attachments using the advanced editor. Also, please export the whole app including any forms you have in your prototype

Ciju