<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I haven't seen it personally, but I can imagine a situation where it would be useful. &nbsp;Say you're reading temperatures, with readings retracted after a given time. &nbsp;If you wanted a rule that meant "find a reading above 10 if there's never been a reading above 20" you'd use the pattern below.<div><br></div><div>Maybe a better example would be alerting aircraft delays at an airport. &nbsp;This wasn't a requirement for the system I worked on, but say you wanted to mark all delays over a given threshold at one level of severity, but bump all delays to another level of severity if one goes over another threshold. (Meaning, "Ger yer house in order now!") That would use this pattern as well:</div><div><br></div><div>when</div><div>&nbsp;&nbsp;d: Delay(duration &gt; 10)</div><div>&nbsp;&nbsp;not Delay(duration &gt;
 20)</div><div>then</div><div>&nbsp;&nbsp;d.setSeverity("meh");</div><div>end</div><div><br></div><div><br></div><div><div>when</div><div>&nbsp;&nbsp;d: Delay(duration &gt; 10)</div><div>&nbsp;&nbsp;Delay(duration &gt;= 20)</div><div>then</div><div>&nbsp;&nbsp;d.setSeverity("DOH!");</div><div>end</div><br>--- On <b>Thu, 3/24/11, Wolfgang Laun <i>&lt;wolfgang.laun@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Wolfgang Laun &lt;wolfgang.laun@gmail.com&gt;<br>Subject: [rules-dev] An odd couple of patterns<br>To: "Rules Dev List" &lt;rules-dev@lists.jboss.org&gt;<br>Date: Thursday, March 24, 2011, 12:07 PM<br><br><div id="yiv1361774169">Has anybody ever seen a situation where a couple of patterns such as<br><br>&nbsp;&nbsp; Fact( field &gt;= 10 )<br>&nbsp;&nbsp; not Fact( field &gt; 20 )<br><br>was appropriate? This does not match Facts where field isn't between 10
 and 20, and so it would seem to be the same as<br>

<br>&nbsp;&nbsp; Fact( field &gt;= 10 &amp;&amp; &lt;= 20 )<br><br>but actually it doesn't match any such Fact whenever any <i>other</i> Fact with field &gt; 20 is around.<br><br>Cheers<br>Wolfgang<br>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>rules-dev mailing list<br><a ymailto="mailto:rules-dev@lists.jboss.org" href="/mc/compose?to=rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br></div></blockquote></div></td></tr></table><br>