<!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.2873" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2>Thanks Steve,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2>Is <FONT face="Courier New">contains</FONT> in 3.0.5 - I
can't find reference to it in the bundled documentation?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2>Also, do you know whether <FONT face="Courier New">Object's
equals()</FONT> and <FONT face="Courier New">Object's hashCode()</FONT> are used
for normal equality conditions:-</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face="Courier New"
color=#0000ff size=2>when</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT
face="Courier New"> <FONT color=#0000ff size=2>h :
house()</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT
face="Courier New"> <FONT color=#0000ff size=2>p : person (
residence == ( h ) )</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face="Courier New"
color=#0000ff size=2>...</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2>Do you also know how the greater than and less than
operators are implemented (can we provide a comparator
instance)?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face="Courier New"
color=#0000ff size=2>when</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT
face="Courier New"> <FONT color=#0000ff size=2>r :
rank()</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT
face="Courier New"> <FONT color=#0000ff size=2>p : person
(rank >= ( r ) )</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face="Courier New"
color=#0000ff size=2>...</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2>(If this is even possible!?!? - I haven't got this far
yet).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2>Thanks in advance.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007><FONT face=Arial
color=#0000ff size=2>Mike</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=661263810-24012007></SPAN><SPAN
class=661263810-24012007><FONT face=Arial color=#0000ff
size=2></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>Steven
Williams<BR><B>Sent:</B> 23 January 2007 23:00<BR><B>To:</B> Rules Users
List<BR><B>Subject:</B> Re: [rules-users] Rules to detect states in an object
graph?!?<BR></FONT><BR></DIV>
<DIV></DIV>Hi Michael,<BR><BR>To do the opposite approach (where the
relationship is navigable from the parent only) you can use the
following:<BR><BR>when<BR> <FONT
face="Courier New" size=2>c</FONT><FONT face="Courier New" size=2> :</FONT>
<FONT face="Courier New" size=2>Child</FONT> <FONT face="Courier New"
size=2>(</FONT> <FONT face="Courier New" size=2>age > 18</FONT> <FONT
face="Courier New" size=2>)</FONT>
<BR> <FONT face="Courier New"
size=2>Parent</FONT> <FONT face="Courier New" size=2>(</FONT> children
contains c<FONT face="Courier New" size=2>, type == "SMURF" )</FONT>
<BR><BR>Of course this requires either <BR>
<UL>
<LI>the child object in the children collection to be the same as the
asserted child object or <BR>
<LI>the equals/hashcode method to be implemented appropriately in Child
<BR></LI></UL>cheers<BR>Steve<BR><BR>
<DIV><SPAN class=gmail_quote>On 1/24/07, <B class=gmail_sendername>Anstis,
Michael (M.)</B> <<A
href="mailto:manstis1@ford.com">manstis1@ford.com</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<P><FONT face=Arial size=2>Sorry, me again,</FONT> </P>
<P><FONT face=Arial size=2>I'm putting together some prototype rules that
operate on related objects in a graph of objects.</FONT> </P>
<P><FONT face=Arial size=2>I'm adding all objects individually to working
memory and then checking the objects are related in the rule to ensure only
valid combinations are selected; for example:-</FONT></P>
<P><FONT face="Courier New" size=2>//Java code</FONT> <BR><FONT
face="Courier New" size=2>parent.addChild(child)</FONT> <BR><FONT
face="Courier New" size=2>wm.assertObject(parent);</FONT> <BR><FONT
face="Courier New" size=2>wm.assertObject(child);</FONT> </P>
<P><FONT face="Courier New" size=2>//Rule</FONT> <BR><FONT
face="Courier New" size=2>rule "</FONT><FONT face="Courier New" size=2>Adult
smurfs</FONT><FONT face="Courier New" size=2>"</FONT> <BR><FONT
face="Courier New" size=2>when</FONT>
<BR> <FONT face="Courier New"
size=2>c</FONT><FONT face="Courier New" size=2> :</FONT> <FONT
face="Courier New" size=2>Child</FONT> <FONT face="Courier New"
size=2>(</FONT> <FONT face="Courier New" size=2>age > 18, p :
parent</FONT> <FONT face="Courier New" size=2>)</FONT>
<BR> <FONT face="Courier New"
size=2>Parent</FONT> <FONT face="Courier New" size=2>(</FONT> <FONT
face="Courier New" size=2>parentId == ( p.parentId</FONT><FONT
face="Courier New" size=2> )</FONT><FONT face="Courier New" size=2> , type
== "SMURF" )</FONT> <BR><FONT face="Courier New" size=2>then</FONT>
<BR> <FONT face="Courier New"
size=2>System.out.println("Smurf " + p.getName() + " is " + c.getAge() + "
years old."</FONT> <BR><FONT face="Courier New" size=2>end</FONT> </P>
<P><FONT face="Courier New" size=2>rule "</FONT><FONT face="Courier New"
size=2>Adult clangers</FONT><FONT face="Courier New" size=2>"</FONT>
<BR><FONT face="Courier New" size=2>when</FONT>
<BR> <FONT face="Courier New"
size=2>c</FONT><FONT face="Courier New" size=2> :</FONT> <FONT
face="Courier New" size=2>Child</FONT> <FONT face="Courier New"
size=2>(</FONT> <FONT face="Courier New" size=2>age > 18, p :
parent</FONT> <FONT face="Courier New" size=2>)</FONT>
<BR> <FONT face="Courier New"
size=2>Parent</FONT> <FONT face="Courier New" size=2>(</FONT> <FONT
face="Courier New" size=2>parentId == ( p.parentId</FONT><FONT
face="Courier New" size=2> )</FONT><FONT face="Courier New" size=2> , type
== "CLANGER" )</FONT> <BR><FONT face="Courier New" size=2>then</FONT>
<BR> <FONT face="Courier New"
size=2>System.out.println("Clanger " + p.getName() + " is " + c.getAge() + "
years old."</FONT> <BR><FONT face="Courier New" size=2>end</FONT> </P>
<P><FONT face=Arial size=2>This requires that the parent-child relationship
is navigable from the child end of the relationship --</FONT> <FONT
face="Courier New" size=2>child.getParent()</FONT><FONT face=Arial size=2>
.</FONT></P>
<P><FONT face=Arial size=2>What other approaches does anyone else use to
implement rules that span related objects?</FONT> </P>
<P><FONT face=Arial color=#000000 size=2>With kind regards,</FONT> </P>
<P><FONT face="Goudy Old Style" color=#808080 size=4>Michael
Anstis</FONT><BR><FONT face=Arial color=#808080
size=2>-------------------------------------------</FONT><BR><B></B><B><FONT
face=Arial color=#000080>Next Generation Estimating System</FONT></B>
<BR><FONT face=Wingdings color=#808080 size=2>(</FONT><FONT face=Arial
color=#808080 size=2> Trafford House (Int) 8 718 2239 </FONT><BR><FONT
face=Wingdings color=#808080 size=2>(</FONT><FONT face=Arial color=#808080
size=2> Trafford House (Ext) +44 (0)1268 702239</FONT> <BR><FONT
face=Wingdings color=#808080 size=2>*</FONT><FONT face=Arial color=#808080
size=2></FONT> <FONT face=Tahoma color=#808080 size=2><</FONT><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:manstis1@ford.com" target=_blank> <U></U><U><FONT face=Tahoma
color=#0000ff size=2>mailto:manstis1@ford.com</FONT></U></A><FONT
face=Tahoma color=#808080 size=2>></FONT>
</P></DIV><BR>_______________________________________________<BR>rules-users
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A><BR><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target=_blank>https://lists.jboss.org/mailman/listinfo/rules-users</A><BR><BR><BR></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>Steven Williams<BR><BR>Supervising
Consultant<BR><BR>Object Consulting<BR>Office: 8615 4500 Mob: 0439 898 668
Fax: 8615 4501 <BR><A
href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</A><BR><A
href="http://www.objectconsulting.com.au">www.objectconsulting.com.au</A><BR><BR>consulting
| development | training | support <BR>our experience makes the difference
</BLOCKQUOTE></BODY></HTML>