[rules-users] LHS compare two lists

Esteban Aliverti esteban.aliverti at gmail.com
Sun Sep 19 16:57:29 EDT 2010


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 at 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 at gmail.com> wrote:
>
>
> Hi,
>
> I'm trying to determ...

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100919/3afea974/attachment.html 


More information about the rules-users mailing list