[rules-users] Sharing common rules between KieSession

Péter Gergely, Horváth h.peter at mailbox.hu
Tue Jun 3 07:53:35 EDT 2014


Hi All,

We develop a software used by multiple companies. A small part of the rules
is slightly different for every single company. We would like to package
all of the rules into the application, so the code should - based on
environment information - decide, which ones to load (using
KieClasspathContainer).

        KieServices kieServices = KieServices.Factory.get();
        KieContainer kContainer = kieServices.getKieClasspathContainer();
        KieSession kSession = kContainer.newKieSession("foo-company");

Since ~90% of the rules is the same, I'm wondering what the best approach
could be in this situation: duplicating common rules in every KieSession
package seems to be a very bad idea.

Say I define a set of general rules in* rules.common* package and rules
specific to company Foo (*rules.foo*) and Bar (*rules.bar*), is there any
way to load and merge the two into a single KieSession? Could I somehow
say, "please give me the rules from rules.common and rules.foo"?

I know that I could use the low level APIs to load rule files individually,
but that is something I would like to avoid. Is there any better solution
for this?

Thanks,
Peter









Is there any way to load multiple KieSessions and combine them into one?



For example, if there are companies Foo and Bar, could I

For the application should
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20140603/2f9bb9f6/attachment.html 


More information about the rules-users mailing list