[rules-users] Date arithmetic in when part

rouvas at mm.di.uoa.gr rouvas at mm.di.uoa.gr
Tue Jun 28 12:02:16 EDT 2011


Hi list,

I feel this should be an elementary question but unfortunately I haven't
been able to find a solution.

I would like to perform date arithmetic in the when part of a rule.

For example, I would like to express something like:

rule "Date compare rule"
  dialect "mvel"
when
  a : A()
  b : B( a.creationDate <= b.creationDate after 3 months)
then
 ...
end

Apart from using eval()'s is there any other way to express these types of
comparisons?

Thank you for your time,
-Stathis





More information about the rules-users mailing list