Skip to content

Enumeration

New Enumeration

To add a new class go to the + button of the editor and select the New Enumeration Option.

The add button menu, with New Enumeration

The editor creates an enumeration with its name ready to edit. Type the name and press Enter, then type each value and press Enter after it. Press Escape when you are done.

The ProductStatus enumeration with the values Draft, Active and Discontinued

Alternatively, you can right-click anywhere in the Business objects editor and select the New Enumeration option from the Menu that will appear.

The canvas menu

Important

After creating your Enumeration, you will be able to access it via the Domain Namespace, like so:

Domain.YOUR_ENUMERATION_NAME.ENUMERATION_VALUE; 

/** Example **/
var birthdayMonth = Domain.Months.November;

Available Operations

By right-clicking on a selected Enumeration, you will see a Menu like this:

The enumeration menu

Add Attribute

You can add a new Attribute (a.k.a. Value) into your selected Enumeration using one of two ways:

  1. Selecting Add Attribute from the menu
  2. Selecting your Enumeration and hitting the Insert key

Refactor

By refactoring an Enumeration, you are basically changing its name, but in such a way that it is changed in any other Model that might use it.

Attention

To simply rename an Enumeration, double click on it and type in the new name. (Alternatively, you can use the Property panel). Remember, however, that if you rename your Enumeration, the changes will be local, meaning that all other Models will be still using its previous name. To globally rename an Enumeration, use the refactor option.

Tip

If you are just beginning your Modeling and you know that your enum is not used anywhere, a simple rename is enough.

Find Usages

The Find Usages option is very helpful if you want to find all the Models that might be using your Enumeration. All the hits will be presented in the Console, inside the Symbols panel. From then on, you will be able to Navigate to each Model that uses your Enumeration, by double-clicking on the record you want, presented in said Console.

The result has the same columns as for a class: the type of symbol, its name, its owner, and the type of model and the model that contain it. Double-click a row to navigate to it.

Properties

Every enumeration has a set of properties that you can define, visible in the Properties Grid.

Properties of an enumeration

An explanation of each property follows:

Property Description
Name Name of the Enumeration
Notes Useful notes regarding the Enumeration

Attributes

The Attributes are the values that the Enumeration might have.

Available Operations

By right-clicking on a selected Attribute within an Enumeration, you will see a Menu like this:

The menu of an enumeration value

Refactor

By refactoring an Attribute, you are basically changing its name, but in such a way that it is changed in any other Model that might use it.

Attention

To simply rename an Attribute, double click on it and type in the new name. (Alternatively, you can use the Property panel). Remember, however, that if you rename your Attribute, the changes will be local, meaning that all other Models will be still using its previous name. To globally rename a Attribute, use the refactor option.

Tip

If you are just beginning your Modeling and you know that your Attribute is not used anywhere, a simple rename is enough.

Tip

If you choose to simply rename your Attribute, all Classes that are accessing it, will be aware of the new name. Thus, the refactoring is only required if a different Model accesses this Attribute (example: a form, an API and anything else outside the business objects)

Find Usages

Same logic as the one described earlier, for the Enumeration.

Find Usages

Same logic as the one described earlier, for the Enumeration.

Move Up

Displays the selected attribute one row higher, in the list of the Class' Attributes

Move Down

Displays the selected attribute one row lower, in the list of the Class' Attributes

Properties

Every Attribute has a set of properties that you can define, visible in the Properties Grid.

Properties of an enumeration value

An explanation of each property follows:

Property Description
Name Name of the value
Caption The text shown for the value in lists and drop-downs, when it should differ from the name
Notes Useful notes regarding the value

Design Rules

  • The name of any Enumeration must be unique throughout your whole Application
  • The name of any Enumeration cannot be the same as the Application's name
  • An Enumeration must have at least one (1) value

Remarks

If your Enumerations and Classes clutter the editor, find out how to clear the space up here.