camunda-bpm-camel Blog Post

467 views
Skip to first unread message

Bernd Rücker (camunda)

unread,
Sep 25, 2013, 4:22:31 AM9/25/13
to camunda-...@googlegroups.com

FYI - I wrote a blog post yesterday: http://camundabpm.blogspot.de/2013/09/camunda-bpm-apache-camel-integrating.html. Hope that helps to gather more community feedback :-)

 

Cheers

Bernd

 

carolin....@gmail.com

unread,
Oct 1, 2013, 4:43:22 AM10/1/13
to camunda-...@googlegroups.com
Hi Bernd,

Thank you for this interesting camel-example, which works really fine. I'm working with Tomcat and Spring.
In your manual for spring maybe it would be helpful to say, that the following lines of code have to be added in the spring config.


    <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
        <routeBuilder ref="myBuilder" />   
    </camelContext>

    <bean id="myBuilder" class="org.camunda.demo.camel.MyCamelRouteBuilder" />

    <bean id="camel" class="org.camunda.bpm.camel.spring.CamelServiceImpl">
        <property name="processEngine" ref="processEngine" />
        <property name="camelContext" ref="camelContext" />
    </bean>


In the "MyCamelRouteBuilder" I changed the following:


@Component
public class MyCamelRouteBuilder extends SpringRouteBuilder



Cheers,
Caro

Bernd Rücker (camunda)

unread,
Oct 1, 2013, 4:59:26 AM10/1/13
to camunda-...@googlegroups.com

Hi Caro.

 

Which manual are you referring to exactly (just to know which ones gets read most ;-))?

 

Cool that it works with almost no modifications in Spring. Maybe it would be interesting to share this as well – could you maybe send over your source code or is this is a problem?

 

Cheers

Bernd

--
You received this message because you are subscribed to the Google Groups "camunda BPM users & process application developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/02a290b4-a7f3-4178-8870-16ceb5b3747a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

carolin....@gmail.com

unread,
Oct 1, 2013, 7:56:50 AM10/1/13
to camunda-...@googlegroups.com
Hi Bernd,

I startet reading with your blog post (because I was last week at the JUG Karlsruhe) and then looked up at the manual here: https://github.com/camunda/camunda-bpm-camel

I provided you my source code in the attached *.zip-file. I hope, that works for you.

Cheers,
Caro
camunda-bpm-camel.zip

Bernd Rücker (camunda)

unread,
Oct 1, 2013, 9:23:31 AM10/1/13
to camunda-...@googlegroups.com

That works perfectly. Thanks again for the feedback! I put it on my list – let’s see when I have time to add it to the docs

--

You received this message because you are subscribed to the Google Groups "camunda BPM users & process application developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

Cristian Requena

unread,
Oct 3, 2013, 10:46:27 AM10/3/13
to camunda-...@googlegroups.com
Hi Bernd, thank you for the blog post.

I've been trying to integrate Camunda and Camel in my JBoss Spring project, but I'm finding an issue I cannot get rid of.

My Spring config is more or less like Carolin one, but when I set the "processes.xml" file with the process-archive config, I get an error:

Caused by: org.camunda.bpm.engine.ProcessEngineException: Cannot deploy process archive 'processArchive' to process engine 'processEngine' no such process engine exists.

The only way I found to solve this error is to empty the "processes.xml" file. After doing this, the ProcessApplication boots:

16:38:43,956 INFO  [org.camunda.bpm.container.impl.jmx.deployment.ParseProcessesXmlStep] (ServerService Thread Pool -- 174) Found process application file at vfs:/.../WEB-INF/classes/META-INF/processes.xml
16:38:43,959 INFO  [org.camunda.bpm.container.impl.jmx.JmxRuntimeContainerDelegate] (ServerService Thread Pool -- 174) Process Application ...-routes-1.0.0-SNAPSHOT successfully deployed.

but when using @Autowired camunda services (i.e. RuntimeService) a null bean is injected.


Do you have any idea about what could be failing here?


Thank you!


Cristian.

Carolin Dettling

unread,
Oct 4, 2013, 3:20:34 AM10/4/13
to camunda-...@googlegroups.com
Hi Cristian,

