<br> Tim, <br><br> It must work. If it is not working, you can provide me a zip with the code you are using and I can check, but it is something really basic to not work.<br><br> Regarding iterating the list and asserting individual objects, there are other options like using "from" to avoid the need of inserting individual objects, but usually it is better to assert the individual objects.
<br><br> I'll not be on-line full time this week, so if you send me the example I will try to look at it as soon as possible, but no promises.<br><br> []s<br> Edson<br><br><div><span class="gmail_quote">2007/8/31,
<a href="mailto:Tim.Nguyen@expeditors.com">Tim.Nguyen@expeditors.com</a> <<a href="mailto:Tim.Nguyen@expeditors.com">Tim.Nguyen@expeditors.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Edson<br><br>The trick is that I have to use the list :(. So I iterate the list, then<br>insert individual Reference object to the Working memory before I check if<br>any dups, but no luck<br><br><br><br><br>Best Regards,
<br>Tim Nguyen<br><br><br><br><br> "Edson Tirelli"<br> <<a href="mailto:tirelli@post.com">tirelli@post.com</a><br> > To
<br> Sent by: "Rules Users List"<br> rules-users-bounc <<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>><br> <a href="mailto:es@lists.jboss.or">
es@lists.jboss.or</a> cc<br> g<br> Subject<br> Re: [rules-users] check dups
<br> 08/31/2007 10:01<br> AM<br><br><br> Please respond to<br> Rules Users List<br> <rules-users@list<br> <a href="http://s.jboss.org">s.jboss.org
</a>><br><br><br><br><br><br><br><br> Tim,<br><br> Your rule expects to get Reference objects from the working memory, and<br>they are not there, since you are adding a List of them and not them.<br>Insert individual references and it will work.
<br><br> []s<br> Edson<br><br>2007/8/31, <a href="mailto:Tim.Nguyen@expeditors.com">Tim.Nguyen@expeditors.com</a> <<a href="mailto:Tim.Nguyen@expeditors.com">Tim.Nguyen@expeditors.com</a>>:<br><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 =<br> ruleBase.newStatefulSession();<br> session.insert(references);<br> session.fireAllRules();<br><br><br><br> Thanks!<br>
Tim<br><br><br><br> "Edson Tirelli"<br> <<a href="mailto:tirelli@post.com">tirelli@post.com</a><br> ><br> To<br> Sent by: "Rules Users List"
<br> rules-users-bounc <<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>><br> <a href="mailto:es@lists.jboss.or">es@lists.jboss.or</a><br> cc<br> g
<br><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> <a href="http://s.jboss.org">s.jboss.org</a> ><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, <a href="mailto:Tim.Nguyen@expeditors.com">Tim.Nguyen@expeditors.com</a> <<a href="mailto:Tim.Nguyen@expeditors.com">Tim.Nguyen@expeditors.com
</a>>:<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
<br> 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> <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><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 @
<a href="http://www.jboss.com">www.jboss.com</a><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><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><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 @ <a href="http://www.jboss.com">www.jboss.com</a><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><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> 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 @
<a href="http://www.jboss.com">www.jboss.com</a>