[rules-users] DRL & Year of Date

Edson Tirelli tirelli at post.com
Wed Aug 22 13:42:14 EDT 2007


   In your case, best seems to be to use a return value restriction:

MyClass( $brotherDOB : brotherDOB != null,  yearBorn < (date.yearOfDate($
brotherDOB)-{years}) )

   []s
   Edson

2007/8/22, Saleem Lakhani <Saleem.Lakhani at citizensfla.com>:
>
>  Hi,
>
>
>
> What is the best way of writing such a rule in drools 4.0 without using
> eval ? In the following rule 'date' is a global variable for my own dateUtil
> class and {year} is the variable I will pass.
>
>
>
> brotherDOB != null, $brotherDOB : brotherDOB
>
>
>
> eval(boy.getYearBorn() < (date.yearOfDate($brotherDOB)-{years}))
>
>
>
> Saleem Lakhani
>
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070822/2aaf83b8/attachment.html 


More information about the rules-users mailing list