Hi,
It's not very concise, but this should work:
<bean id="processEngineConfiguration1"
class="org.activiti.engine.ProcessEngineConfiguration"
factory-method="createStandaloneInMemProcessEngineConfiguration"/>
<bean id="processEngineConfiguration2"
factory-ref="processEngineConfiguration1"
factory-method="setDatabaseSchemaUpdate">
<argument value="false"/>
</bean>
<bean id="processEngineConfiguration3"
factory-ref="processEngineConfiguration2" factory-method="setDataSource">
<argument>
<bean class="org.h2.jdbcx.JdbcDataSource">
<property name="url" value="jdbc:h2:mem:activiti" />
</bean>
</argument>
</bean>
<bean id="processEngineConfiguration4"
factory-ref="processEngineConfiguration3"
factory-method="setJobExecutorActivate">
<argument value="true"/>
</bean>
<bean id="processEngine" factory-ref="processEngineConfiguration4"
factory-method="buildProcessEngine"/>
If you're interested in more information about advanced blueprint techniques
then you may find Enterprise OSGi in Action to be a useful resource. You can
get 37% off if you use the code eosgi37 at the Manning website -
http://www.manning.com/cummins
Regards,
Tim Ward
-------------------
Apache Aries PMC member & Enterprise OSGi advocate
Enterprise OSGi in Action (http://www.manning.com/cummins)
-------------------
From: [email protected]
Subject: Aries and fluent builders
Date: Thu, 15 Dec 2011 08:58:47 +0100
To: [email protected]
Hello,I tried to use Aries instead of Spring to configure Activiti process
engine. The problem I meet was related to fluent builders. Activiti can be
configured with fluent builder, for example:
ProcessEngine processEngine =
ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration()
.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
.setJdbcUrl("jdbc:h2:mem:my-own-db;DB_CLOSE_DELAY=1000")
.setJobExecutorActivate(true)
.buildProcessEngine();
I ported this fragment to an XML fragment:
<bean id="processEngineConfiguration"
class="org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
<property name="jobExecutorActivate" value="true" /> <property
name="databaseSchemaUpdate" value="false" /> <property
name="dataSource"> <bean class="org.h2.jdbcx.JdbcDataSource">
<property name="url" value="jdbc:h2:mem:activiti" /> </bean>
</property> </bean> <bean id="processEngine"
factory-ref="processEngineConfiguration" factory-method="buildProcessEngine">
</bean>
The error reported by blueprint
is:org.osgi.service.blueprint.container.ComponentDefinitionException: No setter
for jobExecutorActivate property
The jobExecutorActivate property returns an instance of
ProcessEngineConfiguration so it is not a regular Java Bean property. Do you
have any ideas how to manage both - Aries and Activiti to work together?
Best regards,Lukasz