cancel
Showing results for 
Search instead for 
Did you mean: 

Integrating Activiti with Apache Camel

mproch
Champ in-the-making
Champ in-the-making
Hello,
I created simple component for integration of Activiti with Apache Camel (http://camel.apache.org/).

There are two use cases:
- implementing receive tasks using camel, so that one can write camel route:
from("direct:a").to("activiti:simpleProcess:receive");
which signals activity with id receive in process simpleProcess i.e.
<receiveTask id="receive" name="Wait State" />
- implementing service tasks using camel, so that one can write:
from("activiti:simpleProcess:serviceTask").setBody().property("var1").
                to("mock:service1");
and in process code sth like:
<serviceTask id="serviceTask" activiti:delegateExpression="${camel}"/>
(where var1 is name of process variable).

In the future I hope it would be possible to integrate it with OSGI deployment, especially when  http://jira.codehaus.org/browse/ACT-324 is resolved. It would be also good to find some nicer way of invoking camel from activiti process.

The code is on github: https://github.com/mproch/camel-activiti.
I would be happy to contribute it to Activiti.

what do you think about it?
maciek
18 REPLIES 18

mproch
Champ in-the-making
Champ in-the-making
Hi,
thanks for feedback to everyone,

I think it would be easier to host both invocations camel->activiti and activiti->camel in same project. I guess it would be difficult for camel to have two separate components with one uri schema.  I think that most usecases would involve integration in both ways, anyway.

As for OSGi deployment of business archives/processes - it's already contributed I believe - in activiti-osgi module? At least I'm using it Smiley Happy
I agree that keeping DB and OSGi container in sync is tricky. I believe that the biggest advantage would be to be able to deploy java classes with process files - but for that classloading mechanism would have to be extended. There is already issue on that: http://jira.codehaus.org/browse/ACT-324.

davsclaus
Champ in-the-making
Champ in-the-making
Yes it only makes sense to have one module with the activiti-camel integration. The module should work both ways.

And that's what the current logic could easily be extended to do.
The Camel Component API has APIs for such use-cases (consumer and producer).

/Claus

tombaeyens
Champ in-the-making
Champ in-the-making
Maciek, are you interested in bringing that code to Activiti codebase?
If yes, then here's instructions on how to get started as an Activiti developer: http://docs.codehaus.org/pages/viewpage.action?pageId=163872771
We will guide you through all those steps and support you in making the contribution.

mproch
Champ in-the-making
Champ in-the-making
Hi Tom,
yes, I would be very pleased to do this. I will send you  the contribution agreement and prepare the code to be included - add some docs, rename packages and so on.

thanks,
maciek

bernd_ruecker
Champ in-the-making
Champ in-the-making
Interesting initiative. Looking forward to it!

Can anybody maybe provide a small "near real life" example using it end to end? That would be really interesting to see the whole picture.

Since we currently started a project caring about the correlation of asynchronous responses (beside other stuff), could Camel handle that as well somehow? I currently assume the Camel stuff is stateless, or am I wrong on this?

mproch
Champ in-the-making
Champ in-the-making
Bernd,
first version of code is already in svn - it still needs some changes, though. I will try to make some more decent example in next days and put it on my github

As for Camel - yes, it's basically stateless, however, there are some features that enable keeping state between exchanges, for example using  http://camel.apache.org/hawtdb.html. With some effort, I think it would be possible to handle asynchronous responses - although I'm not really sure about it.

I read your blog about asynchronous responses - it looks really interesting, but looking at the post and camunda fox psi project but I still don't see how would you like to handle such situations - i.e. how would code & configuration look like.
But maybe this starts to become slightly non-activiti topic  Smiley Wink

bernd_ruecker
Champ in-the-making
Champ in-the-making
Okay, waiting for easy to understand examples 🙂

For PSI: We just started. Give us some weeks to present an easy to understand example for you in this case (working out of the box with Activiti and jBPM 3 :-)). We do this together with a customer in an enterprise environment with multiple clusters and huge amounts of processes. So hawtdb doesn't sound like an option 😉

Cheers
Bernd

davsclaus
Champ in-the-making
Champ in-the-making
Hi

Just wanted to know how the Activiti - Camel module is going?
Is there anything the Camel community can do to help?

psiva
Champ in-the-making
Champ in-the-making
Any update on the examples and notes. Could you please point to where I can find them if they are already are?