I think it depends on your database configuration, because I'm using a local database. Maybe this http://docs.camunda.org/latest/guides/user-guide/#process-engine could help you.

Best Regards,
Caro

Cristian Requena

unread,
Oct 4, 2013, 4:08:16 AM10/4/13
to camunda-...@googlegroups.com
Hi Carolin, thank you for your reply.


 <!-- JBoss Transaction Manager -->
 
<bean id="transactionManager"
 
class="org.springframework.transaction.jta.JtaTransactionManager" />


 
<!-- Camunda BPM ProcessEngineConfiguration -->
 
<bean id="processEngineConfiguration"
 
class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
   
<property name="dataSourceJndiName" value="java:jboss/datasources/datasourceXADS" />
   
<property name="transactionManager" ref="transactionManager" />
   
<property name="transactionsExternallyManaged" value="true" />
   
<property name="history" value="full" />
   
<property name="deploymentResources" value="classpath*:/bpmn/*.bpmn20.xml" />
 
</bean>


 
<!-- Camunda BPM ProcessEngine -->
 
<bean id="processEngine" class="org.camunda.bpm.engine.spring.ProcessEngineFactoryBean">
   
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
 
</bean>

This spring config seems to work, at least when commenting my processes.xml file.


Regards,

Cristian.

Bernd Rücker (camunda)

unread,
Oct 4, 2013, 4:30:37 AM10/4/13
to camunda-...@googlegroups.com

Hi Christian.

 

How do you run the process engine – self-started (embedded) via your own WAR file? Then you do not need a processes.xml.  Or as shared engine? See http://docs.camunda.org/latest/guides/user-guide/#introduction-architecture-overview-camunda-bpm-platform-architecture for info on the differences. Or asked differently: Do you use the pre-packed Tomcat from our download page (http://camunda.org/download/)?

 

You need the processes.xml ONLY if you want to use the shared engine approach (which we normally recommend). But then you need a process application class as well, see http://docs.camunda.org/latest/guides/user-guide/#process-applications-the-process-application-class-the-springprocessapplication. And in this case you should not startup the engine via spring as described here. So I guess you go for embedded (why?) – in this case you do not need a processes.xml.

 

Does this help?

 

Cheers

Bernd

 

Von: camunda-...@googlegroups.com [mailto:camunda-...@googlegroups.com] Im Auftrag von Cristian Requena
Gesendet: Freitag, 4. Oktober 2013 10:08
An: camunda-...@googlegroups.com
Betreff: Re: [camunda-bpm-users] Re: camunda-bpm-camel Blog Post

 

Hi Carolin, thank you for your reply.

--

You received this message because you are subscribed to the Google Groups "camunda BPM users & process application developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

Bernd Rücker (camunda)

unread,
Oct 4, 2013, 4:31:20 AM10/4/13
to camunda-...@googlegroups.com

Sorry: Hi Cristian (we have a Christian in the team – types natural with H ;-)).

Cristian Requena

unread,
Oct 6, 2013, 2:38:29 AM10/6/13
to camunda-...@googlegroups.com
Hi Bernd,

I'm starting the process engine embedded, because i'll need to do multi-tenancy (and I think that multi-engine and multi-schema is the best way to get it done).

When my processes.xml file is empty, I'm only able to inject null services.
I'll try to remove it on monday and see if something changes.

Thank you Bernd, and don't hesitate about my name spelling - i like them both ;)

Bernd Rücker (camunda)

unread,
Oct 6, 2013, 4:44:55 AM10/6/13
to camunda-...@googlegroups.com

Hi Cristian.

 

