<?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 Cant autowire Related Content Service in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/cant-autowire-related-content-service/m-p/21670#M9545</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New to Alfresco Activity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have uploaded some files in my process. Now I want to access them in my execution listener but whenever I try to Autowire the RelatedContentService it gives me null. I will attach picture of my relevant code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In thee activiti the user task only calls this execution listener. It does call the listener.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing it on a trial version if that's relevant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't done any configurations. I have tried to list the bean in activit.cfg.xml but it doesn't work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;package com.elixir.fileWriter;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import com.activiti.domain.runtime.RelatedContent;&lt;BR /&gt;import com.activiti.service.runtime.RelatedContentService;&lt;/P&gt;&lt;P&gt;import java.io.File;&lt;BR /&gt;import java.io.FileOutputStream;&lt;BR /&gt;import java.io.InputStream;&lt;BR /&gt;import java.util.ArrayList;&lt;BR /&gt;import java.util.List;&lt;/P&gt;&lt;P&gt;import org.activiti.engine.delegate.*;&lt;BR /&gt;import org.springframework.beans.factory.annotation.Autowired;&lt;BR /&gt;import org.springframework.data.domain.Page;&lt;BR /&gt;import org.springframework.stereotype.Component;&lt;/P&gt;&lt;P&gt;@Component("fileWriterExecuter")&lt;BR /&gt;public class FileWriterExecuter implements JavaDelegate {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Autowired&lt;BR /&gt; private RelatedContentService relatedContentService;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; @Override&lt;BR /&gt; public void execute(DelegateExecution execution) throws Exception {&lt;BR /&gt; &lt;BR /&gt; execution.getVariable("attachment", InputStream.class);&lt;BR /&gt; String absoluteFilePath = "D:\\filetest\\fileExecution.txt";&lt;BR /&gt; File file = new File(absoluteFilePath);&lt;BR /&gt; &lt;BR /&gt; List&amp;lt;RelatedContent&amp;gt; relatedContent = new ArrayList&amp;lt;RelatedContent&amp;gt;();&lt;BR /&gt; Page&amp;lt;RelatedContent&amp;gt; page = null;&lt;BR /&gt; int pageNumber = 0;&lt;BR /&gt; &lt;BR /&gt; //RelatedContentService relatedContentService = new RelatedContentService();&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; while ((page == null) || (page.hasNext())) {&lt;BR /&gt; page = relatedContentService&lt;BR /&gt; .getAllFieldContentForProcessInstance(&lt;BR /&gt; execution.getProcessInstanceId(), 50,&lt;BR /&gt; pageNumber);&lt;BR /&gt; relatedContent.addAll(page.getContent());&lt;BR /&gt; pageNumber++;&lt;BR /&gt; } &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Feb 2019 13:24:06 GMT</pubDate>
    <dc:creator>haidersultan93</dc:creator>
    <dc:date>2019-02-08T13:24:06Z</dc:date>
    <item>
      <title>Cant autowire Related Content Service</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/cant-autowire-related-content-service/m-p/21670#M9545</link>
      <description>Hello.New to Alfresco Activity.I have uploaded some files in my process. Now I want to access them in my execution listener but whenever I try to Autowire the RelatedContentService it gives me null. I will attach picture of my relevant code.In thee activiti the user task only calls this execution li</description>
      <pubDate>Fri, 08 Feb 2019 13:24:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/cant-autowire-related-content-service/m-p/21670#M9545</guid>
      <dc:creator>haidersultan93</dc:creator>
      <dc:date>2019-02-08T13:24:06Z</dc:date>
    </item>
  </channel>
</rss>

