Soon (whatever that means to a software developer…) we are releasing a new feature set for ruleCore.
Note – I said feature set, not a new version.
One of the things about delivering software as a service (SaaS) [or use your favorite term for this] is that we should not bother our users with things like versions and upgrades. Versions, patches, upgrades, hardware sizing and all that are a thing of the past. It’s sooo 2005.
If you are to deliver software as a service, sorry I mean as a Cloud (these things change names faster than I can type), then I think you should go all the way and do only services and nothing else. I’m starting to realize that Cloud software (if it is still called Cloud) must be designed differently from ordinary Box software. So it’s best to do either one and not mix them.
Anyway. To my point. In the new feature set we are introducing a new format for events. It’s something I’d like to get comments on.
Previously you did something like:
Event
Header
Fixed stuff
Body
Any valid XML
It’s the any valid XML part which is modified. So now you have:
Event
Header
Fixed stuff
Body
Property A: 'value 1'
Property B: 'value 2'
...
The change might not look so big, but the implications of it are.
Instead of seeing the event body as a block of XML we now see it as a collection of named properties. The properties can be any valid XML but must be mapped to a property name.
The old approach is to write an XPath which gets us an anonymous value. This value is directly used in rule evaluation.
The new approach uses the properties in rule evaluation. The value of the property is found in the same old way with an XPath.The difference is that the XPath is defined in the event definition. So for each even definition we have a number of XPaths which are used to find the values of some named property.
Another interesting feature is that ruleCore knows how to derive a property from another one. So if you say something like "vehicle SameColor color", where vehicle and color are properties, ruleCore knows how to go from the vehicle property to the color property. Which means that you can apply different relations to vehicles and ruleCore knows how to look up the appropriate property. For example:
- Entity SameSize Entity
- Entity InFrontOf Entity
- Entity Inside Entity
Here the relation SameSize would need to find the Weight property of both entities and the InFrontOf entity would need to find the Location property. The Inside relation would need to find the location and bounding box of the entities in order to figure out if the left hand entity is inside the right one.
This makes things a little more complicated to set up, but much more flexible and powerful.
The point is that the properties are not just names. They have well defined semantics. Semantics that ruleCore knows a lot of, and can do a lot of interesting stuff with.
For example:
Let’s say that a property tells us that this is an event with a new location of a truck.
RuleCore would know the actual semantics of a real-world trucks and can based on that information assume a lot of things. For example we can make assumptions of maximum speed and we know that trucks can physically move faster than that speed.
So if we see a truck position in London at noon we know it’s an error to see it in Barcelona one hour later.
Weaving in semantics in this way opens up a lot of interesting ways to create rules. If we know that one event is from a tractor and the other one is from the trailer we can use the relation coupled to understand if the tractor and trailer is attached to each other. Or rather, should be attached to each other. If they are, the we can assume that they should for example travel in the same direction with just a couple of meters from each other. If they are not, someone just stole the trailer.
These properties can also be used to create a very rich context in which to evaluate the situation detection.
We could for example have an event view (that’s what we call the context) which contains only
"location update events from heavy vehicles currently northbound on route E20 which have not stopped for the last hour"
As some other of the new features are that ruleCore knows how to read a map it actually knows which vehicles are on a certain road. Neat if you ask me.
So what I’m currently thinking of if this new functionality, and the extra work involved in defining rules, are worth the effort. What do you think? Does this make any sense to you?
Being from Scandinavia, I like simple and elegant things. This adds some complexity but might actually make things more elegant if we manage to get it right…
Complex Event Processing
Recent Comments