DLuckham wrote:A rule in a "CEP system or engine" is not required to "have events in it" or to be triggered by events.
It can be, e.g., purely a constraint on the state of a system, or an invariant on the values of some set of variables.
The "CEP approach" can be in some situations the same as any other approach.
If events are irrelevant, then don't use them!
I'll look at you example of the trader some more because maybe the timing and sliding time windows is what is at issue.
.
I agree if events are not relevant, it shouldn't be used. The reason I ask is this seemingly "simple" example is more difficult than one would expect. Looking at how existing production systems and business rule engines handle it, this type of scenario isn't supported by existing rule languages. Normally, ECA and production rules only define the action when the conditions match. They don't define action when modifications occur. In other words, the rule language would need to treat modification logic as first class concept. The general form of an aggregation rule might be
if/then/modify
if
- the transaction ticker is IBM
- the transaction type is "buy"
- the time is between 9:30 AM and 4:00 PM
then
- calculate the average shares per transaction every 15 minutes
modify
- subtract previous share quantity
- add new share quantity
- calculate average
The modify logic would be optional, since some rules may not need it. Behind the scenes, the rule engine or application could compile the business rule into several rules. When I worked on trading systems, we would recalculate the aggregate from the dataset. Other pieces of data could have changed, so we couldn't just subtract, add, divide.
I was hoping those working in the CEP space have come across the same problem and found other techniques that work as well or better. My solution was to design a custom rule language for the business user and write a custom rule compiler to generate the appropriate executable rules. thanks to everyone for their response, it helps get a better understanding.
peter
