[rules-dev] An odd couple of patterns

Greg Barton greg_barton at yahoo.com
Thu Mar 24 13:47:13 EDT 2011


I haven't seen it personally, but I can imagine a situation where it would be useful.  Say you're reading temperatures, with readings retracted after a given time.  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.
Maybe a better example would be alerting aircraft delays at an airport.  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:
when  d: Delay(duration > 10)  not Delay(duration > 20)then  d.setSeverity("meh");end

when  d: Delay(duration > 10)  Delay(duration >= 20)then  d.setSeverity("DOH!");end
--- On Thu, 3/24/11, Wolfgang Laun <wolfgang.laun at gmail.com> wrote:

From: Wolfgang Laun <wolfgang.laun at gmail.com>
Subject: [rules-dev] An odd couple of patterns
To: "Rules Dev List" <rules-dev at lists.jboss.org>
Date: Thursday, March 24, 2011, 12:07 PM

Has anybody ever seen a situation where a couple of patterns such as

   Fact( field >= 10 )
   not Fact( field > 20 )

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



   Fact( field >= 10 && <= 20 )

but actually it doesn't match any such Fact whenever any other Fact with field > 20 is around.

Cheers
Wolfgang


-----Inline Attachment Follows-----

_______________________________________________
rules-dev mailing list
rules-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110324/a8af9a75/attachment.html 


More information about the rules-dev mailing list