I think it is not (yet) really clear in the docs – but you can start multiple engines for multi tenancy as well in Tomcat (I guess you are working on tomcat? Otherwise see corresponding section for other container) shared process engine mode (see http://docs.camunda.org/latest/guides/installation-guide/tomcat/#bpm-platform-install-the-platform-on-a-vanilla-tomcat-add-bpm-platformxml, add multiple engines) and use them by name. This way even cockpit can handle this and shows a dropdown for selecting the right tenant. Maybe that would be an idea to check first?

 

If you stick with the embedded engine remove the processes.xml completely please. You use Spring – right? Then you have to create the services yourself as Spring beans:

 

  <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />

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

  <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />

  <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />

  <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />

 

Maybe that was missing?

 

Cheers

Bernd

Cristian Requena

unread,
Oct 7, 2013, 4:19:10 AM10/7/13
to camunda-...@googlegroups.com
Hi Bernd,

I'm using JBoss, but I am trying to keep it with the minimum dependencies.

I've removed processes.xml file, and I get this message.

INFO  [org.camunda.bpm.container.impl.jmx.deployment.ParseProcessesXmlStep] (ServerService Thread Pool -- 93) No processes.xml file found in process application [...]-1.0.0-SNAPSHOT
INFO  
[org.camunda.bpm.container.impl.jmx.JmxRuntimeContainerDelegate] (ServerService Thread Pool -- 93) Process Application [...]-1.0.0-SNAPSHOT successfully deployed.

My camunda services were defined in place:

 <!-- JBoss Transaction Manager -->
 
<bean id="transactionManager"
 
class="org.springframework.transaction.jta.JtaTransactionManager" />


 
<!-- Camunda BPM ProcessEngineConfiguration -->
 
<bean id="processEngineConfiguration"
 
class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">

   
<property name="dataSourceJndiName" value="java:jboss/datasources/projectXADS" />

   
<property name="transactionManager" ref="transactionManager" />
   
<property name="transactionsExternallyManaged" value="true" />
   
<property name="history" value="full" />
   
<property name="deploymentResources" value="classpath*:/bpmn/*.bpmn20.xml" />
 
</bean>


 
<!-- Camunda BPM ProcessEngine -->
 
<bean id="processEngine" class="org.camunda.bpm.engine.spring.ProcessEngineFactoryBean">
   
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
 
</bean>



 
<!-- Camunda BPM ProcessEngine Services -->

 
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
 
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
 
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
 
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
 
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />


 
<!-- Camunda BPM ProcessApplication -->
 
<bean id="processApplication" class="org.camunda.bpm.engine.spring.application.SpringServletProcessApplication" />


 
<!-- Camunda BPM and Camel integration -->

 
<bean id="camel" class="org.camunda.bpm.camel.spring.CamelServiceImpl">
   
<property name="processEngine" ref="processEngine" />

   
<property name="camelContext" ref="processesCamelContext" />
 
</bean>


I keep getting null references when @Autowiring camunda services:

public class DemoProcessImpl implements DemoProcess {


 
@Autowired
 
private ProcessEngine processEngine;


 
@Autowired
 
private RuntimeService runtimeService;


 
@Override
 
public void changeState() {
   
System.out.println(processEngine == null ? "isNull" : "hasValue");
   
System.out.println(runtimeService == null ? "isNull" : "hasValue");
 
}


I'll get a try to the shared way, but I'd prefer to use the embedded engine.

Do you have any (more!) thoughts about what can be happening in my project?


Thank you for your help, Bernd.

Bernd Rücker (camunda)

unread,
Oct 7, 2013, 1:14:48 PM10/7/13
to camunda-...@googlegroups.com

Hi Cristian.

 

Unfortunately (?) I am on vacation (actually since I think like two or three hours ;-)) and will not really be able to look into it. Maybe somebody else can jump in?

 

I think it could help to provide a small zip containing the project – so we can have a look into it. Personally I am a Java EE / CDI guy so I have to have a look into the Spring issues on Tomcat first and do not know them out-of-my-head  -sorry!

 

Cheers

Bernd

Bernd Rücker (camunda)

unread,
Oct 22, 2013, 6:56:03 AM10/22/13
to camunda-...@googlegroups.com

Hi Christina.

 

Was this solved in the meanwhile o rare there any concrete questions still open?

 

Cheers

Bernd

 

Von: camunda-...@googlegroups.com [mailto:camunda-...@googlegroups.com] Im Auftrag von Cristian Requena


Gesendet: Montag, 7. Oktober 2013 10:19

Reply all
Reply to author
Forward
0 new messages