camel-activiti configuration

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

camel-activiti configuration

Castyn
Greetings, I am having a bit of an issue and I think it may be solved potentially by defining something currently available in blueprint config, to spring config.  I am integrating activiti and camel using the camel-activiti bundle, and currently through my spring config I have hit a bit of a wall.  Currently in my configuration I define solely in spring, when an activiti process attempts to reference a camel context, I am getting a cast exception

java.lang.ClassCastException: org.activiti.engine.impl.cfg.JtaProcessEngineConfiguration cannot be cast to org.activiti.spring.SpringProcessEngineConfiguration

Looking at the examples available, it seems there is a blueprint config such as follows that if defined would alleviate the issue I am facing.  Unfortunately I don't have time to redo all the spring configuration that already exists, so I am hoping I can migrate this to spring

    <service interface="org.activiti.camel.ContextProvider">
        <bean class="org.activiti.camel.SimpleContextProvider">
            <argument value="OrderProcess"/>
            <argument ref="camelContext"/>
        </bean>
    </service>

How can I leverage the same thing in spring, or is that not a possibility?  Can spring and blueprint be using in conjunction with each other somehow?

My current spring configuration for activiti is currently defined in a camel-beans.xml I have and is

  <bean id="dataSource" class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
    <property name="targetDataSource">
      <bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
        <property name="driverClass" value="org.h2.Driver" />
        <property name="url" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000" />
        <property name="username" value="sa" />
        <property name="password" value="" />
      </bean>
    </property>
  </bean>

  <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource" />
  </bean>

  <bean id="asyncExecutor" class="org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor">
    <property name="defaultAsyncJobAcquireWaitTimeInMillis" value="1000" />
    <property name="defaultTimerJobAcquireWaitTimeInMillis" value="1000" />
  </bean>

  <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
    <property name="dataSource" ref="dataSource" />
    <property name="transactionManager" ref="transactionManager" />
    <property name="databaseSchemaUpdate" value="true" />
    <property name="jobExecutorActivate" value="true" />
    <property name="asyncExecutor" ref="asyncExecutor" />
    <property name="asyncExecutorEnabled" value="true" />
    <property name="asyncExecutorActivate" value="true" />
  </bean>

  <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
    <property name="processEngineConfiguration" ref="processEngineConfiguration" />
  </bean>

  <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />