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 AND operators and a NOT node
This is an example of a query business rule groups by multiple properties combined with nested AND operators and a NOT node.
// Prop AND (Prop AND (Prop AND NOT Prop)) QueryNode rightNode = QueryNodeFactory.createPropertyQueryNode("organization", QueryOperator.LIKE, "7%"); QueryNode rightNode2 = QueryNodeFactory.createPropertyQueryNode("region", QueryOperator.LIKE, "%lRegion"); NotNode notNode = QueryNodeFactory.createNotNode(rightNode2); QueryNode leftNode2 = QueryNodeFactory.createPropertyQueryNode("department", QueryOperator.LIKE, "%ing"); AndNode andNodeRight = QueryNodeFactory.createAndNode(leftNode2,notNode); AndNode andNodeLeft = QueryNodeFactory.createAndNode(rightNode,andNodeRight); QueryNode leftNode = QueryNodeFactory.createPropertyQueryNode("ID_cert45", QueryOperator.LIKE, "AB_"); AndNode andNode = QueryNodeFactory.createAndNode(leftNode, andNodeLeft); brgList = BusinessRuleManager.getBRGsByProperties(andNode, 0, 0); // Returns BRG2