[rules-users] How to use KnowledgeBase

FrankVhh frank.vanhoenshoven at agserv.eu
Thu Apr 14 03:13:50 EDT 2011


Hi,

In theory, you can do it both ways. Depending on your situation, you will
have to assess which approach will be the best solution.

Regarding the fact that creation of a kbase takes some time, you will
probably want to avoid doing it multiple times per transaction or, at least,
cache them. Also, when your rules are part of a continupus flow, you
probably want only 1 kbase.

In your situation, mortgages, I assume your rules are following eachother
with no or very little interaction from the user. In that case, I think one
would normally use 1 knowledgebase.

Theoretically, multiple knowledgebases should be used when dealing with
completely different rulesets, with one ruleset not influencing the other
(or execution of ruleset one happening in a totally different timeframe as
to justify the use of another kbase).

I hope this makes it clear.

Regards,
Frank


ismaximum wrote:
> 
> Hi
> 
> I am new to Drools and just want to start developing our app with Drools.
> I have some questions regarding KnowledgeBase instantiation. 
> 
> Can we create a single instance of KB across the application and use it to
> create any stateful or stateless session? 
> In this case, do we need to add all the rules available in our application
> or we need to create one instance for each set of rules? In other words,
> consider we have many rules including mortgage calculation/ validation,
> auditing process, interest rate calculation and many others, do we need to
> create one instance of KB for each rule or just one KB and add all the
> rules to it?
> 


--
View this message in context: http://drools.46999.n3.nabble.com/How-to-use-KnowledgeBase-tp2819308p2819374.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list