Hi Max,<br><br>Also, consider serializing individual Knowledge Packages containing logically related rules. You may combine them to create several knowledge bases and serialize them, or create them during application startup.<br>
<br>Once you have a knowledge base, any number of sessions can be started. Make sure to call dispose() to free (stateful) session resources.<br><br>-W<br><br><br><div class="gmail_quote">On 14 April 2011 09:13, FrankVhh <span dir="ltr">&lt;<a href="mailto:frank.vanhoenshoven@agserv.eu">frank.vanhoenshoven@agserv.eu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
In theory, you can do it both ways. Depending on your situation, you will<br>
have to assess which approach will be the best solution.<br>
<br>
Regarding the fact that creation of a kbase takes some time, you will<br>
probably want to avoid doing it multiple times per transaction or, at least,<br>
cache them. Also, when your rules are part of a continupus flow, you<br>
probably want only 1 kbase.<br>
<br>
In your situation, mortgages, I assume your rules are following eachother<br>
with no or very little interaction from the user. In that case, I think one<br>
would normally use 1 knowledgebase.<br>
<br>
Theoretically, multiple knowledgebases should be used when dealing with<br>
completely different rulesets, with one ruleset not influencing the other<br>
(or execution of ruleset one happening in a totally different timeframe as<br>
to justify the use of another kbase).<br>
<br>
I hope this makes it clear.<br>
<br>
Regards,<br>
Frank<br>
<br>
<br>
ismaximum wrote:<br>
&gt;<br>
&gt; Hi<br>
&gt;<br>
&gt; I am new to Drools and just want to start developing our app with Drools.<br>
&gt; I have some questions regarding KnowledgeBase instantiation.<br>
&gt;<br>
&gt; Can we create a single instance of KB across the application and use it to<br>
&gt; create any stateful or stateless session?<br>
&gt; In this case, do we need to add all the rules available in our application<br>
&gt; or we need to create one instance for each set of rules? In other words,<br>
&gt; consider we have many rules including mortgage calculation/ validation,<br>
&gt; auditing process, interest rate calculation and many others, do we need to<br>
&gt; create one instance of KB for each rule or just one KB and add all the<br>
&gt; rules to it?<br>
&gt;<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-to-use-KnowledgeBase-tp2819308p2819374.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-use-KnowledgeBase-tp2819308p2819374.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>