Re: [rules-users] Date arithmetic in when part

2011-07-01 Thread Mark Proctor
The times attempt to be ISO8601 compliant, for Hours and earlier. Although I noticed that tidbit of information is missing for the docs, we'll get it added. See TimeUtils private static final Pattern SIMPLE = Pattern.compile(

Re: [rules-users] Date arithmetic in when part

2011-07-01 Thread rouvas
Wolfgang Laun wrote: 2011/6/30 rou...@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? Thanks for the clarification. You can use

Re: [rules-users] Date arithmetic in when part

2011-06-30 Thread lhorton
Thanks! I converted over to these and my tests are all passing so far. Examples (snippets): // one day old when $step : Step(status == Status.ACTIVE, task.job.statuteOfLimitationsDate != null) Date($now : time) from Calendar.getInstance().getTime() Date($solDate : time

Re: [rules-users] Date arithmetic in when part

2011-06-30 Thread rouvas
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? I haven't found any mentioning of them in the Fusion manual. I'm using 5.0.1 Thank you, -Stathis

Re: [rules-users] Date arithmetic in when part

2011-06-30 Thread Wolfgang Laun
2011/6/30 rou...@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

Re: [rules-users] Date arithmetic in when part

2011-06-29 Thread Wolfgang Laun
Currently (5.2.0, but not = 5.1.1) you can do: rule future when Date( $t: time ) from new Date() $p: Person( $dob: dob after[0] $t ) then System.out.println( $p.getName() + not born yet. ); end There are indeed some restrictions w.r.t. the use of temporal operators but comparing

Re: [rules-users] Date arithmetic in when part

2011-06-28 Thread Wolfgang Laun
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,

Re: [rules-users] Date arithmetic in when part

2011-06-28 Thread lhorton
Interesting. I tried to use this syntax to find out if a date is older than now using this source: $p2: Person( $dob2: dob before[3d] new Date() ) but I get and exception: org.drools.RuntimeDroolsException: The 'before' operator can only be used to compare one event to another, and never to

Re: [rules-users] Date arithmetic in when part

2011-06-28 Thread rouvas
Thanks for the quick reply. I forgot to mention that I'm using 5.0.1, but I'll look at the Fusion manual for more info. -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