<?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: Using spring @Autowire in ExecutionListener not working in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59160#M36313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It can only work with an expression or delegateExpression attribute. But the expression attribute should also contain the method you want to invoke. So something like ${emailListener.notify(execution)}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2015 07:34:05 GMT</pubDate>
    <dc:creator>trademak</dc:creator>
    <dc:date>2015-03-26T07:34:05Z</dc:date>
    <item>
      <title>Using spring @Autowire in ExecutionListener not working</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59155#M36308</link>
      <description>Hi all,I have a web app, that among other things, is using Activiti&amp;nbsp; for BPM. What i did is dropped these into the classpath:activiti-engine-5.6.jaractiviti-spring-5.6.jarThen, my spring-activi config is as follows[size=85]&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;beans xmlns="http://www.sprin</description>
      <pubDate>Tue, 28 Jun 2011 21:52:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59155#M36308</guid>
      <dc:creator>davidwaf</dc:creator>
      <dc:date>2011-06-28T21:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using spring @Autowire in ExecutionListener not working</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59156#M36309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, i abandoned the whole idea of autowiring directly in ExecutionListener, opted to use field injection, which gives me access to the beans. And that works fine.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jun 2011 23:32:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59156#M36309</guid>
      <dc:creator>davidwaf</dc:creator>
      <dc:date>2011-06-28T23:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using spring @Autowire in ExecutionListener not working</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59157#M36310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;HI David,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you give me the sample expression for field injection for the above scenarios stated, so that we are able to access mailService, propertyService beans in the notify method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a web application, that uses annotations for defining beans. When i tried to use an AutoWired bean in an ExecutionListener, i get only Null reference. Process Definition and Code of the ExecutionListener is given below&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Excerpt from Process definition BPMN file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;———————————–&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;sequenceFlow id="toFinanceReview" name="Goes To Finance Review" sourceRef="exclusivegateway1" targetRef="financeReview"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:executionListener event="take" class="edu.divakar.handlers.EmailListener"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;&amp;lt;![CDATA[${managerDecision == 'approve'}]]&amp;gt;&amp;lt;/conditionExpression&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/sequenceFlow&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;===============================================================================&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public class EmailListener implements ExecutionListener {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Autowired&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EmailService emailService;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void notify(DelegateExecution arg0) throws Exception {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map&amp;lt;String, Object&amp;gt; processVariableMap = arg0.getVariables();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; emailService.sendEmail(processVariableMap); //HERE I GET ONLY NULL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 12:14:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59157#M36310</guid>
      <dc:creator>divakar</dc:creator>
      <dc:date>2015-03-24T12:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using spring @Autowire in ExecutionListener not working</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59158#M36311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That original post is from 2011 … &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;class="edu.divakar.handlers.EmailListener"&amp;gt; is NOT a spring bean. @Autowired is never going to work on a non-spring bean. Your emailListener needs to be a Spring bean too to make it work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Mar 2015 13:54:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59158#M36311</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2015-03-24T13:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using spring @Autowire in ExecutionListener not working</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59159#M36312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Joram,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Activiti is awesome and great to receive an reply from you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to Spring. I have annotated the above EmailListener class with @Component and defined a method in my config class as follows&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@Bean&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public EmailListener getEmailListener() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new EmailListener();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, my question is, to make activiti take this spring bean, how should i define it in the process definition. I tried the following but none worked.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;activiti:executionListener event="take" class="${emailListener}"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;activiti:executionListener event="take" class="#{emailListener}"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;activiti:executionListener event="take" expression="${emailListener}"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;activiti:executionListener event="take" expression="#{emailListener}"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess i am missing something silly. Please bear with me and give me the solution. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 04:50:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59159#M36312</guid>
      <dc:creator>divakar</dc:creator>
      <dc:date>2015-03-25T04:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using spring @Autowire in ExecutionListener not working</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59160#M36313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It can only work with an expression or delegateExpression attribute. But the expression attribute should also contain the method you want to invoke. So something like ${emailListener.notify(execution)}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2015 07:34:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59160#M36313</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2015-03-26T07:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using spring @Autowire in ExecutionListener not working</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59161#M36314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Thanks. Actually my problem was activiti was using a different context, which was not having the emailListener bean. However once i set the application context in my SpringProcessEngineConfiguration and in ProcessEngineFactoryBean, it worked fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help too.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2015 03:35:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-spring-autowire-in-executionlistener-not-working/m-p/59161#M36314</guid>
      <dc:creator>divakar</dc:creator>
      <dc:date>2015-03-27T03:35:50Z</dc:date>
    </item>
  </channel>
</rss>

