Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Suppose I have 1000 rules in drool and 20 customers. I want to fire those rules which are specific to a customer. It is possible that one rule is applicable for more than on customer. I know which customer is using the application so based on that I want to get list of rules applicable for the customer and list of the facts I need to get from the db to fire those rules. After getting both lists first I'll get the values from db and than fire all the rules for that particular customer.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
573 views
Welcome To Ask or Share your Answers For Others

1 Answer

The best way forward here is to use some smart packaging. Place rules exclusive to a customer in their own package. Different sets of shared rules can be placed in other packages.

You would for example define the kbases as follows:

<?xml version="1.0" encoding="UTF-8"?>
<kmodule
        xmlns="http://jboss.org/kie/6.0.0/kmodule">
    <kbase name="acme" 
           packages="com.dunder.rules.acme, com.dunder.rules.paper">
        <ksession name="acmeSession" type="stateless"/>
    </kbase>
    <kbase name="pipepiper" 
           packages="com.dunder.rules.pipepiper, com.dunder.rules.paper">
        <ksession name="piedpiperSession"type="stateless" />
    </kbase>
</kmodule>

The above would have rules for "Acme" and "Pied Piper" while both using "Paper" rules.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...