Enumerations

Enumerations are sets with a reduced number of elements and are usually fixed over time. However, using dynamic enumerations, it is possible to create enumerations with a variable set of elements.

Figure 1. Definition of an enumeration in Genio.

Dynamic enumerations

Dynamic enumerations block the insertion of new elements in enumerations’ lists and unlock the specification of parameters, where functions can be invoked, as shown in Figure 2.

Figure 2. Definition of a dynamic enumeration in Genio.

In this case, since the set of elements is not fixed, it is necessary to specify their source. This list offers a range of functions already implemented in Genio, and the possibility of creating a custom source for the enumeration:

  • Modules()
  • ApplicationModules([APPID])
  • Roles()
  • RolesAbove([ROLEID])
  • RolesBelow([ROLEID])
  • Custom

Depending on the selected source, it might be necessary to specify required parameters. Figures 3 and 4 show example definitions of dynamic enumerations with and without parameters.

Figure 3. Definition of a parameterless dynamic enumeration in Genio.

Figure 4. Definition of a dynamic enumeration in Genio.

Custom dynamic enumerations

To support custom dynamic enumerations, Genio automatically generates support classes which must be implemented using manual code. Application build will output an error until the necessary methods are implemented, as shown in Figure 5.

Figure 5. Error due to missing implementation.

Figure 6 shows an example implementation of a custom dynamic enumeration.

Figure 6. Example implementation of a custom dynamic enumeration.