Hello,
I've tried to programmatically find and read file that was attached to business process. The process contains a form attached to star event including file attachment form field. When the process is started, the user will upload a file using the form.
I'd like to read and manipulate that file in a script task later in the process but cannot find a suitable method for reading the file.
I've tried so far:
All of the above return null values. Is there some other method for reading/listing attached files?
Thanks in advance!
You can also fetch the content by the process variable name with the below code
relatedContentService.getFieldContentForProcessInstance(
execution.getProcessInstanceId(), VARIABLE_NAME, 1, 0).getContent();
Have a look at this tutorial - https://hub.alfresco.com/t5/alfresco-process-services/getting-started-with-alfresco-process-services...
Also the other 2 methods you mentioned works with attachment I'd which is different from filename
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.