<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="3">
<div>&nbsp;</div>
<div><font size="2">I'm puzzled over the proper use of in-line evals.&nbsp; I've used them successfully in some places. But it seems that on occasion something doesn't work when I think it should.</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font size="2">First, this is a when clause that works properly using a separate eval statement. The rule activates and fires when expected:</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font face="Courier New" size="2">$rt : RuleTimer(uniqueName == &quot;Hardware Status Request&quot;, timedOut == true)</font></div>
<div><font face="Courier New" size="2">$hw : Hardware($activelyMonitored : activelyMonitored, command == null)</font></div>
<div><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AttrBoolean(this == $activelyMonitored, currentValue == true) </font></div>
<div><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eval($hw.getStatusRequested().howOld() &gt; $hw.getStatusPeriod())</font></div>
<div><font face="Courier New" size="2">&nbsp;</font></div>
<div><font face="Courier New" size="2">&nbsp;</font></div>
<div><font size="2">However, this re-write changing to an in-line eval never fires.</font></div>
<div><font size="2">&nbsp;</font></div>
<div><font face="Courier New" size="2">$rt : RuleTimer(uniqueName == &quot;Hardware Status Request&quot;, timedOut == true)</font></div>
<div><font face="Courier New" size="2">$hw : Hardware($activelyMonitored : activelyMonitored, command == null, eval(statusRequested.howOld() &gt; statusPeriod) )</font></div>
<div><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AttrBoolean(this == $activelyMonitored, currentValue == true)</font></div>
<div><font face="Courier New" size="2">&nbsp;</font></div>
<div><font face="Arial, sans-serif" size="2">Likewise, this re-write doesn't fire either where I sought to bind the more complex statusRequested object to a Drools variable before using it in the eval. The field statusPeriod just holds a primitive double.</font></div>
<div><font face="Arial, sans-serif" size="2">&nbsp;</font></div>
<div><font face="Courier New" size="2">$rt : RuleTimer(uniqueName == &quot;Hardware Status Request&quot;, timedOut == true)</font></div>
<div><font face="Courier New" size="2">$hw : Hardware($activelyMonitored : activelyMonitored, $sr : statusRequested, command == null, </font></div>
<div><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eval($sr.howOld() &gt; statusPeriod) )</font></div>
<div><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AttrBoolean(this == $activelyMonitored, currentValue == true)</font></div>
<div><font face="Courier New" size="2">&nbsp;</font></div>
<div><font face="Arial, sans-serif" size="2">I haven't been able to find anything in the manual that says these other two syntaxes are wrong. Furthermore, the Drools compiler has no issues with them.</font></div>
<div><font face="Arial, sans-serif" size="2">&nbsp;</font></div>
<div><font face="Arial, sans-serif" size="2">Thanks!</font></div>
<div><font face="Arial, sans-serif" size="2">&nbsp;</font></div>
<div><font face="Tahoma, sans-serif" size="2" color="#008080">Allen F. Bagwell</font></div>
<div><font face="Tahoma, sans-serif" size="1" color="#008080">e-mail:&nbsp; afbagwe@sandia.gov</font></div>
<div><font face="Tahoma, sans-serif" size="1" color="#008080">phone:&nbsp; 505/284-4517</font></div>
<div><font face="Tahoma, sans-serif" size="1" color="#008080">fax:&nbsp; 505/ 844-7886</font></div>
<div><font face="Tahoma, sans-serif" size="1" color="#008080">&nbsp;</font></div>
<div style="margin-top: 5pt; margin-bottom: 5pt; "><font face="Tahoma, sans-serif" size="1" color="#008080">Ask your doctor if medical advice from a TV commercial is right for you.</font></div>
<div><font face="Tahoma, sans-serif" size="1">&nbsp;</font></div>
<div><font face="Tahoma, sans-serif" size="1">&nbsp;</font></div>
<div><font size="2">&nbsp;</font></div>
</font>
</body>
</html>