Skip to main content

enum field definition

Overview

Next Design allows you to define input method fields that select a value from a selection. Such fields are called enumerated fields.

The steps for defining enumerated fields are described below in the following order:

  • add enum fields
  • remove enum definition
  • change enum settings

Image of enum field definition

enum field definition


Add an enum field

There are multiple ways to add enum fields:

  • Define an enum in the class diagram and add a field
  • Define a new enum when adding a field

Defining Enum Types and Adding Fields in Class Diagrams

To add an enum field in a class diagram, follow these steps:

Define an enum in a class diagram and add a field

Operation procedure
  1. Drag and drop an [Enum] from the class toolbox and enter a name.
  2. The newly added enum type has [enum_literal_1] defined as the first choice. To change the value of an option, double-click the option you want to change, or select it and press the f2 key.
  3. To add a choice to an enum type, move the pointer over the value display area of the enum type, click the + icon that appears in the upper right corner of the value display area, and enter the value for the choice.
  4. This defines a set of choices as an enum.
  5. To add a field of the defined enum type to an entity, just like adding a field to an entity, click the [+] icon that appears in the upper right corner of the entity's field display area and select Add New. Open the Fields dialog.
  6. When specifying the data type in the Add New Fields dialog, just like specifying an existing entity, click the [...] button to the far right of Data Type to open the finder .
  7. Find and click an enum type from the list on the finder to enter that enum type in the Data Type.
  8. Enter the setting items in the [Add New Fields] dialog and press the [OK] button.
  9. This will add an enum field to the entity.

Defining a new enum when adding a field

To define a new enum at the same time as adding a field to an entity, do the following:

define new enum when adding field

Operation procedure
  1. Open the Add New Fields dialog as you would add a field to an entity.
  2. When specifying the data type in the [Add New Fields] dialog, click [New Enum Type...] from the data type choices to open the [New Enum Type] dialog.
  3. Enter the setting items in the [New Enum Type] dialog.
  4. Enums must always have at least one choice. To add a choice to an enum type, click the + icon at the bottom right of the Enum Literal grid to open the New Enum Literal dialog.
  5. Enter the setting items in the [New Enum Literal] dialog and press the [OK] button to return to the [New Enum Type] dialog and add options to the enumeration type.
  6. Enter the setting items in the [New Enum Type] dialog and press the [OK] button to return to the [Add New Fields] dialog and enter the enumeration type in [Data Type].
  7. Enter the setting items in the [Add New Fields] dialog and click the [OK] button.
  8. This will define a new enum and add a field of that enum to the entity at the same time.

remove enum definition

There are multiple ways to remove enums:

  • Remove the enum from the metamodel
  • Remove the enum from the class diagram (hide it from the class diagram without removing it from the metamodel)

Remove the enum from the metamodel

To remove an enum from the metamodel, just as you would remove an entity:

delete enum from metamodel

Operation procedure
  1. If you want to delete an enumeration used as a data type in a field of an entity, delete the corresponding field in advance.
  2. Select the target enum type in the class diagram and execute [Delete From Model] from the context menu.
  3. As a result, the target enum type is deleted from the class diagram and also from the meta model, and the target enum type is also deleted from the profile navigator.
caution
  • If you select the target enumeration type in the class diagram and press the delete key, it will just be deleted from the class diagram, just like [Delete From Diagram] in the context menu. It is not removed from the profile and remains on the profile navigator.

Enums can also be removed from the metamodel with the following steps:

Other operating procedures
  1. Select the target enumeration type in the profile navigator and execute [Delete] from the context menu or press the delete key.

Remove enum from class diagram

To remove an enum from a class diagram and hide it:

Delete image enum from class diagram

Operation procedure
  1. Select the target enumeration type in the class diagram and execute [Delete From Diagram] from the context menu, or press the delete key.
  2. This removes it from the class diagram, but not the metamodel and leaves the enum in question on the profile navigator. To reappear on the class diagram, go to [Metamodel definition > Model structure definition > Add entity > Add existing entity to class diagram](./model-structure-definition#model-structure-definition-- add-exist-entity-to-class-diagram) manually to the class diagram.

Change enum settings

To add choices to the enum or change the order of the choices, use the inspector and do the following:

Change enum settings

Operation procedure
  1. Click View > Pane > Inspector from the ribbon to display the inspector on the right side of the screen.
  2. Select the desired enum in the class diagram or profile navigator.
  3. Select Enum Type from the tabs at the top of the inspector.
  4. To add choices to the enum type, click the [+] icon at the bottom right of the [Enum Literal] grid in the [Enum] group, enter the settings in the [New Enum Literal] dialog, and click [ Click the OK button.
  5. To remove a choice from an enum type, select the value to remove in the Enum Literal grid in the Enum group and click the minus icon in the lower right corner.
  6. To change the order of the choices defined in the enum, select the value to change in the Enum Literal grid in the Enum group and click the ↑ and ↓ icons in the lower left corner. increase.