OpenClovis Logo

API Usage Examples
Rule Based Engine (RBE)

Code Examples. More...

Code Examples.

The RBE is used to filter or select a subset of objects from a group. For example, group object implements "filtered walk" using RBE which is used by EM to select qualified subscribers to an event based on the event data. Similarly IOC provides received message filtering using RBE.

Following are some examples on how to use the RBE functions. Let's say that we have a message header - an array of bytes and the RBE is used to look for a perticular pattern - viz message from a perticular destination address and a perticular tag.

{
clRuleExprMaskSet(expr,0,0xFFFFFFFF);
clRuleExprMaskSet(expr,2,0xFFFF0000);
clRuleExprValueSet(expr,0,0xABCDABCD);
clRuleExprValueSet(expr,2,0xDEAD0000);
Rbe expression, user data, data length = 2 32 bit units
if( clRuleExprEvaluate(expr, &msgHdr, 2) )
{
We have received a msg with ABCDABCD as the fist 4 bytes and
DEAD as the next two bytes.
}
}

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen