ILOG JRules User Guide > Creating Rule Projects > Concepts > Business Object Model (BOM) > Domains

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:

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.

Bounded

A bounded domain specifies an interval between two bounding values, for example, ]0, 120].

Collection

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.

Dynamic

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

Literals

A domain set as an enumeration of literals specifies a list of values, for example, {1, 2, 3}.

Static References

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:

Other

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])

Related Concepts

Business Object Model (BOM)
Collections
Business Elements Originating from a Java XOM
Static Rule Analysis

Related Tasks

Defining Domains
Creating New Business Elements
Working With BOM Entries

Related Reference

BOM Editor

Related Samples and Tutorials

Tutorial: Defining a Vocabulary
How to Populate a BOM Domain from a Data Source