|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.teamserver.model.IlrDefaultSearchCriteria
public class IlrDefaultSearchCriteria
IlrDefaultSearchCriteria
is the default implementation of
IlrSearchCriteria
. It is used to specify the search criteria
passed to the findElements
search methods of an
IlrSession
object.
The simplest possible search criteria instance contains a search string only. For example:
IlrSearchCriteria criteria = new IlrDefaultSearchCriteria( "Find all business rules");More complex search criteria are defined when you call the
IlrDefaultSearchCriteria
constructor. See the
search overview for a list of the
customizable search criteria.
The following code example shows how to create a complex
IlrDefaultSearchCriteria
instance using information from an
existing rule project:
IlrRulePackage parent = null; // Get the EMF package containing the Decision Center classes and data types IlrBrmPackage brm = session.getBrmPackage(); // Get the PARENT PACKAGE attribute EStructuralFeature feature = brm.getRulePackage_Parent(); // Build the search criteria parameter List properties = new ArrayList(); List values = new ArrayList(); properties.add(feature); values.add(parent); String query = new String("Find all business rules such that " + "the last modification date of each " + "business rule is after 10/27/05 2:55:25 PM"); // Set the features, values, query, scope, and search order IlrDefaultSearchCriteria searchCriteria = new IlrDefaultSearchCriteria( brm.getRulePackage(), properties, values, query, IlrModelConstants.SCOPE_PROJECT_AND_DEPENDENCIES, null, false); // Execute the Query List elements = session.findElements(searchCriteria); System.out.println("No of elements is:" + elements.size()); for (int i = 0; i < elements.size(); i++) { IlrElementSummary ruleSummary = (IlrElementSummary) elements.get(i); String ruleName = ruleSummary.getName(); System.out.println("\t" + ruleName); }
IBM Decision Center is a rule management server and repository integrated
into a J2EE application server. It is used for authoring, managing,
validating, and deploying business rules.
Using this API you
connect
to Decision Center and create an IlrSession
instance for a specific
user. You use the API to do the following:
IlrSession.findElements(IlrSearchCriteria, int)
,
IlrSession.findElements(IlrSearchCriteria)
,
IlrModelConstants
,
Serialized Form
Constructor Summary | |
---|---|
IlrDefaultSearchCriteria(org.eclipse.emf.ecore.EClass eclass)
Creates a search criterion that will be used to retrieve the elements of a given class in the current project. |
|
IlrDefaultSearchCriteria(org.eclipse.emf.ecore.EClass eclass,
List features,
List values)
Creates a search criterion that will be used to retrieve specific values from a list of features chosen from elements of a specific class stored in Decision Center. |
|
IlrDefaultSearchCriteria(org.eclipse.emf.ecore.EClass eclass,
List features,
List values,
String query,
int scope,
org.eclipse.emf.ecore.EStructuralFeature orderBy,
boolean ascending)
Creates a fully customizable search criteria. |
|
IlrDefaultSearchCriteria(String query)
Creates a search criterion that gets the elements matching the given query. |
Method Summary | |
---|---|
Object |
clone()
Returns a copy of this search criteria instance. |
org.eclipse.emf.ecore.EClass |
getEClass()
Gets an EMF class of the elements to be searched for. |
List |
getFeatures()
Gets the list of features to be searched for. |
org.eclipse.emf.ecore.EStructuralFeature |
getOrderBy()
Gets the object that will be used to sort the results of a call to IlrSession.findElements with this
IlrSearchCritera instance. |
String |
getQuery()
Gets the Business Query Language query that will be searched with when IlrSession.findElements is called. |
int |
getScope()
Gets the scope of the search: that is, whether calls to IlrSession.findElements with this object will search
in the current project only or in the current project and its dependent
projects. |
List |
getValues()
Gets the list of the values to be searched for. |
boolean |
isAscending()
Specifies whether the results of a call to IlrSession.findElements
with this object will be sorted in ascending or descending order. |
boolean |
isOrderById()
|
String |
toString()
|
void |
unsetOrderById()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IlrDefaultSearchCriteria(org.eclipse.emf.ecore.EClass eclass, List features, List values, String query, int scope, org.eclipse.emf.ecore.EStructuralFeature orderBy, boolean ascending)
eclass
- The EMF class of the searched elements. If
query
is set, this must be a super class of the
query's EMF class. For example, if the query is
"for each action rule such that ..."
, the EMF class
must be brm.ActionRule
, or brm.BusinessRule
.
This parameter can be set to null
if the
query parameter is non-null
.features
- The list of features to search in. Set to
Collections.EMPTY_LIST
if you do not want to
filter the features to be searched in.values
- The list of values to search for. Set to
Collections.EMPTY_LIST
if no value is provided.query
- A query string written in Business Query Language.
For example: "find all business rules such that the name of each
business rule starts with 'loan'"
).scope
- The scope of the search: that is, if the search occurs in the
current project only or includes dependent projects. Use one of the
following values:
orderBy
- The order in which the search results are sorted.ascending
- Set to true
so the search results are sorted
in ascending order.public IlrDefaultSearchCriteria(org.eclipse.emf.ecore.EClass eclass, List features, List values)
Calling this constructor is the equivalent of calling the following:
IlrDefaultSearchCriteria( eclass, features, values, null, IlrModelConstants.DEFAULT_SCOPE, null, true)The default scope is
SCOPE_PROJECT_AND_DEPENDENCIES
.
eclass
- The EMF class of the elements to search for. For example,
set to brm.ActionRule
to search for all the action rules in
this project and its dependencies. This parameter cannot be set to
null
.features
- The list of features to search in. Set to
Collections.EMPTY_LIST
if you do not want to
filter the feature to be searched in.values
- The list of values to search for. Set to
Collections.EMPTY_LIST
if no value is provided.IlrDefaultSearchCriteria(EClass, List, List, String, int, EStructuralFeature, boolean)
public IlrDefaultSearchCriteria(org.eclipse.emf.ecore.EClass eclass)
Calling this constructor is the equivalent of calling the following:
IlrDefaultSearchCriteria( eclass, Collections.EMPTY_LIST, Collections.EMPTY_LIST, null, IlrModelConstants.DEFAULT_SCOPE, null, true)The default scope is
SCOPE_PROJECT_AND_DEPENDENCIES
.
eclass
- The EMF class of the elements to search. For example,
set to brm.ActionRule
to search for all the action rules in
this project and its dependencies. This parameter cannot be set to
null
.IlrDefaultSearchCriteria(EClass, List, List, String, int, EStructuralFeature, boolean)
public IlrDefaultSearchCriteria(String query)
Calling this constructor is the equivalent of calling the following:
IlrDefaultSearchCriteria( null, Collections.EMPTY_LIST, Collections.EMPTY_LIST, query, IlrModelConstants.DEFAULT_SCOPE, null, true);The default scope isSCOPE_PROJECT_AND_DEPENDENCIES
.
query
- A query string written in Business Query Language.
For example: "find all business rules such that the name of each
business rule starts with 'loan'"
).IlrDefaultSearchCriteria(EClass, List, List, String, int, EStructuralFeature, boolean)
Method Detail |
---|
public String getQuery()
IlrSearchCriteria
IlrSession.findElements
is called.
If features and values are set in this object, calls to
IlrSession.findElements
with this object will return the
elements that match the features, values and query in this search
criteria instance.
getQuery
in interface IlrSearchCriteria
null
is returned.IlrSession
,
Custom search example,
IlrDefaultSearchCriteria
public int getScope()
IlrSearchCriteria
IlrSession.findElements
with this object will search
in the current project only or in the current project and its dependent
projects.
getScope
in interface IlrSearchCriteria
IlrSession
,
IlrDefaultSearchCriteria
public List getFeatures()
IlrSearchCriteria
If a Business Query Language query is set in this object, calls to
IlrSession.findElements
with this object will return the
elements that match the features, values and query in this search
criteria instance.
Note: This list of features must have a corresponding list of values.
getFeatures
in interface IlrSearchCriteria
org.eclipse.emf.ecore.EStructuralFeature
objects that will be searched for. If no features were defined,
null
is returned.IlrSearchCriteria.getValues()
,
IlrSession
,
Custom search example,
IlrDefaultSearchCriteria
public List getValues()
IlrSearchCriteria
If a Business Query Language query is set in this object, calls to
IlrSession.findElements
with this object will return the
elements that match the features, values and query in this search
criteria instance.
Note: This list of values must have a corresponding list of features.
getValues
in interface IlrSearchCriteria
org.eclipse.emf.ecore.EStructuralFeature
objects that will be searched for when
IlrSession.findElements
is called. If no values were defined,
null
is returned.IlrSearchCriteria.getFeatures()
,
IlrSession
,
Custom search example,
IlrDefaultSearchCriteria
public org.eclipse.emf.ecore.EStructuralFeature getOrderBy()
IlrSearchCriteria
IlrSession.findElements
with this
IlrSearchCritera
instance.
getOrderBy
in interface IlrSearchCriteria
null
is returned.IlrSession
,
IlrDefaultSearchCriteria
public void unsetOrderById()
public boolean isOrderById()
public boolean isAscending()
IlrSearchCriteria
IlrSession.findElements
with this object will be sorted in ascending or descending order.
isAscending
in interface IlrSearchCriteria
True
If the results of the search will be sorted in
ascending order.IlrSession
,
IlrDefaultSearchCriteria
public org.eclipse.emf.ecore.EClass getEClass()
IlrSearchCriteria
If a query is set, the value returned must be a super class of the query's EMF class. For example, if the query is:
"for each action rule such that ..."
brm.ActionRule
, or
brm.BusinessRule
.
getEClass
in interface IlrSearchCriteria
IlrDefaultSearchCriteria
public Object clone()
IlrSearchCriteria
clone
in interface IlrSearchCriteria
clone
in class Object
public String toString()
toString
in class Object
|
Decision Center API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |