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