IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Business rule management programming > Examples > Additional Query Examples

Query business rule groups by multiple properties combined with nested OR operators and a NOT node

This is an example of a query business rule groups by multiple properties combined with nested OR operators and a NOT node.

// NOT(Prop OR Prop) OR Prop
QueryNode rightNode =
QueryNodeFactory.createPropertyQueryNode("region", 		QueryOperator.LIKE, 		"%lRegion");

QueryNode rightNode2 =
QueryNodeFactory.createPropertyQueryNode(
		"organization", 		QueryOperator.LIKE, 		"7%");

QueryNode leftNode =
QueryNodeFactory.createPropertyQueryNode(
		"department", 		QueryOperator.LIKE, 		"%ing");

OrNode orNodeRight =
QueryNodeFactory.createOrNode(rightNode2,rightNode);

NotNode notNode =
QueryNodeFactory.createNotNode(orNodeRight);

OrNode orNodeLeft =
QueryNodeFactory.createOrNode(notNode,leftNode);

brgList =
BusinessRuleManager.getBRGsByProperties(orNodeLeft, 0, 0);

// Returns BRG2 and BRG4

Additional Query Examples