<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=503581509-06022008><FONT face=Arial 
color=#0000ff size=2>Facts are simply POJO's so you can only achieve in a rule 
that you could in Java.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=503581509-06022008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=503581509-06022008><FONT face=Arial 
color=#0000ff size=2>I assume (given the presumably simplified example below) 
that you have a super class Shape and subclasses Rectangle and Cube that extend 
Shape.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=503581509-06022008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=503581509-06022008><FONT face=Arial 
color=#0000ff size=2>Therefore I think your separate "twodimensional" and 
"threedimensional" rules should reference the subclasses and not the super class 
(as a call to Shape.getVolume() would fail in Java).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=503581509-06022008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=503581509-06022008><FONT face=Arial 
color=#0000ff size=2>I don't think Drools performs subclass conversion on LHS 
patterns!?!?!</FONT></SPAN></DIV><BR>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org 
  [mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>Jai 
  Vasanth<BR><B>Sent:</B> 06 February 2008 00:14<BR><B>To:</B> Rules Users 
  List<BR><B>Subject:</B> [rules-users] missing parameters in the fact 
  object<BR></FONT><BR></DIV>
  <DIV></DIV>Hi,<BR><BR>&nbsp; I am using agenda groups to&nbsp; pick sets of 
  rules to fire based on an attribute value. The presence or absence of other 
  attributes&nbsp; is dependent on the value of this attribute based on which I 
  select&nbsp; a particular agenda group.<BR><BR>Here is an example<BR><BR>rule 
  "ABC"<BR>&nbsp; when&nbsp; <BR>&nbsp;&nbsp;&nbsp; Shape( type = "rectangle" 
  )<BR>&nbsp; then <BR>&nbsp;&nbsp;&nbsp; 
  drools.setFocus("twodimensional")<BR>end<BR><BR><BR>rule "PQR"<BR>&nbsp; 
  when&nbsp; <BR>&nbsp;&nbsp;&nbsp; Shape( type = "cube" )<BR>&nbsp; then 
  <BR>&nbsp;&nbsp;&nbsp; drools.setFocus("threedimensional")<BR>end<BR><BR>rule 
  "area threshold"<BR>agenda-group "twodimensional"<BR>&nbsp; when&nbsp; 
  <BR>&nbsp;&nbsp;&nbsp; Shape( area &gt; 20 )<BR>&nbsp; then&nbsp; 
  <BR>&nbsp;&nbsp;&nbsp; System.out.println ("large object" 
  );<BR>end<BR>&nbsp;<BR>rule "volume threshold"<BR>agenda-group 
  "threedimensional"<BR>&nbsp; when&nbsp; <BR>&nbsp;&nbsp;&nbsp; Shape( volume 
  &gt; 20 )<BR>&nbsp; then&nbsp; <BR>&nbsp;&nbsp;&nbsp; System.out.println 
  ("large object" );<BR>end<BR>&nbsp; <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&nbsp; 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></BLOCKQUOTE></BODY></HTML>