Working with Enumerated Types (ENUMs)
If you want to categorize objects as different types, instead of using a number or a free format string, use an Enumerated Type (ENUM). Enumerated Types provide a better solution because they are restricted, in that they can only take a fixed limited number of values. The names of the values can be made meaningful.
The qualified name of enumerations to be used in script is similar to the Factory names, with the qualified name formatted to replace dot '.' by '_' an underscore character. The qualified name must be wrapped in a pkg object. For example, com.example.shared.ColorEnum will be used as pkg.com_example_shared_ColorEnum in script.
An ENUM is created in the BOM editor by selecting the Enumeration type from the Elements section of the Palette. Having selected the Enumeration Element, it can be named, and values can be added to it. The following is an example of an Enumerated type called SpaceType, with PLANET, MOON, ASTEROID, and STAR values:
Having defined the Enumeration type, a class attribute can be set to that type:
A Business Object attribute that is configured to be of a particular Enumeration type can only be assigned with values of that enumeration type. Either constants of that type, such as: