<?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 Spring bean access in tasks and muiltiple ProcessEngines in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/spring-bean-access-in-tasks-and-muiltiple-processengines/m-p/38662#M20534</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;We're taking the approach of running multiple ProcessEngines in a single app server (each with a DataSource pointing to a different database schema) to provide multi-tenant support in an application.&amp;nbsp; We need to spin up engines on demand as customers come in, so we can't pre-configure them beforehand in the Spring configuration files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm now able to build the ProcessEngines programatically instead of through Spring configuration, but i'm now finding that the Spring beans that I was previously accessing in BPMN expressions are no longer available.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example configuration:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;lt;userTask activiti:candidateUsers="${groupBean.getCandidateUsers(execution,'blah')}" …&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Example output when test is run:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'groupBean'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.engine.impl.juel.AstMethod.invoke(AstMethod.java:79)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.engine.impl.juel.AstMethod.eval(AstMethod.java:75)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error makes sense:&amp;nbsp; Spring can't inject the beans used in the expression as it isn't creating the ProcessEngine instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Question:&amp;nbsp; Is there another 'blessed' programatic way to make a ProcessEngine aware of such beans if the Spring approach is no longer available?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I looked through the Activiti source and found the following method on org.activiti.spring.ProcessEngineFactoryBean:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; public ProcessEngine getObject() throws Exception&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The implementation of this makes the following call&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; processEngineConfiguration.setExpressionManager(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new SpringExpressionManager(applicationContext, processEngineConfiguration.getBeans()));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;which looks like it might do the trick, but when I add this to my code that builds the ProcessEngine, it still can't see the beans.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FYI - I'm using Activiti 5.4.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;bwd&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Apr 2011 16:05:40 GMT</pubDate>
    <dc:creator>bwd</dc:creator>
    <dc:date>2011-04-06T16:05:40Z</dc:date>
    <item>
      <title>Spring bean access in tasks and muiltiple ProcessEngines</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/spring-bean-access-in-tasks-and-muiltiple-processengines/m-p/38662#M20534</link>
      <description>Hi,We're taking the approach of running multiple ProcessEngines in a single app server (each with a DataSource pointing to a different database schema) to provide multi-tenant support in an application.&amp;nbsp; We need to spin up engines on demand as customers come in, so we can't pre-configure them before</description>
      <pubDate>Wed, 06 Apr 2011 16:05:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/spring-bean-access-in-tasks-and-muiltiple-processengines/m-p/38662#M20534</guid>
      <dc:creator>bwd</dc:creator>
      <dc:date>2011-04-06T16:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Spring bean access in tasks and muiltiple ProcessEngines</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/spring-bean-access-in-tasks-and-muiltiple-processengines/m-p/38663#M20535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Update:&amp;nbsp; I was able to resolve the issue by making the following call against the ProcessEngineConfiguration object:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .setExpressionManager( new SpringExpressionManager( applicationContext, null ) );&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would still be interested in hearing if there's a better/preferred approach for accomplishing the same thing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Apr 2011 20:47:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/spring-bean-access-in-tasks-and-muiltiple-processengines/m-p/38663#M20535</guid>
      <dc:creator>bwd</dc:creator>
      <dc:date>2011-04-06T20:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Spring bean access in tasks and muiltiple ProcessEngines</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/spring-bean-access-in-tasks-and-muiltiple-processengines/m-p/38664#M20536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Check this out: &lt;/SPAN&gt;&lt;A href="http://forums.activiti.org/en/viewtopic.php?f=6&amp;amp;t=1471&amp;amp;hilit=beans" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/en/viewtopic.php?f=6&amp;amp;t=1471&amp;amp;hilit=beans&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2011 08:18:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/spring-bean-access-in-tasks-and-muiltiple-processengines/m-p/38664#M20536</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-04-08T08:18:04Z</dc:date>
    </item>
  </channel>
</rss>

