<?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: Spring boot application - Injecting HistoryService in a TaskListener returns Null in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13142#M5795</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is spring boot application. anything specific for springboot ??&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 May 2018 12:38:08 GMT</pubDate>
    <dc:creator>papalanisamy</dc:creator>
    <dc:date>2018-05-17T12:38:08Z</dc:date>
    <item>
      <title>Spring boot application - Injecting HistoryService in a TaskListener returns Null</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13137#M5790</link>
      <description>I am working in a spring boot application.&amp;nbsp;when i try to call tasklistener class, The autowired historyservice is returning null.&amp;nbsp;process service‌&amp;nbsp;tasklistener&amp;nbsp;Can anyone please help !</description>
      <pubDate>Thu, 17 May 2018 10:30:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13137#M5790</guid>
      <dc:creator>papalanisamy</dc:creator>
      <dc:date>2018-05-17T10:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Spring boot application - Injecting HistoryService in a TaskListener returns Null</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13138#M5791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;TaskListeners&amp;nbsp;that are set in 'class' attribute are&amp;nbsp;created/instantiated by the engine so Spring autowiring will not work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;activiti:taskListener&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;event&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"complete"&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;class&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"example.MyTaskListener"&lt;SPAN class=""&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 11:52:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13138#M5791</guid>
      <dc:creator>bassam_al-saror</dc:creator>
      <dc:date>2018-05-17T11:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Spring boot application - Injecting HistoryService in a TaskListener returns Null</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13139#M5792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As &lt;B&gt;Bassam Al-Sarori&lt;/B&gt;‌ mentioned task listeners are basically bind in context of task and workflow so it should be set in your workflow tasks, not separated wired as a spring bean .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rupesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 12:20:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13139#M5792</guid>
      <dc:creator>rupeshsawaliya</dc:creator>
      <dc:date>2018-05-17T12:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Spring boot application - Injecting HistoryService in a TaskListener returns Null</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13140#M5793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bassam,&lt;/P&gt;&lt;P&gt;Thanks for your prompt response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code. any changes to be done for this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN dir="ltr" style="color: #000000; font-size: 10pt;"&gt;public class TestClass implements TaskListener {&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;@Autowired&lt;BR /&gt;&amp;nbsp;&amp;nbsp;private HistoryService historyService;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;public void notify(DelegateTask delegateTask) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String currentEvent = delegateTask.getEventName();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if("delete".equalsIgnoreCase(currentEvent))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(historyService);// it returns null, please let us know the workaround&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;XML File :&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;activiti:taskListener event="all" class="com.callback.TestClass"&amp;gt;&amp;lt;/activiti:taskListener&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 12:35:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13140#M5793</guid>
      <dc:creator>papalanisamy</dc:creator>
      <dc:date>2018-05-17T12:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Spring boot application - Injecting HistoryService in a TaskListener returns Null</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13141#M5794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rupesh,&lt;/P&gt;&lt;P&gt;Thanks for your prompt response.&lt;/P&gt;&lt;P&gt;We are using SPRING BOOT .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code. any changes to be done for this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN dir="ltr" style="color: #000000; font-size: 10pt;"&gt;public class TestClass implements TaskListener {&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;@Autowired&lt;BR /&gt;&amp;nbsp;&amp;nbsp;private HistoryService historyService;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;public void notify(DelegateTask delegateTask) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String currentEvent = delegateTask.getEventName();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if("delete".equalsIgnoreCase(currentEvent))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(historyService);// it returns null, please let us know the workaround&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;XML File :&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;activiti:taskListener event="all" class="com.callback.TestClass"&amp;gt;&amp;lt;/activiti:taskListener&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 12:36:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13141#M5794</guid>
      <dc:creator>papalanisamy</dc:creator>
      <dc:date>2018-05-17T12:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Spring boot application - Injecting HistoryService in a TaskListener returns Null</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13142#M5795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is spring boot application. anything specific for springboot ??&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 12:38:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13142#M5795</guid>
      <dc:creator>papalanisamy</dc:creator>
      <dc:date>2018-05-17T12:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Spring boot application - Injecting HistoryService in a TaskListener returns Null</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13143#M5796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here i think you may have to depends-on attribute on task listener class the way it is added in following bean definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;bean id="abc" class="com.test.ABC" parent="baseJavaDelegate" &lt;STRONG&gt;depends-on="activitiBeanRegistry"&lt;/STRONG&gt;&lt;BR /&gt; abstract="true"&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this will help you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rupesh Sawaliya&lt;/P&gt;&lt;P&gt;EnProwess Technologies&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 12:58:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13143#M5796</guid>
      <dc:creator>rupeshsawaliya</dc:creator>
      <dc:date>2018-05-17T12:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Spring boot application - Injecting HistoryService in a TaskListener returns Null</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13144#M5797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try registering your task listener as a spring bean (i.e. using @Component)&amp;nbsp;and use&amp;nbsp;an expression&amp;nbsp;to call it.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;lt;activiti:taskListener&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;event&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"all"&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;expression&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;"${myTaskListener.notify(execution)}"&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;By the way, it could be any class (spring bean) doesn't have to implement TaskListener.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 13:41:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13144#M5797</guid>
      <dc:creator>bassam_al-saror</dc:creator>
      <dc:date>2018-05-17T13:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Spring boot application - Injecting HistoryService in a TaskListener returns Null</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13145#M5798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks both of you..&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally the issue is solved by passing the listener in delegate expression instead of class .&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #727174; background-color: #f6f6f6; border: 0px;"&gt;&amp;lt;activiti:taskListener event="all" delegateExpression="${TestClass}"&amp;gt;&amp;lt;/activiti:taskListener&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 14:23:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/spring-boot-application-injecting-historyservice-in-a/m-p/13145#M5798</guid>
      <dc:creator>papalanisamy</dc:creator>
      <dc:date>2018-05-17T14:23:45Z</dc:date>
    </item>
  </channel>
</rss>

