Hi guys,<br><br>I'm looking to do the following and I was wondering how to use Date objects in Drools. This is what I currently have:<br><br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5C1081199%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0in;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;
        mso-header-margin:.5in;
        mso-footer-margin:.5in;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";">rule "Difference
between end and start time is less than a very small (threshold) value."</span></p>
<p class="MsoNormal" style=""><u><span style="font-size: 10pt; font-family: "Courier New"; color: black;">salience</span></u><span style="font-size: 10pt; font-family: "Courier New";"> 100</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";">when</span></p>
<p class="MsoNormal"><u><span style="font-size: 10pt; font-family: "Courier New"; color: black;">obs</span></u><span style="font-size: 10pt; font-family: "Courier New";">:
ObsClass((endTime - startTime) < someVerySmallValue)</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";">then<span style=""> </span></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";"><span style=""> </span>System.out.<u><span style="color: black;">println</span></u>("Difference
between end and start time is less than a very small (threshold) value.");</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";">End</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";"> </span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";">rule "Check if user
defined time frame falls between startTime and endTime variables"</span></p>
<p class="MsoNormal" style=""><u><span style="font-size: 10pt; font-family: "Courier New"; color: black;">salience</span></u><span style="font-size: 10pt; font-family: "Courier New";"> 100</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";">when</span></p>
<p class="MsoNormal" style=""><u><span style="font-size: 10pt; font-family: "Courier New"; color: black;">obs</span></u><span style="font-size: 10pt; font-family: "Courier New";">: ObsClass((endTime -
userDefinedTime) > 0 && (userDefinedTime - startTime) > 0)</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";">then<span style=""> </span></span></p>
<p class="MsoNormal" style=""><span style=""> </span>System.out.println(<span style="font-size: 10pt; font-family: "Courier New";">"Check if user defined
time frame falls between startTime and endTime variables")</span></p>
<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: "Courier New";">end</span></p>
<br>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.<br>
<br>Thanks in advance,<br>Armaghan<br>