A
andrewfsears
I'm not sure of the place to post this question, but I'm trying to
create a Domain Specific Language rules file.
For this one, I would like to see if the current date/time is between
two dates, inclusive.
I would like to be able to write in my rules.dslr file:
------------------------------------------------------
package com.abc.test
expander rules.dsl
rule "Between two dates"
when
The current date is between "2007-12-01" and "2007-12-31"
then
Print "is in between"
end
----------------------------------------------------
and rules.dsl:
----------------------------------------------------
[condition][]The current date is between "{startDate}" and
"{endDate}"="{startDate}" <= new Date(); "{endDate}" >= new Date();
[consequence][]Print "{message}"=System.out.println("{message} ");
----------------------------------------------------
Clearly, the "condition" doesn't work. What should I be doing?
Thanks for anyone willing to help me with this, Andy
PS: Also, I tried going off of the documentation for 4.0.3, as well as
the examples that come with Drools, but they don't seem to help me
that much when the rules start getting a little more complicated. Is
there another source that will be more beneficial?
Thanks.
create a Domain Specific Language rules file.
For this one, I would like to see if the current date/time is between
two dates, inclusive.
I would like to be able to write in my rules.dslr file:
------------------------------------------------------
package com.abc.test
expander rules.dsl
rule "Between two dates"
when
The current date is between "2007-12-01" and "2007-12-31"
then
Print "is in between"
end
----------------------------------------------------
and rules.dsl:
----------------------------------------------------
[condition][]The current date is between "{startDate}" and
"{endDate}"="{startDate}" <= new Date(); "{endDate}" >= new Date();
[consequence][]Print "{message}"=System.out.println("{message} ");
----------------------------------------------------
Clearly, the "condition" doesn't work. What should I be doing?
Thanks for anyone willing to help me with this, Andy
PS: Also, I tried going off of the documentation for 4.0.3, as well as
the examples that come with Drools, but they don't seem to help me
that much when the rules start getting a little more complicated. Is
there another source that will be more beneficial?
Thanks.