Hi,<br><br> I am using agenda groups to pick sets of rules to fire based on an attribute value. The presence or absence of other attributes is dependent on the value of this attribute based on which I select a particular agenda group.<br>
<br>Here is an example<br><br>rule "ABC"<br> when <br> Shape( type = "rectangle" )<br> then <br> drools.setFocus("twodimensional")<br>end<br><br><br>rule "PQR"<br>
when <br>
Shape( type = "cube" )<br>
then <br>
drools.setFocus("threedimensional")<br>
end<br><br>rule "area threshold"<br>agenda-group "twodimensional"<br> when <br> Shape( area > 20 )<br> then <br> System.out.println ("large object" );<br>end<br> <br>rule "volume threshold"<br>
agenda-group "threedimensional"<br>
when <br>
Shape( volume > 20 )<br>
then <br>
System.out.println ("large object" );<br>
end<br>
<br><br>Suppose if my shape object is a rectangle, then it wouldnt have the volume attribute. In this case when we try to run these rules it would throw a NoSuchElementException.<br><br>Is there a way to avoid this? Agenda groups help us fire the RHSs conditionally, Is there a way by which I can conditionally fire LHS of certain sets of rules ?<br>
<br><br>Thanks <br><br><br>Jai <br>