<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Fetching an attached file programmatically in business process in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/fetching-an-attached-file-programmatically-in-business-process/m-p/25377#M11000</link>
    <description>&lt;P&gt;You can also fetch the content by the process variable name with the below code&lt;/P&gt;&lt;PRE&gt;relatedContentService&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getFieldContentForProcessInstance&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execution&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getProcessInstanceId&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; VARIABLE_NAME&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getContent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Have a look at this tutorial - &lt;A href="https://hub.alfresco.com/t5/alfresco-process-services/getting-started-with-alfresco-process-services/ba-p/290016#toc-hId--24329866" target="_blank" rel="noopener nofollow noreferrer"&gt;https://hub.alfresco.com/t5/alfresco-process-services/getting-started-with-alfresco-process-services/ba-p/290016#toc-hId--24329866&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also the other 2 methods you mentioned works with attachment I'd which is different from filename&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jul 2021 17:51:30 GMT</pubDate>
    <dc:creator>abbask01</dc:creator>
    <dc:date>2021-07-16T17:51:30Z</dc:date>
    <item>
      <title>Fetching an attached file programmatically in business process</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/fetching-an-attached-file-programmatically-in-business-process/m-p/25376#M10999</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;I've tried so far:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;relatedContentService.getRelatedContentForProcessInstance(execution.getProcessInstanceId(), pageSize, pageNumber)&lt;/LI&gt;&lt;LI&gt;taskService.getAttachment('filename')&lt;/LI&gt;&lt;LI&gt;execution.getAttachment('filename')&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;All of the above return null values. Is there some other method for reading/listing attached files?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 08:18:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/fetching-an-attached-file-programmatically-in-business-process/m-p/25376#M10999</guid>
      <dc:creator>ta</dc:creator>
      <dc:date>2021-07-15T08:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching an attached file programmatically in business process</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/fetching-an-attached-file-programmatically-in-business-process/m-p/25377#M11000</link>
      <description>&lt;P&gt;You can also fetch the content by the process variable name with the below code&lt;/P&gt;&lt;PRE&gt;relatedContentService&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getFieldContentForProcessInstance&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execution&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getProcessInstanceId&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; VARIABLE_NAME&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getContent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Have a look at this tutorial - &lt;A href="https://hub.alfresco.com/t5/alfresco-process-services/getting-started-with-alfresco-process-services/ba-p/290016#toc-hId--24329866" target="_blank" rel="noopener nofollow noreferrer"&gt;https://hub.alfresco.com/t5/alfresco-process-services/getting-started-with-alfresco-process-services/ba-p/290016#toc-hId--24329866&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also the other 2 methods you mentioned works with attachment I'd which is different from filename&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jul 2021 17:51:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/fetching-an-attached-file-programmatically-in-business-process/m-p/25377#M11000</guid>
      <dc:creator>abbask01</dc:creator>
      <dc:date>2021-07-16T17:51:30Z</dc:date>
    </item>
  </channel>
</rss>

