| ILOG JRules User Guide > Creating Rule Projects > Concepts > Business Object Model (BOM) > Domains |
Domains |
PREVIOUS NEXT |
A domain places a restriction on type elements in the BOM and can be set on classes, attribute types, method return types and arguments.
The main domains include:
IlrBOMDomainValueProvider).
By using domains, you can exploit JRules functionality:
You can populate a domain in the BOM dynamically from a data source, and then synchronize the data source and the domain.
If, in the XOM, there is a set of public static final attributes typed to the declaring class, these are automatically considered as an enumeration of static references of the class in the BOM.
If, in the XOM, there are members of array type, these are automatically considered as a collection of the class in the BOM.
A bounded domain specifies an interval between two bounding values, for example, ]0, 120].
A collection domain specifies the cardinality and the type of collection elements, for example, 0,2 class Customer.
If you have members of type java.util.Collection, set a collection domain on these members in order for them to be automatically considered as a collection in business rules. Moreover, you can create add and remove methods for the items in the collection domain using the BOM Editor.
See Collections for more information.
An enumerated domain with values set by the execution of Java code. A dynamic domain is defined through the BOM editor (see Defining a Dynamic Domain).
A domain set as an enumeration of literals specifies a list of values, for example, {1, 2, 3}.
A domain set as an enumeration of static references specifies a list of references to constants, for example, {static GroupA, static GroupB, static GroupC}.
On attribute types and method return types and arguments:
You can define other types of domains using the regular expressions syntax.
For example, you can define a pattern for Strings as follows:
"a*n"
Or you can define an intersection of domains as follows:
({1, 3, 5, 7, 9}, [0,6])
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |