« Final word on caching with APIs and no APIs | Main | Transactional Object Memory »

September 26, 2005

ObjectGrid very compatible with rules engines like Jess and Able

I saw a presentation today by the CTO of Metatomix. They have a cool product that can be used to analyze multi-event streams and then build rules based systems to analyze those streams in real time. They call it a semantic network. They build what they call an ontology which is an abstract information model built from multiple data sources and then attach rules to the objects visible in this ontology. The rules then generate events as the underlying information is generated/modified. I know I'm over simplifying the scope of the product but this is the basics of it.

A lot of the ideas in it are old ideas, but it's a very clever use of these ideas. But, it had me thinking of how rules engines would integrate with the ObjectGrid. Rules engines might be cool ways of implementing evictor logic for example. Make a rule engine that "selects all Objects outside of the top fifty most valuable transactions in the last ten minutes" for example and evict those.

The ObjectGrid allows applications to attach a log sniffer. The ObjectGridEventListener callback on the ObjectGrid receives an event 'transactionEnd' whenever a transaction is committed. This method receives a Collection object which has all the changes for all the maps modified in the current transaction. This LogSequence can be walked and you'd find LogElement objects which describe the changes. Changes would include insert, update, delete, evicted etc operations on entries in a Map. The Evictor callback receives a similar event which an evictor uses to maintain its state so that it can choose eviction candidates. Both these callbacks can be used to generate an event stream representing changes to objects kept in an ObjectGrid.

This event stream can be easily used to update the working memory of one of these rules engines. The working memory keeps the 'facts' used by the rules engine. Whenever a fact changes then the rules are reexecuted and possible new outcomes, facts or actions are generated by the rules engine. The output of the rules engine could be a list of objects to evict next from the ObjectGrid. When the ObjectGrid physically removes those entries then the callbacks push this to the Evictor which then tells the rules engine the objects were removed which causes the rules engine to calculate the next objects to evict and so on.

Once you start thinking like this, it's easy to come up with some cool uses for these rules engines coupled with the transaction log sniffing provided by the ObjectGrid. Rule engines could be cool ways (once attached to this transaction sniffer or used by an Evictor) to implement continuous queries for applications using an ObjectGrid to store business data. The rules engine receives all changes via an ObjectGridEventListener and then the application can ask the rules engine for the keys for the set of objects currently matching a set of rules.

So, I looked up what JESS can do, metatomix use JESS and then decided I'd better look at ABLE, an IBM rules engine on alphaworks, first given where I work :) So, I'm going to investigate this and publish some samples. I think I can get a lot of useful stuff out of coupling ABLE/JESS to the ObjectGrids transaction sniffer capabilities and I'll post examples over the next few weeks.

September 26, 2005 | Permalink


How about using the rules engine in WASSF/WASprocess server 6 ?

Posted by: jonathan | Sep 27, 2005 6:27:33 PM

Absolutely, you could if thats what suits your scenario. But that supports a subset of whats possible with Able or Jess and requires all of WBISF which neither of the others do. So, if you're not using WBISF then the other may be an easier choice plus they are more flexible.

Posted by: Billy | Sep 29, 2005 3:47:16 PM

ABLE has a different focus than JESS. From what I understand, ABLE is focused on agent scenarios, whereas JESS is not. Although both ABLE and JESS implement Forgy's RETE algorithm, ABLE also implements other algorithms. JESS is primarily RETE with some enhancements taken from LEAPS.

I haven't looked at ABLE's API within the last year, but using ABLE should be similar to using JESS. In the case of JESS, all classes that are dynamic have to support java.beans and implement property change listener.


Posted by: peter lin | Sep 30, 2005 1:50:13 PM

Post a comment