There&#39;s two issues to consider.<br><br>First, the selection of a group of rules files. The usefulness of restricting the<br>set of rules for a session depends on the way the RBS is going to be used, such as: Does a user just deal with sports cars (and never with trucks)? Only such a use case would merit a restriction.<br>
<br>Now, with all the rules being in the session, the other issue is how to match the appropriate rule for a fact of type SportsCar. IMHO, this is best achieved by creating the fact as an object of the appropriate subclass and by writing the rules against these class names, e.g.<br>
<br>rule FastLane SportsCar( hp &gt; 300,... ) then...<br>rule Convoy Truck( tons &gt; 20,... ) then ...<br><br>I find this more readable than using the class property of any Object. Drools lets you write rules using interfaces, too. Assuming that several (but not all) vehicle types might be leased:<br>
<br>rule Leasing LeasingStatus( rateOverdue == true,... )<br><br>HTH<br>-W<br><br><div class="gmail_quote">On Wed, Nov 4, 2009 at 6:53 PM, D Brock <span dir="ltr">&lt;<a href="mailto:David_Brock@mentor.com">David_Brock@mentor.com</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;"><br>
I need my end user to be able to specify a set of hierchical rules. As a<br>
contrived example, conceptually  we would define rule files called<br>
&quot;Common.drl&quot;, &quot;Truck.,drl&quot;, &quot;Car.drl&quot;, &quot;4-wheel drive.drl&quot;,<br>
&quot;Sports-Car.drl&quot;.<br>
<br>
&quot;4-wheel drive.drl&quot; should include rules from &quot;Truck.drl&quot;, which in turn<br>
should rules from &quot;Common.drl&quot;.<br>
&quot;Sports-Car.drl&quot; should include rules from &quot;Car.drl&quot;, which in turn should<br>
rules from &quot;Common.drl&quot;.<br>
<br>
Now when a Vehicle object is inserted into memory, based on &quot;class&quot; property<br>
= &quot;4-wheel drive&quot; it would execute against the rules of &quot;4-wheel drive.drl&quot;<br>
and all of it&#39;s hierarchically included rules.<br>
<br>
Similarly when a Vehicle object is inserted into memory, based on &quot;class&quot;<br>
property = &quot;Sports-Car&quot; it would execute against the rules of<br>
&quot;Sports-Car.drl&quot; and all of it&#39;s hierarchically included rules.<br>
<br>
Is this possible, and if so how would it be best implemented?  It seems like<br>
there should be an &quot;include&quot; keyword in the DRL language that would include<br>
contents from another DRL file.  But even with this there would be the issue<br>
if selected which rules should be used.<br>
<br>
Would appreciate any help you can give....Thanks<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://old.nabble.com/Hierarchical-rules-and-rules-selection-tp26201268p26201268.html" target="_blank">http://old.nabble.com/Hierarchical-rules-and-rules-selection-tp26201268p26201268.html</a><br>

Sent from the drools - user mailing list archive at Nabble.com.<br>
<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>