See the "Fusion" manual, section on Temporal Reasoning/Temporal Operators. Even when the facts aren't events, these operators can still be applied to fields of type Date, e.g.<br><br> $p1: Person( $dob1: dob )<br>
$p2: Person( $dob2: dob after[3d] $dob1 )<br><br>-W<br><br><br><div class="gmail_quote">On 28 June 2011 18:02, <span dir="ltr"><<a href="mailto:rouvas@mm.di.uoa.gr" target="_blank">rouvas@mm.di.uoa.gr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi list,<br>
<br>
I feel this should be an elementary question but unfortunately I haven't<br>
been able to find a solution.<br>
<br>
I would like to perform date arithmetic in the when part of a rule.<br>
<br>
For example, I would like to express something like:<br>
<br>
rule "Date compare rule"<br>
dialect "mvel"<br>
when<br>
a : A()<br>
b : B( a.creationDate <= b.creationDate after 3 months)<br>
then<br>
...<br>
end<br>
<br>
Apart from using eval()'s is there any other way to express these types of<br>
comparisons?<br>
<br>
Thank you for your time,<br>
-Stathis<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>