Decision Center API

ilog.rules.teamserver.model
Interface IlrSearchCriteria

All Known Implementing Classes:
IlrDefaultSearchCriteria

public interface IlrSearchCriteria

IlrSearchCriteria is the base interface for all classes that specify search criteria to pass to the IlrSession findElements search methods.

Overview

Using IlrSearchCriteria you can view the properties set in a search criteria instance. These properties include the following:

The default IlrSearchCriteria implementation is
IlrDefaultSearchCriteria. To create more advance functionality, you need to make your own customized implementation of this class.

Code example

The following code example shows how to connect to Decision Center and run a query on the server from a client Java application:

   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");
   IlrSearchCriteria criteria = new IlrDefaultSearchCriteria(
           query.toString());
   List summaries = session.findElements(
           criteria,
           IlrModelConstants.ELEMENT_SUMMARY);

   for (int i = 0; i < summaries.size(); i++) {
           IlrElementSummary ruleSummary = (IlrElementSummary) summaries.get(i);
           String ruleName = ruleSummary.getName();
           System.out.println("\t" + ruleName);
   }
 

See Also:
IlrDefaultSearchCriteria, IlrSession.findElements(IlrSearchCriteria, int), IlrSession.findElements(IlrSearchCriteria), IlrModelConstants, IlrSessionHelper, IlrSessionFactory, IlrSessionController, IlrExtractorValidator

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.
 

Method Detail

getEClass

org.eclipse.emf.ecore.EClass getEClass()
Gets an EMF class of the elements to be searched for.

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 ..."

the EMF class must be brm.ActionRule, or brm.BusinessRule.

Returns:
An EMF class.
See Also:
Overview, IlrDefaultSearchCriteria

getScope

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.

Returns:
One of the following:
See Also:
Overview, IlrSession, IlrDefaultSearchCriteria

getFeatures

List getFeatures()
Gets the list of features to be searched for.

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.

Returns:
The list of org.eclipse.emf.ecore.EStructuralFeature objects that will be searched for. If no features were defined, null is returned.
See Also:
Overview, getValues(), IlrSession, Custom search example, IlrDefaultSearchCriteria

getValues

List getValues()
Gets the list of the values to be searched for.

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.

Returns:
The list of org.eclipse.emf.ecore.EStructuralFeature objects that will be searched for when IlrSession.findElements is called. If no values were defined, null is returned.
See Also:
Overview, getFeatures(), IlrSession, Custom search example, IlrDefaultSearchCriteria

getQuery

String getQuery()
Gets the Business Query Language query that will be searched with when 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.

Returns:
A text query. If no query was defined in this object, null is returned.
See Also:
Overview, IlrSession, Custom search example, IlrDefaultSearchCriteria

getOrderBy

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.

Returns:
An EMF feature. If no sort was defined in this object, null is returned.
See Also:
Overview, IlrSession, IlrDefaultSearchCriteria

isAscending

boolean isAscending()
Specifies whether the results of a call to IlrSession.findElements with this object will be sorted in ascending or descending order.

Returns:
True If the results of the search will be sorted in ascending order.
See Also:
Overview, Custom search example, IlrSession, IlrDefaultSearchCriteria

clone

Object clone()
Returns a copy of this search criteria instance.

Returns:
A copy of this search criteria instance.
See Also:
Overview

Decision Center API

© Copyright IBM Corp. 1987, 2013