[rules-users] Date arithmetic in when part

Wolfgang Laun wolfgang.laun at gmail.com
Fri Jul 1 01:21:31 EDT 2011


2011/6/30 <rouvas at mm.di.uoa.gr>

> What are the available symbolics for temporal values?
> That is, d is for days, m is for minutes, h is for hours, s is for seconds.
> Are there any other symbolics specifically for months and years?
>

You can use ms for millisecond. There are no universally acceptable duration
values for monts and years .
-W


>
> I haven't found any mentioning of them in the Fusion manual.
> I'm using 5.0.1
>
> Thank you,
> -Stathis
>
> Wolfgang Laun wrote:
> > 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.
> >
> >     $p1: Person( $dob1: dob )
> >     $p2: Person( $dob2: dob after[3d] $dob1 )
> >
> > -W
> >
> >
> > On 28 June 2011 18:02, <rouvas at mm.di.uoa.gr> wrote:
> >
> >> 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
> >>
> >>
> >> _______________________________________________
> >> 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/20110701/13957bad/attachment.html 


More information about the rules-users mailing list