Saturday, November 24, 2007

Is there a non-event event ? on absence as a pattern


Recently, there were some discussions, related to the glossary, about the term "non-event event" , this seems to be a funny notion that seems to contain self contradiction, similar to "soapless soap" I don't think that this term is very good - I prefer to call it
"absent event" .
Now the questions - how is it really defined ? and is it really an event?
As for the first question: an absent event is a CEP pattern that is defined within a context. Taking some examples:
  • There have no been any major financial transaction during the working day for the customer John Galt.
  • The Pizza order has been received, but the delivery did not arrive within 40 minutes.

In these two examples we are looking for - things that did not happen within a certain context; the first example is the context of - "John Galt's financial activities within a single working day", the event that did not happen - "major financial transaction" is by itself a pattern that need to be defined and detected (say - a transaction with financial value of more than $10,000). The absence is on all time stamps that belong to the context - so the formal definition of the absence pattern of event e in context C is defined as : For context C, for all time-stamp t that belongs to the temporal extension of context C, event e does not occur in time-stamp t.

Let's check this definition in the Pizza order - the context here is a certain order, and its temporal extension starts when the Pizza order is confirmed, and expires after 40 minutes (which is the public commitment of the take-away Pizza shop for Pizza delivery).
This is also an example of the use of context as a major abstraction that gets the thinking about event processing closer to the way people think.
Now - the question whether the detection of an absent pattern is an event --- the answer is - a pattern detection by itself is not an event (although it may be an event from the point of view of the internal management system of the EP platform), however, it may create a derived event, which has some structure - for example - the derived event that is created in the wake of the lack of Pizza delivery consists of : date, time, pizza store id, value of order - this event may be enriched with summary of past late deliveries from the same store, and then notify or orchestrate something.

2 comments:

woolfel said...

The non event event sounds similar to negated patterns in business rules. In Jrules, Drools and most modern rule engines, it's expressed by "not".

I don't know if this is a real case, but I was just thinking. What if I a case like this.

if the stock price drops by 1/2, then alert traders

if price drop alert was sent and no action has been taken within 60 minutes, prevent all transactions for the stock

I'm sure there are plenty of scenarios where negated pattern is useful.

Ismail Ari said...

In short, absence of an event is defined by the occurance of another event, either a timeout or arrival/occurance of an event that breaks the expected sequence. e.g. in event sequence (A,B,C) B's absence could be detected by the occurance of C or a timeout.

To follow up on woolfel's comment: As I understand, (in practice) Negation in business rules is used as a mechanism to implement the "else" part of an "if", where the original, non-negated version of the rules constitutes the if. This trick (as well as the rule priorities) are rather hacks on the Rete network to increase determinism of the outcome (again that's my perspective).