<?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: New Spring applicationContext started by activiti-rest in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/new-spring-applicationcontext-started-by-activiti-rest/m-p/118917#M83871</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's what I ended up doing in case this helps somebody.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added a ProcessEnginesInitializer class that extends org.activiti.engine.ProcessEngines.&amp;nbsp; The bean's @PostConstruct method registers the Spring-managed process engine with ProcessEngines, sets ProcessEngines.isInitialized to true, and performs some other initializations that ProcessEngines normally does.&amp;nbsp; Next, the org.activiti.rest.application.ActivitiRestServicesApplication bean's declaration needs to depend on the processEnginesInitializer (to ensure that the REST service is initialized after ProcessEngines has been initialized).&amp;nbsp; This results in the REST API using the Spring-managed process engine and avoids the extra application context I mentioned before.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;@Component("processEnginesInitializer")&lt;BR /&gt;public class ProcessEngineInitializer extends org.activiti.engine.ProcessEngines {&lt;BR /&gt;&lt;BR /&gt; protected static final Logger log = LoggerFactory.getLogger(ProcessEngineInitializer.class);&lt;BR /&gt;&lt;BR /&gt; @Inject&lt;BR /&gt; private ProcessEngine processEngine;&lt;BR /&gt;&lt;BR /&gt; @PostConstruct&lt;BR /&gt; public void contextInitialized() {&lt;BR /&gt;&amp;nbsp; String processEngineName = processEngine.getName();&lt;BR /&gt;&amp;nbsp; String resourceUrl = "applicationContext.xml"; // I'm not sure that this text matters so you may be able to set this to anything.&lt;BR /&gt;&amp;nbsp; ProcessEngineInfo processEngineInfo = new ProcessEngineInfoImpl(processEngineName, resourceUrl, null);&lt;BR /&gt;&amp;nbsp; processEngineInfosByName.put(processEngineName, processEngineInfo);&lt;BR /&gt;&amp;nbsp; processEngineInfosByResourceUrl.put(resourceUrl, processEngineInfo);&lt;BR /&gt;&amp;nbsp; registerProcessEngine(processEngine);&lt;BR /&gt;&amp;nbsp; isInitialized = true;&lt;BR /&gt;&amp;nbsp; ProcessEngine processEngine = ProcessEngineInitializer.getDefaultProcessEngine();&lt;BR /&gt;&amp;nbsp; if (processEngine == null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; log.error("Could not initialize Activiti");&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; @PreDestroy&lt;BR /&gt; public void contextDestroyed() {&lt;BR /&gt;&amp;nbsp; ProcessEngineInitializer.destroy();&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;bean id="activitiRest" class="org.activiti.rest.application.ActivitiRestServicesApplication" depends-on="processEnginesInitializer"/&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Mar 2013 13:59:11 GMT</pubDate>
    <dc:creator>engywook</dc:creator>
    <dc:date>2013-03-29T13:59:11Z</dc:date>
    <item>
      <title>New Spring applicationContext started by activiti-rest</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/new-spring-applicationcontext-started-by-activiti-rest/m-p/118916#M83870</link>
      <description>Hi,I have a Spring (3.2.2) managed web application using Activiti 5.12.&amp;nbsp; I'm not having any issues with this configuration and Activiti performs as expected.&amp;nbsp; The process engine is managed by Spring and has access to all the beans it needs.&amp;nbsp; We have not been using activiti-explorer or activiti-rest</description>
      <pubDate>Wed, 27 Mar 2013 19:47:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/new-spring-applicationcontext-started-by-activiti-rest/m-p/118916#M83870</guid>
      <dc:creator>engywook</dc:creator>
      <dc:date>2013-03-27T19:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: New Spring applicationContext started by activiti-rest</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/new-spring-applicationcontext-started-by-activiti-rest/m-p/118917#M83871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's what I ended up doing in case this helps somebody.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added a ProcessEnginesInitializer class that extends org.activiti.engine.ProcessEngines.&amp;nbsp; The bean's @PostConstruct method registers the Spring-managed process engine with ProcessEngines, sets ProcessEngines.isInitialized to true, and performs some other initializations that ProcessEngines normally does.&amp;nbsp; Next, the org.activiti.rest.application.ActivitiRestServicesApplication bean's declaration needs to depend on the processEnginesInitializer (to ensure that the REST service is initialized after ProcessEngines has been initialized).&amp;nbsp; This results in the REST API using the Spring-managed process engine and avoids the extra application context I mentioned before.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;@Component("processEnginesInitializer")&lt;BR /&gt;public class ProcessEngineInitializer extends org.activiti.engine.ProcessEngines {&lt;BR /&gt;&lt;BR /&gt; protected static final Logger log = LoggerFactory.getLogger(ProcessEngineInitializer.class);&lt;BR /&gt;&lt;BR /&gt; @Inject&lt;BR /&gt; private ProcessEngine processEngine;&lt;BR /&gt;&lt;BR /&gt; @PostConstruct&lt;BR /&gt; public void contextInitialized() {&lt;BR /&gt;&amp;nbsp; String processEngineName = processEngine.getName();&lt;BR /&gt;&amp;nbsp; String resourceUrl = "applicationContext.xml"; // I'm not sure that this text matters so you may be able to set this to anything.&lt;BR /&gt;&amp;nbsp; ProcessEngineInfo processEngineInfo = new ProcessEngineInfoImpl(processEngineName, resourceUrl, null);&lt;BR /&gt;&amp;nbsp; processEngineInfosByName.put(processEngineName, processEngineInfo);&lt;BR /&gt;&amp;nbsp; processEngineInfosByResourceUrl.put(resourceUrl, processEngineInfo);&lt;BR /&gt;&amp;nbsp; registerProcessEngine(processEngine);&lt;BR /&gt;&amp;nbsp; isInitialized = true;&lt;BR /&gt;&amp;nbsp; ProcessEngine processEngine = ProcessEngineInitializer.getDefaultProcessEngine();&lt;BR /&gt;&amp;nbsp; if (processEngine == null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; log.error("Could not initialize Activiti");&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; @PreDestroy&lt;BR /&gt; public void contextDestroyed() {&lt;BR /&gt;&amp;nbsp; ProcessEngineInitializer.destroy();&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;bean id="activitiRest" class="org.activiti.rest.application.ActivitiRestServicesApplication" depends-on="processEnginesInitializer"/&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2013 13:59:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/new-spring-applicationcontext-started-by-activiti-rest/m-p/118917#M83871</guid>
      <dc:creator>engywook</dc:creator>
      <dc:date>2013-03-29T13:59:11Z</dc:date>
    </item>
  </channel>
</rss>

