AnsweredAssumed Answered

Activiti + Camel in OSGi: problem with imported packages

Question asked by ojdiez on Sep 23, 2013
Latest reply on Oct 2, 2013 by frederikheremans1
   first of all, I have to say that you are doing an excellent work :-)

   I have implemented a couple of business processes in Activiti. Those processes use a pair of Camel routes by using the corresponding Camel tasks as described in the user guide. It works pretty fine in the unit tests implemented to validate it.
   I have deployed it in an OSGi container with the following bundle constellation:
     * activiti engine bundle
     * activiti spring bundle
     * activiti camel bundle
     * activiti osgi bundle (implementing the extender which searches for bpmn files and deploys them in the engine)
     * bundle1which instantiates the engine and exports it as an OSGi service. The activiti services (runtime, task, repository, etc.) are exported as well.
     * bundle2 containing the process definitions.

  When this constellation is deployed, the extender finds correctly the process definitions and tries to deploy them. Unfortunately, I get an error during the process as there seems to be some problems with the classloader restrictions in the OSGi environments.
  The error I get is:

Unable to deploy activiti bundle
org.activiti.engine.ActivitiException: Errors while parsing:
Could not find org.activiti.camel.CamelBehavior: org.activiti.camel.impl.CamelBehaviorDefaultImpl not found by org.activiti.engine

It is caused because the activiti-engine bundle has no visibility of the packages exported by the bundle activiti-camel.
As a workaround I have created a bundle defined as a fragment of the activiti-engine bundle that imports the packages exported by activiti-camel (in fact uses Require-Bundle) but this is nothing else than a dirty workaround. I think the elegant solution is that the activiti-engine bundle imports the packages exported by the activiti-camel bundle with the flag for optional requirement.

Can you please consider include this change in the next version? In case you think that this is not a proper solution can you please provide me some hints on why?

  thanks a lot