<br>&nbsp;&nbsp;&nbsp; Brian,<br><br>&nbsp;&nbsp;&nbsp; Maybe you have equals() method implemented in the class? &quot;==&quot; will call equals() method on the objects...<br>&nbsp;&nbsp;&nbsp; I assume you are using 4.0.1 or later (snapshot).<br><br>&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson
<br><br><div><span class="gmail_quote">2007/9/25, Brian Enderle &lt;<a href="mailto:brianke@gmail.com">brianke@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have 3 Rfrnc objects that I would like to compare and return a message if<br>the firstNm, middleNm and lastNm of two objects match.&nbsp;&nbsp;I set up the Rfrnc<br>objects with the names &quot;Brian A Enderle&quot;, &quot;Brian B Enderle&quot; and &quot;Brian C
<br>Enderle&quot; and created the following rule (with the intent of building up to<br>checking first, middle and last name).<br><br>rule &quot;LevelTwo: Duplicate Reference check&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;LevelTwo&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$i : Rfrnc($firstNm : firstNm, $middleNm : middleNm, $lastNm :<br>lastNm)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$j : Rfrnc(this != $i, firstNm == $firstNm)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println
(&quot;Duplicate refernce found: &quot; +<br>$i.getMiddleNm() + $i.getLastNm() + &quot;:&quot; + $j.getMiddleNm() + $j.getLastNm());<br>end<br><br>This produces the following output (which is what I would expect):<br>Duplicate refernce found: CEnderle:BEnderle
<br>Duplicate refernce found: BEnderle:CEnderle<br>Duplicate refernce found: CEnderle:AEnderle<br>Duplicate refernce found: AEnderle:CEnderle<br>Duplicate refernce found: AEnderle:BEnderle<br>Duplicate refernce found: BEnderle:AEnderle
<br><br>While doing some testing I changed &quot;Brian B Enderle&quot; to &quot;Brian A Enderle&quot; so<br>that now I have two Rfrnc objects with the name of &quot;Brian A Enderle&quot;.&nbsp;&nbsp;When I<br>rerun the same rule from above I get the following output:
<br><br>Duplicate refernce found: CEnderle:AEnderle<br>Duplicate refernce found: AEnderle:CEnderle<br>Duplicate refernce found: AEnderle:CEnderle<br>Duplicate refernce found: CEnderle:AEnderle<br><br>What I don&#39;t understand is why do I not have any return statements
<br>of &quot;Duplicate reference found AEnderle:AEnderle&quot;.&nbsp;&nbsp;I would expect 2 of these<br>messages, one for when the first &quot;Brian A Enderle&quot; object is compared to the<br>second and vice versa.<br><br>Is the &quot;$i == this&quot; condition checking values within the object itself?&nbsp;&nbsp;Am I
<br>missing something here as to how this rule should work?<br><br>Thanks in advance,<br>Brian Enderle<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli
<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>