A generic C++ rule engine comparing 2 String Maps
I want to check if there are any components out there that can get me a
basic rule engine. The engine should be able to take in a Rule string
which will be basic logical rule which will return either TRUE or FALSE.
It should take in an string map for inputs and string map for comparison
purposes.
Example1 :
I want to check if the Object is of type "Apple"
The text rule would say "OBJECT_TYPE=="FRUIT" & FRUIT_TYPE=="Apple""
If Input is MAP1 ==> { (OBJECT_TYPE->FRUIT),(FRUIT_TYPE->Apple) }
MAP2 ==> NULL
Output should be TRUE
If Input is MAP1 ==> { (OBJECT_TYPE->FRUIT),(FRUIT_TYPE->Orange) }
MAP2 ==> NULL
Output should be FALSE
Example2 :
I want to check if the Object is of type "Apple" and group with size
The text rule would say "OBJECT_TYPE=="FRUIT" & FRUIT_TYPE=="Apple""
If Input is MAP1 ==> { (OBJECT_TYPE->FRUIT),(FRUIT_TYPE->Apple),
(SIZE->BIG) }
MAP2 ==> {(SIZE==BIG)}
Output should be TRUE
If Input is MAP1 ==> { (OBJECT_TYPE->FRUIT),(FRUIT_TYPE->Apple),
(SIZE->SMALL) }
MAP2 ==> {(SIZE==BIG)}
Output should be FALSE
The idea is to compare 2 maps according to a logical rule and return TRUE
or FALSE. It should also support arithmetic logic like weight > 50 in
rules and so the same check with the input map. The output of the system
can be something like TRUE, FALSE, INPUT MAP Not fully populated, Error in
Rule etc.
Does anyone know if some Opensource already provides this type of a
functionality? 3)
No comments:
Post a Comment