cancel
Showing results for 
Search instead for 
Did you mean: 

Display Files attached in previous Process Instances

gbanks
Confirmed Champ
Confirmed Champ

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 34

cjose
Elite Collaborator
Elite Collaborator

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

gbanks
Confirmed Champ
Confirmed Champ

Enterprise

cjose
Elite Collaborator
Elite Collaborator

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

gbanks
Confirmed Champ
Confirmed Champ

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
Elite Collaborator
Elite Collaborator

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
Confirmed Champ
Confirmed Champ

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
Elite Collaborator
Elite Collaborator

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

can better help you.

gbanks
Confirmed Champ
Confirmed Champ

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

cjose
Elite Collaborator
Elite Collaborator

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