<html><body bgcolor="#FFFFFF"><div>Also, you can avoid duplicate <span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">AcquiredCertification errors and o(n^2) run time by making all Lists into Sets.</span><br><br>GreG</div><div><br>On Sep 19, 2010, at 15:57, Esteban Aliverti <<a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>> wrote:<br><br></div><div><span></span></div><blockquote type="cite"><div><p>You can avoid the eval setting the size restriction inside the list:</p>
<p>List(size == $certifications.size) from collect...</p>
<p>Best,</p>
<p></p><blockquote type="cite">El sep 19, 2010 12:29 p.m., "Wolfgang Laun" <<a href="mailto:wolfgang.laun@gmail.com"><a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a></a>> escribió:<br><br>The idea of the rule given below is to collect a List<AcquiredCertification> from a certain User that's contained in the Position object's list of requiredCertifications, and then to compare the sizes. Equality means that User meets all requirements.<br>
<br>rule "meets requirements"<br>dialect "mvel"<br>when<br> Position( $certifications: requiredCertifications )<br> User( $name: name, $profile: profile )<br> $got: List() from collect ( AcquiredCertification( certification memberOf $certifications ) from $profile.userCertifications )<br>
eval($certifications.size == $got.size )<br>then<br> System.out.println( "Hire " + $name );<br>end<br><font color="#888888"><br>-W</font><p><font color="#500050"><br><br>On 19 September 2010 01:26, lnguyen <<a href="mailto:mzspdrcr@gmail.com"><a href="mailto:mzspdrcr@gmail.com">mzspdrcr@gmail.com</a></a>> wrote:<br>
><br>><br>> Hi,<br>><br>> I'm trying to determ...</font></p><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org"><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank"><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></a><br>
<br></blockquote><p></p>
</div><div><span>_______________________________________________</span><br><span>rules-users mailing list</span><br><span><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></span><br></div></blockquote></body></html>