cancel
Showing results for 
Search instead for 
Did you mean: 

Integrate activiti-explorer with mule for mule task to work

wrobelda
Champ in-the-making
Champ in-the-making
Hi.

We are facing the need to integrate Activiti Explorer with Mule ESB in a way that Activiti's Mule Task could to be used in a BPMN process definition to communicate via mule's VM. It wouldn't be a problem at all if Mule Task supported remote Mule instances but, as the manual says, it's currently only possible to use Mule Task when running Activiti embedded inside Mule instance.

And here's the thing, as we also want to be able to use Activiti Explorer at the same time, not only the Activiti Process engine.

After a brief analysis I came up with two possibilities:
1) To integrate mule into activiti-explorer (by leveraging Spring possibilities) and then embedding activiti inside mule (per mule-config.xml).
2) To integrate both mule and activiti-explorer into Tomcat.

Just to be clear, even though I am pretty new to Spring/Tomcat environments, I already have doubts about if any of these would work at all. For example how would Sprint/Tomcat  handle multiple attempts to register activiti process engine and if it was possible to make it register only single (common) one. As far as I understand, there would be at least single one registered by explorer and one per each mule project.
I am also wondering whether multiple instances are of any problem at all and if it's only important to have all of them reference same DB?

Please, correct me if I am wrong or suggest any other way it could be done.
Any help will be appreciated.
4 REPLIES 4

trademak
Star Contributor
Star Contributor
Hi,

Actually the Mule module also supports the remote Mule instances.
So you can choose if you want to embed the Mule Engine in the Activiti instance or run it separately.

Best regards,

wrobelda
Champ in-the-making
Champ in-the-making
Hi,

How exactly is this possible? You actually explained here that with remote mule instances it is only possible to invoke flows via web services, which we find a bit of an overkill and we'd rather prefer to use VM/JMS directly.

trademak
Star Contributor
Star Contributor
Hi,

If you want to use VM, of course embedded is your only option.
And JMS would also have been possible for the Mule remote invocation, but it's implemented via web services.

Best regards,

wrobelda
Champ in-the-making
Champ in-the-making
We tried a different solution and implemented a simple CDI class that listens for BusinessProcessEvents and send JMS message each time one fires. This may not be very BPMN-ish since it is not explicitly reflected within process definition that there is a message message being sent, but OTOH it also saves us a lot of time on configuring serviceTask each time message is needed to be sent.

While everything seems to work as intended, I am yet again facing explorer/spring integration issue: I have no idea how to configure the Activiti Explorer's processEngine to leverage both Spring and CDI. It seems impossible without creating custom processEngine, as Spring requires org.activiti.spring one and CDI requires one of org.activiti.cdi ones.

Any ideas?

EDIT:
I have tried to copy activiti-cdi with deps into activiti-explorer\WEB-INF\lib and simply replacing
"<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">" with "<bean id="processEngineConfiguration" class="org.activiti.cdi.CdiStandaloneProcessEngineConfiguration">" in activiti-explorer\WEB-INF\applicationContext.xml , but that fails with following Error while loading demo.start:
org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionManager' of bean class [org.activiti.cdi.CdiStandaloneProcessEngineConfiguration]": Bean property 'transactionManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
I assume this may be related to "LocalProcessEngineLookup" class that must be loaded by beans.xml, however placing the file in usual places (activiti-explorer\META-INF, activiti-explorer\WEB-INF) makes no difference whatsoever.