<?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: Activiti Dependency Injection Support in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135068#M94797</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i had the same problem, i would inject some buiseness-services managed by guice into the JavaDelegates. I cant get the ExpressionManager worked, the Methods in the custom ELResolver were not invoked &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://connect.hyland.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A working Solution seems to be adding a DelegateInterceptor, requesting an injection of the JavaDelegages. Can u tell me if this is a way to do this, or is there a better solution? (caching the injected delegates to not injecting it twice will be added)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;config.setDelegateInterceptor(new DelegateInterceptor() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; public void handleInvocation(DelegateInvocation invocation) throws Exception {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Object target = invocation.getTarget();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (target instanceof JavaDelegate)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; injector.injectMembers(target);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; invocation.proceed();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public class TestService implements JavaDelegate {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; @Inject&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; public ProcessEngine processEngine;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; @Inject&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; public MyBusinessService service;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; public void execute(DelegateExecution execution) throws Exception {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("# Testtask executed " + processEngine);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; service.doSomething();&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;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(i use the newest version of activity: 5.12.1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 May 2013 11:39:36 GMT</pubDate>
    <dc:creator>stefanw</dc:creator>
    <dc:date>2013-05-21T11:39:36Z</dc:date>
    <item>
      <title>Activiti Dependency Injection Support</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135065#M94794</link>
      <description>Hi :I am a newbie to Activiti and I am trying to evaluate Activiti for our project needs. Our project architecture is based on typical dependency injection based architecture. We are using Google Guice and my question is does Activiti supports the core engine configuration done via any other DI than</description>
      <pubDate>Fri, 15 Feb 2013 01:21:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135065#M94794</guid>
      <dc:creator>surya46584</dc:creator>
      <dc:date>2013-02-15T01:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Dependency Injection Support</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135066#M94795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can "configure" the engine from within java-code as well, spring is not needed. You could use any DI-framework you want to build a process-engine configuration and build an engine from there. Start off using a "org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration" or JTA-variant.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to hook in your DI into the expressions activiti resolves, you should override the org.activiti.engine.impl.el.ExpressionManager used for this. This is a setter-method on the process-engine configuration. A good example of this is the org.activiti.spring.SpringExpressionManager, which adds an additional ELResolver for resolving spring-beans. In your case, you'll need to use your DI th get the right instance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 12:59:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135066#M94795</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-02-15T12:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Dependency Injection Support</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135067#M94796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the pointer. Will check it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;surya&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Feb 2013 16:13:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135067#M94796</guid>
      <dc:creator>surya46584</dc:creator>
      <dc:date>2013-02-16T16:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Dependency Injection Support</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135068#M94797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i had the same problem, i would inject some buiseness-services managed by guice into the JavaDelegates. I cant get the ExpressionManager worked, the Methods in the custom ELResolver were not invoked &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://connect.hyland.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A working Solution seems to be adding a DelegateInterceptor, requesting an injection of the JavaDelegages. Can u tell me if this is a way to do this, or is there a better solution? (caching the injected delegates to not injecting it twice will be added)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;config.setDelegateInterceptor(new DelegateInterceptor() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; public void handleInvocation(DelegateInvocation invocation) throws Exception {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Object target = invocation.getTarget();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (target instanceof JavaDelegate)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; injector.injectMembers(target);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; invocation.proceed();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public class TestService implements JavaDelegate {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; @Inject&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; public ProcessEngine processEngine;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; @Inject&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; public MyBusinessService service;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; public void execute(DelegateExecution execution) throws Exception {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("# Testtask executed " + processEngine);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; service.doSomething();&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;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(i use the newest version of activity: 5.12.1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;tank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 11:39:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135068#M94797</guid>
      <dc:creator>stefanw</dc:creator>
      <dc:date>2013-05-21T11:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Dependency Injection Support</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135069#M94798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi guys!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to set a custom DelegateInterceptor for JavaDelegate calls?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I do that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thales Pires&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 17:09:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135069#M94798</guid>
      <dc:creator>thalestpires</dc:creator>
      <dc:date>2014-01-24T17:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Dependency Injection Support</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135070#M94799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The ProcessEngineConfigurationImpl has a method, called "setDelegateInterceptor". If you're using the activiti.cfg.xml OR spring, just set the "delegateInterceptor" to reference your custom interceptor. In case you're creating the engine in code, call that method (you might have to cast).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jan 2014 08:34:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135070#M94799</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2014-01-27T08:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Dependency Injection Support</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135071#M94800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi I saw the comment #4 above about injecting with Guice for Java Delegates. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems interesting but is it the right/recommended way? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks and regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 12:03:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135071#M94800</guid>
      <dc:creator>dmifs</dc:creator>
      <dc:date>2014-02-28T12:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Dependency Injection Support</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135072#M94801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It is possible, yes, the same mechanism as for spring would work for Guice.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 09:51:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-dependency-injection-support/m-p/135072#M94801</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-03-10T09:51:05Z</dc:date>
    </item>
  </channel>
</rss>

