[rules-users] Date questions

Armaghan Mahmud mahmud.armaghan at gmail.com
Thu May 28 01:27:15 EDT 2009


Hi guys,

I'm looking to do the following and I was wondering how to use Date objects
in Drools. This is what I currently have:

rule "Difference between end and start time is less than a very small
(threshold) value."

*salience* 100

when

*obs*: ObsClass((endTime - startTime) < someVerySmallValue)

then

    System.out.*println*("Difference between end and start time is less than
a very small (threshold) value.");

End



rule "Check if user defined time frame falls between startTime and endTime
variables"

*salience* 100

when

*obs*: ObsClass((endTime - userDefinedTime) > 0 && (userDefinedTime -
startTime) > 0)

then

       System.out.println("Check if user defined time frame falls between
startTime and endTime variables")

end

The problem I'm having with dates is in comparing them. The mathematical
portion of the rules above kind of explain what I want to do but I doubt
I'll be able to achieve my goals. Any help would be greatly appreciated.

Thanks in advance,
Armaghan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090528/6bd0e56f/attachment.html 


More information about the rules-users mailing list