Skip to main content

Enums

When defining schemas, we often need to restrict a property's values to a specific set of options.
To achieve this, we use enums to describe these predefined values.

Add Enums

There are two ways to add an enum:

  1. During the modeling of the use case.
  2. Through the Enum Management Panel.

Adding an Enum During Use Case Modeling

To add an enum while modeling a use case:

  1. Open the Use Case details by clicking on an API Use Case on the map.
  2. Navigate to the relevant section where you want to define a property.
  3. When adding or editing a property, select the type as "enum" (See Use Case Schema Editing).
  4. Click the + icon next to the enum dropdown.

Codebricks Planner with Add Property from an aggregate state open, highlighting the option to add an enum.

In the dialog that appears, specify the name and the values for the enum.
You can add new values by clicking the + icon and finalize your creation by clicking on the checkmark symbol.

Codebricks Planner with the enum creation dialog open.

After submitting, your enum will be automatically selected for the property.

note

Please note that all input fields in the Codebricks Planner only allow lowercase letters and spaces.
No special characters are permitted to ensure a smooth generation experience.

Select Enum

To use an enum in any schema, follow these steps:

  1. Open the Use Case details by clicking on an API Use Case on the map.
  2. Navigate to the relevant section where you want to define a property.
  3. When adding or editing a property, select the type as "enum" (See Use Case Schema Editing).
  4. Choose the desired enum from the dropdown menu.

Codebricks Planner with Add Property from a request open, highlighting the option to select an enum.

Manage Enums

To create, edit, or delete enums, use the Enum Management Panel:

  1. Open the Use Case details by clicking on any Use Case on the map.
  2. Open the management panel by clicking on the Candy Box icon (Candybox icon).
  3. Move to the Enums tab.

Here, you can add, edit, or delete enums.

Codebricks Planner with Enum Management open. One enum is visible: TaskStatus with the values: open, completed.

warning

You can only delete enums that are not currently used in a Use Case.