<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR><!-- converted from rtf -->
<STYLE>.EmailQuote {
        PADDING-LEFT: 4pt; MARGIN-LEFT: 1pt; BORDER-LEFT: #800000 2px solid
}
</STYLE>
</HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=528130716-05062008><FONT face=Arial 
color=#0000ff size=2>It should not be an issue to have an object inserted 
representing the current time and have rules checking against the 
object</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org 
[mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>Bagwell, Allen 
F<BR><B>Sent:</B> 05 June 2008 17:34<BR><B>To:</B> Rules Users 
List<BR><B>Subject:</B> [rules-users] Question about timing 
rules<BR></FONT><BR></DIV>
<DIV></DIV><FONT face="Arial, sans-serif" size=3>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>Another noob question:</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Is there a generally understood way of implementing the 
concept of a time interval rule?</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>That is, lets say I have a Drools-enabled client which is 
constantly receiving information from outside resources. Most of this data (and 
the consequences of its changes) is time sensitive, so I'm calling the 
fireAllRules() method in a loop every minute.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>And now, let's say I have a rule that in addition to being 
driven by incoming data changes has to be linked to a repeating clock interval 
or synched with wall time such that the rule only activates and fires if the 
data meets certain parameters AND it's been exactly 1 hour since the last check 
or that it will fire at the top of every wall time hour (1 PM, 2PM, 3 PM, 
etc.).</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Furthermore, timing may change. A successful rule activation 
and firing might do something like "now change this timing so that for the next 
24 hours, this rule must be examined every 30 minutes instead of every hour". 
</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>My initial reading of the Drools documetation I came across 
the Duration, and Date-* keywords. Their descriptions didn't seem to fit the 
bill.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>I ask this because our old rules engine software that has been 
retired to obsolescence allowed this kind of thing to be easily set up. Coming 
at it in the Drools world seems a lot more challenging.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Thoughts? Examples?</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>-Allen</FONT></DIV>
<DIV style="MARGIN-TOP: 5pt; MARGIN-BOTTOM: 5pt"><FONT 
size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV></FONT></BODY></HTML>