Domains

Make the BOM more specific by setting domains on members. Domains can be static, dynamic, enumerated, or complex.

A domain places a restriction on type elements in the BOM. You can set a domain on classes, attribute types, method return types, and arguments.

The main domains include:

Note:

Not all kinds of BOM domain are enforced in BAL rules or other business rules. Business rules use only enumerated domains (literal, static reference, or dynamic). A semantic check is performed to check that the business rule does not use a value outside its domain, and the Intellirule editor suggests values from the enumerated domains. However, the semantic check performed at the business rule level is primitive and does not detect complex patterns of incorrect usage that involves operators other than is or is not. Other kinds of domain, such as bounded domains, are not enforced at business rule level.

You can use domains when working with business rules:

If the XOM has a set of public, static, and final attributes typed to the declaring class, they are automatically considered as an enumeration of static references of the class in the BOM.

If the XOM has members of array type, they are automatically considered as a collection of the class in the BOM.

Bounded

A bounded domain specifies an interval between two bounding values, such as [0, 120].

In the designer BOM editor, when defining a bounded domain on an integer attribute, you can specify the * (asterisk) character as the lower or upper bound of the domain. When you specify *, the bound value is replaced in the corresponding .bom file by -2147483648 for the lower bound, or 2147483647 for the upper bound. These values correspond to Integer.MIN_VALUE and Integer.MAX_VALUE, respectively.

Note:

Bounded domains are not enforced at business rule level. You can create a bounded domain on a number primitive type.

Collection

A collection domain specifies the cardinality and the type of collection elements, for example, 0,* class Customer.

If you have members of type java.util.Collection, set a collection domain on these members for them to be automatically considered as a collection in business rules. You can also create, add, and remove methods for the items in the collection domain by using the BOM Editor.

For more information about collections, see Collections.

Note:

You can create a collection domain on a collection or an array.

Dynamic

You can populate a domain in the BOM dynamically from a data source, and then synchronize the data source and the domain.

A dynamic domain is an enumerated domain with values from an Excel file or set by the execution of Java code.

Note:

You can create a dynamic domain only on a class in the BOM class editor, but not on a Collection subclass.

Literals

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

Note:

You can create a literal domain on a primitive type or a string.

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

You can define attribute types and method return types and arguments as follows:

  • If you have an attribute of type A, you can define a domain of static references on it using the static attributes of the class A (classic Java enumeration pattern).

  • If you have an attribute of a primitive type, you can define a literal domain on it.

Note:

You can create a static reference domain on a class, but not on a Collection subclass.

Other

The ‘other’ domain types were introduced to support most domains that come from the XML binding. In an XML schema, you can define pattern domains (even for numbers) and simultaneously an enumeration. You can also define pattern domains or intersection of domains in the business object model.

You can define other types of domains by using the syntax of regular expressions. For example, you can define a pattern for Strings as follows:

"a*n"

You can define an intersection of domains as follows:

({1, 3, 5, 7, 9}, [0,6])
Note:

Other domains are not enforced at business rule level. You can set this type of domain on an array by using the following syntax: '({ (String)"a", (String)"b"})'.