<html><body bgcolor="#FFFFFF"><div>Also, you can avoid duplicate&nbsp;<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 &lt;<a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>&gt; 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" &lt;<a href="mailto:wolfgang.laun@gmail.com"><a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a></a>&gt; escribió:<br><br>The idea of the rule given below is to collect a List&lt;AcquiredCertification&gt; 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>&nbsp;&nbsp;&nbsp; Position( $certifications: requiredCertifications )<br>&nbsp;&nbsp;&nbsp; User( $name: name, $profile: profile )<br>&nbsp;&nbsp;&nbsp; $got: List() from collect (&nbsp; AcquiredCertification( certification memberOf $certifications ) from $profile.userCertifications )<br>

&nbsp;&nbsp;&nbsp; eval($certifications.size == $got.size&nbsp; )<br>then<br>&nbsp;&nbsp;&nbsp; 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 &lt;<a href="mailto:mzspdrcr@gmail.com"><a href="mailto:mzspdrcr@gmail.com">mzspdrcr@gmail.com</a></a>&gt; wrote:<br>
&gt;<br>&gt;<br>&gt; Hi,<br>&gt;<br>&gt; 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>