|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface QueryNode
This interface represents part of a query based on properties. There are two types of objects
in the business rule management API that have properties: business rule groups and business
rules. QueryNodes
can be combined into a tree to specify a query based on
properties. This query will be scoped to either business rule groups or business rules
depending on the method that is used to process the query.
There are several types of query nodes:
Property1 = 'isEligible'
.
To perform a query, the user builds up a tree of QueryNode
objects that
represent the query to be performed. This tree is then passed to method
getBRGsByProperties
on class
BusinessRuleManager
. This method will search for business
rule groups installed on the server that match the query specified in the given
QueryNode
and its sub-nodes. Subclasses of the QueryNode
interface
are provided to perform queries on individual properties associated with the business rule
groups as well as to logically combine (AND, OR, NOT) individual property queries. There is
a factory class, QueryNodeFactory
, that can be
used to create query nodes.
Here are some examples. To find all business rule groups where the value of property "Property1" is "ValueA", do the following:
// Find business rule groups where the value of property "Property1" is "ValueA". PropertyQueryNode propertyNode = QueryNodeFactory.createPropertyQueryNode("Property1", QueryOperator.EQUAL, "ValueA"); List<BusinessRuleGroup> result = BusinessRuleManager.getBRGsByProperties(propertyNode, 0, 0);To find all business rule groups where the value of property "Department" is "Marketing" and the value of property "Region" is "Midwest", do the following:
// Find business rule groups where the value of property "Department" is "Marketing" and // the value of property "Region" is "Midwest". PropertyQueryNode leftNode = QueryNodeFactory.createPropertyQueryNode("Department", QueryOperator.EQUAL, "Marketing"); PropertyQueryNode rightNode = QueryNodeFactory.createPropertyQueryNode("Region", QueryOperator.EQUAL, "Midwest"); AndNode rootNode = QueryNodeFactory.createAndNode(leftNode, rightNode); List<BusinessRuleGroup> result = BusinessRuleManager.getBRGsByProperties(rootNode, 0, 0);To find all business rule groups where the value of property "Department" is like "%Engineering%" or the value of property "Region" is not "Midwest", do the following:
// Find business rule groups where the value of property "Department" is like // "%Engineering%" or the value of property "Region" is not "Midwest". PropertyQueryNode leftNode = QueryNodeFactory.createPropertyQueryNode("Department", QueryOperator.LIKE, "%Engineering%"); PropertyQueryNode rightNode = QueryNodeFactory.createPropertyQueryNode("Region", QueryOperator.NOT_EQUAL, "Midwest"); OrNode rootNode = QueryNodeFactory.createOrNode(leftNode, rightNode); List<BusinessRuleGroup> result = BusinessRuleManager.getBRGsByProperties(rootNode, 0, 0);
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT
|
Field Detail |
---|
static final java.lang.String COPYRIGHT
|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |