[rules-users] Deploy Rules in separate OSGi bundles

Ephemeris Lappis ephemeris.lappis at gmail.com
Tue May 13 14:24:14 EDT 2014


Hello.

I'll send you a project as described when our first tests work with a 
single bundle, which is not the case today. Indeed, we're experiencing 
problems, like many seem to have experienced before, to package and 
install drools on ServiceMix.

We're testing first a simple bundle owning its local kmodule.xml and its 
drl files, but this doesn't work. I have had a look to you example 
projects, and some of them indeed seem to do what we need, using the 
osgi integration.

The project itself only depends on two libraries (Kie API and Drools 
compiler), but when we've tried to install them, we've discovered all 
the transitive dependancies that we must take into account to add the 
OSGi integration module that is supposed to handle classloader troubles.

We are trying to build a Karaf Feature of the 6.0.1 Final version for 
our Karaf environment, producing a KAR file with maven, but many 
dependant JAR's manifests mention Import-Package entries that do not 
appear in the maven graph and we've spent 2 days looking one by one to 
resolve deployment failures and/or conflicts.

Have you any advice about building a (minimalist) Karaf feature for 
Drools 6.0.1 ?
I've seen an available feature for a more recent version of Karaf, but 
our ServiceMix 4.5.3 doesn't expose the needed dependancies.

I've also see posts about a new KieClasspathContainer constuction method 
passing a classloader, but this method, if I'm not wrong only appears on 
version 6.1.0 Beta3.

Is there any reason to use this beta instead of the last final version ?

Thanks for you help.

Regards.

Ephemeris Lappis

Le 13/05/2014 15:46, Charles Moulliard a écrit :
> Can you share your code as I have created such kind of project (bundle 
> A  = KieContainer  and bundle B = rules) which is working on Karaf ?
>
> https://github.com/cmoulliard/droolsjbpm-osgi-examples (bundle with 
> Kie = kie-project-bundle 
> <https://github.com/cmoulliard/droolsjbpm-osgi-examples/tree/master/kie-project-bundle> and 
> bundle with bundle with rules = simple-kie-bundle 
> <https://github.com/cmoulliard/droolsjbpm-osgi-examples/tree/master/simple-kie-bundle>) 
>
>
>
> On Tue, May 13, 2014 at 9:39 AM, Ephemeris Lappis 
> <ephemeris.lappis at gmail.com <mailto:ephemeris.lappis at gmail.com>> wrote:
>
>     Hello.
>
>     I'd like to separate cleanly my Drools system into 2 OSGi bundles :
>
>     1) the java code that uses the Kie API (6.0.1) and exposes service
>     interfaces to the business part of the applications. Its code
>     relies on
>     someting like :
>
>     KieServices kieServices = KieServices.Factory.get();
>     kieContainer = kieServices.getKieClasspathContainer();
>     KieSession kieSession = kieContainer.newKieSession(name);
>
>     2) the rules themselves, just including the kmodule.xml that
>     manages the
>     ksessions and the drl files in their own packages.
>
>     Let say the first module is S and second is R, while the
>     applcation is A.
>
>     This build model works nice in my eclipse with correct maven
>     dependancies
>     set from A to both S and R. Classes in the application A calls the
>     service
>     from the S. The kieContainer has resolved as expected the kmodule and
>     associated the rules files for the given packages, and the
>     application can
>     get the ksession for a given name.
>
>     I'm afraid that the same code won't run as nice as it does when
>     deployed on
>     my Karaf (Service MIX) OSGi environment. I suspect that the
>     KieContainer may
>     encounter some troubles to detect the kmodule.xml in the META-INF
>     and the
>     DRL files out of another jar.
>
>     Is there anyone with such experiences ?
>     Any advice to do it ?
>
>     Thanks in advance.
>     Regards.
>
>
>
>     --
>     View this message in context:
>     http://drools.46999.n3.nabble.com/Deploy-Rules-in-separate-OSGi-bundles-tp4029541.html
>     Sent from the Drools: User forum mailing list archive at Nabble.com.
>     _______________________________________________
>     rules-users mailing list
>     rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> -- 
> Charles Moulliard
> Apache Committer / Architect @RedHat
> Twitter : @cmoulliard | Blog : http://cmoulliard.github.io 
> <http://cmoulliard.github.io>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20140513/c142f549/attachment.html 


More information about the rules-users mailing list