Skip to main content
replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

How to represent rules for a rule engine as objects?

A rule would be

if (booleanExpression(input)) then a chain of generic actions" else next rule

...where the generic actions might be e.g. passing the input to a different chain of rules, returning a conclusion (terminating analysis with result), or gathering additional data - though probably other actions might prove necessary too.

Now the problem of parsing arbitrary boolean conditions aside (let's assume we have a fully working booleanExpression class available), how would such a Rule object look like, and specifically, how would the Ruleset object containing orderly, interconnected grid of these look like, in particular in a structure that will be possible to process by the actual engine. (if the data structures don't make it obvious how such engine should process them, maybe a hint about it too?)

This will be written in C++ but a language-agnostic answer is most welcome too.


This is derivative of my question about Event CorrelatorEvent Correlator, which seems to be unanswerable simply because it's too broad to tackle in one answer, so I'm trying to split the problem into smaller, bite-sized chunks.

How to represent rules for a rule engine as objects?

A rule would be

if (booleanExpression(input)) then a chain of generic actions" else next rule

...where the generic actions might be e.g. passing the input to a different chain of rules, returning a conclusion (terminating analysis with result), or gathering additional data - though probably other actions might prove necessary too.

Now the problem of parsing arbitrary boolean conditions aside (let's assume we have a fully working booleanExpression class available), how would such a Rule object look like, and specifically, how would the Ruleset object containing orderly, interconnected grid of these look like, in particular in a structure that will be possible to process by the actual engine. (if the data structures don't make it obvious how such engine should process them, maybe a hint about it too?)

This will be written in C++ but a language-agnostic answer is most welcome too.


This is derivative of my question about Event Correlator, which seems to be unanswerable simply because it's too broad to tackle in one answer, so I'm trying to split the problem into smaller, bite-sized chunks.

How to represent rules for a rule engine as objects?

A rule would be

if (booleanExpression(input)) then a chain of generic actions" else next rule

...where the generic actions might be e.g. passing the input to a different chain of rules, returning a conclusion (terminating analysis with result), or gathering additional data - though probably other actions might prove necessary too.

Now the problem of parsing arbitrary boolean conditions aside (let's assume we have a fully working booleanExpression class available), how would such a Rule object look like, and specifically, how would the Ruleset object containing orderly, interconnected grid of these look like, in particular in a structure that will be possible to process by the actual engine. (if the data structures don't make it obvious how such engine should process them, maybe a hint about it too?)

This will be written in C++ but a language-agnostic answer is most welcome too.


This is derivative of my question about Event Correlator, which seems to be unanswerable simply because it's too broad to tackle in one answer, so I'm trying to split the problem into smaller, bite-sized chunks.

Tweeted twitter.com/#!/StackProgrammer/status/287861831488376833
Source Link
SF.
  • 5.2k
  • 2
  • 27
  • 36

Representing a rule in a ruleset

How to represent rules for a rule engine as objects?

A rule would be

if (booleanExpression(input)) then a chain of generic actions" else next rule

...where the generic actions might be e.g. passing the input to a different chain of rules, returning a conclusion (terminating analysis with result), or gathering additional data - though probably other actions might prove necessary too.

Now the problem of parsing arbitrary boolean conditions aside (let's assume we have a fully working booleanExpression class available), how would such a Rule object look like, and specifically, how would the Ruleset object containing orderly, interconnected grid of these look like, in particular in a structure that will be possible to process by the actual engine. (if the data structures don't make it obvious how such engine should process them, maybe a hint about it too?)

This will be written in C++ but a language-agnostic answer is most welcome too.


This is derivative of my question about Event Correlator, which seems to be unanswerable simply because it's too broad to tackle in one answer, so I'm trying to split the problem into smaller, bite-sized chunks.