We could look at adding some better fluent support in Aries blueprint (although 
it would be in a non-standard namespace). It might be a while before there was 
anything actually in trunk though.

Regards

Tim Ward
-------------------
Apache Aries PMC member & Enterprise OSGi advocate
Enterprise OSGi in Action (http://www.manning.com/cummins)
-------------------


From: l...@code-house.org
Subject: Re: Aries and fluent builders
Date: Thu, 15 Dec 2011 09:26:37 +0100
To: user@aries.apache.org



Hey Timothy,I know that solution proposed by you will work but it will mess a 
XML. Once I'll need to inject more values I will have 100 lines only to put 
true or false in some fields.
Regards,Lukasz
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: l...@code-house.org
Subject: Aries and fluent builders
Date: Thu, 15 Dec 2011 08:58:47 +0100
To: user@aries.apache.org

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
                                          

Reply via email to