JBoss Rules (Drools 4.0.3), DSL, and setting values.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top