Also, you can avoid duplicate AcquiredCertification errors and o(n^2) run time by making
all Lists into Sets.
GreG
On Sep 19, 2010, at 15:57, Esteban Aliverti <esteban.aliverti(a)gmail.com> wrote:
You can avoid the eval setting the size restriction inside the list:
List(size == $certifications.size) from collect...
Best,
> El sep 19, 2010 12:29 p.m., "Wolfgang Laun" <wolfgang.laun(a)gmail.com>
escribió:
>
> 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.
>
> rule "meets requirements"
> dialect "mvel"
> when
> Position( $certifications: requiredCertifications )
> User( $name: name, $profile: profile )
> $got: List() from collect ( AcquiredCertification( certification memberOf
$certifications ) from $profile.userCertifications )
> eval($certifications.size == $got.size )
> then
> System.out.println( "Hire " + $name );
> end
>
> -W
>
>
> On 19 September 2010 01:26, lnguyen <mzspdrcr(a)gmail.com> wrote:
> >
> >
> > Hi,
> >
> > I'm trying to determ...
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users