company logo

Defining enumerations

For defining an enumerated value list, an enumeration (SDB_ValueList) might be crated by clicking on the Enumerations region in the class tree or below a complex data type and selecting Insert from the context menu:

Than, the insert dialog pops up where the enumeration name has to be entered:

After entering the enumeration name, which has to be a unique type name in the project or module, i.e. it must not already exist as complex data type definition, the enumeration will be provided and enumerated valued might be defined:

For defining enumeration values, select Insert from the context menu in the enumerator list. Now, the enumerator name is requested and after entering the enumerator name, an entry in the list will be created using an auto-number as code value. When the enumeration defines a discriminator, the base type for all derived category types has to be entered in the Base type field.

Enumerator name and code (value) are required properties. Enumerator names have to be unique within an enumeration. In order to set other enumerator properties, those might be entered directly in the list (F2 or double click on a list cell) or Edit might be selected from the context menu after selecting the enumerator to be updated.

In order to document the category, one may select the documentation tab in the edit form. In addition to name and value, the following properties might be added:

Label - is a language depending short name for the enumerator. Labels are used in order to display meaningful names instead of the technical name stored in name.Moreover, it allows providing multilingual selection lists in multilingual applications.

Title - Similar to label title is a multilingual short description of a category (enumerator). Reading enumerators into run-time dictionary, label and title are loaded for the selected language, only.

Type - This is the name for the associated object type for the category. This name is allowed only for typed enumerations. Typed categories are an ODABA specific extension that allow associating a category with a class (type) definition.

Condition - An enumerator may define a condition (OSI expression), which is typically used for grouping enumerations (e.g. income range for defining income groups).

After defining the enumerators for the enumeration, the enumeration might be generated to an external resource. Depending on the programming language selected for the project, a C++ enumeration or a C# enumeration will be created in the project INCLUDE path.