Why Hierarchical Event Processing Rocks
Many event processing tools and engines contains some kind of processing element which takes events as input and produces events as output.
Currently* there seems to be to two concepts which are popular among the CEP tool vendors. There’s the SQL based approach, and the rule based approach. Both normally share the powerful mechanism of taking events as input and producing events as output.
The processing elements, SQL queries or rules, can as a result of this easily be organized in hierarchies. Organizing things in hierarchies is certainly nothing new. But I would like to show how powerful hierarchies are when applied within event processing.
I’m a bit surprised that there have not been more talk about hierarchical event processing in the CEP community. It’s a concept which is worth explaining in detail to CEP users.
Recently we have created a geofencing application using ruleCore, or rather the new geospatial ruleCore. It’s intended for fleet management, mobile asset management, telematics and all kind of location based solutions which need a quick alert capability to immediately get notification about unexpected vehicle behaviour.
We used rules organized in a hierarchy to implement all the geofence logic:

This hierarchy of rules allowed us rapidly to create the initial types of geofences found in the requirements list. It gives us a nice structure which can easily be extended when we add new types of geofences, like the off-route (Alert when a vehicle is not following its designated route) geofence we added recently.
It also allows us to add new rules in a modular fashion to monitor a specific property of a geofence. For example, there are rules which monitor some of the geofences and create alerts they are not triggered during a specified period. Great for arrival and departure alerts.
At the bottom level we feed the rule hierarchy with the GPS positions. The Level 1 rules trigger when the vehicle is within a zone. Level 2 in turn has rules which trigger when a vehicle is considered to entered a zone, which is not the same as being inside the zone.
In this way the events go from simple low level position update events to rather high level events at the upper level.
So for your next (or first) event processing project, spend some time in the design process and try to see if your rules are naturally hierarchical. If organized in this way you have a flexible and powerful abstraction which also tends to be easy to understand and explain to new crew members.
Most of the time the levels can also be give descriptive names as each level tends to handle rules at a certain abstraction level. For example, monitoring a web site and its infrastructure could use rules on four levels:
- Level 0 - Network
- Level 1 - Servers
- Level 3 - Services
- Level 4 - Tasks
- Level 5 - Business Processes
and so on.
Each level can emit alert events to the outside world in addition to the level above. This would allow for example the network manager to only listen to events from level 0 in the above example.
* The current set of vendors would obviously want you to believe that the current tools are mature and there are nothing new coming just around the corner, that is: buy now, don’t wait. But the event processing market is a very young one. The concepts are new. We are lightyear away for anything called mainstream and don’t even think of finding standards. In the years to come I’m sure there will be new and interesting concepts (which will not carry the legacy of SQL or rules) and implementations created for specially for event processing. The current tools are inspired by existing research and uses extensions to the SQL concept and the concept of rules. If we were to start over with a clean sheet I’m sure there would be more exiting tools than the current generation.




