<div>Can it be the typo in</div> <div>referenceType == $referenceType</div> <div>where $referenceType should be $type1</div> <div><BR><BR><B><I>Tim.Nguyen@expeditors.com</I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR><BR>Here is my test<BR><BR>Reference ref_test2 = new Reference();<BR>ref_test2.setReferenceType(new ReferenceType("MISC"));<BR>ref_test2.setReferenceValue("111222");<BR><BR>Reference ref_test3 = new Reference();<BR>ref_test3.setReferenceType(new ReferenceType("MISC"));<BR>ref_test3.setReferenceValue("111222");<BR><BR>references.add(ref_test2);<BR>references.add(ref_test2);<BR><BR><BR><BR>final StatefulSession session = ruleBase.newStatefulSession();<BR>session.insert(references);<BR>session.fireAllRules();<BR><BR><BR><BR>Thanks!<BR>Tim<BR><BR><BR><BR>"Edson Tirelli" <BR><TIRELLI@POST.COM <br>> To <BR>Sent by: "Rules Users List" <BR>rules-users-bounc
<RULES-USERS@LISTS.JBOSS.ORG><BR>es@lists.jboss.or cc <BR>g <BR>Subject <BR>Re: [rules-users] check dups <BR>08/31/2007 08:57 <BR>AM <BR><BR><BR>Please respond to <BR>Rules Users List <BR><RULES-USERS@LIST <br>s.jboss.org> <BR><BR><BR><BR><BR><BR><BR><BR>Hey Tim,<BR><BR>Can you please provide a self contained test case? There is no reason<BR>why it would not work.<BR><BR>Thanks<BR>Edson<BR><BR>2007/8/31, Tim.Nguyen@expeditors.com <TIM.NGUYEN@EXPEDITORS.COM>:<BR><BR><BR>Hi List,<BR><BR>I'd like to check if any duplicate exists in my collection as below:<BR><BR>rule "check Duplicate"<BR>when<BR>ref1: Reference ($type1: referenceType, $value1:<BR>referenceValue)<BR>ref2: Reference (this != ref1, referenceType ==<BR>$referenceType,<BR>referenceValue == $value1)<BR><BR>then<BR>errorHandler.record("Duplicate Reference is not allowed.");<BR>end<BR><BR><BR>Both my referenceType and referenceValue are String. I didn't get any<BR>error<BR>but it didn't work. Any idea?<BR>I am
using 4.01 GA<BR><BR><BR>Thanks,<BR>Tim<BR><BR>_______________________________________________<BR>rules-users mailing list<BR>rules-users@lists.jboss.org<BR>https://lists.jboss.org/mailman/listinfo/rules-users<BR><BR><BR><BR>--<BR>Edson Tirelli<BR>Software Engineer - JBoss Rules Core Developer<BR>Office: +55 11 3529-6000<BR>Mobile: +55 11 9287-5646<BR>JBoss, a division of Red Hat @ www.jboss.com<BR>_______________________________________________<BR>rules-users mailing list<BR>rules-users@lists.jboss.org<BR>https://lists.jboss.org/mailman/listinfo/rules-users<BR><BR><BR>_______________________________________________<BR>rules-users mailing list<BR>rules-users@lists.jboss.org<BR>https://lists.jboss.org/mailman/listinfo/rules-users<BR></BLOCKQUOTE><BR><p> 
<hr size=1>Shape Yahoo! in your own image.
<a href="http://us.rd.yahoo.com/evt=48517/*http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7">Join our Network Research Panel today!</a>