All values of a dynamic enumeration

See also: Dynamic enumerations, Any dynamic enumeration

Value resolver – Abstract

Purpose: Returns all values of a dynamic enumeration statically defined in the configuration as a list.

images/download/attachments/150865898/image-2024-6-11_17-38-36-version-1-modificationdate-1718120315989-api-v2.png

The All values of a dynamic enumeration resolver returns a list of all values of a dynamic enumeration defined by static selection in the configuration (see Dynamic enumerations).

NOTEDynamic enum filters applicable in the execution context do not restrict the returned list. The value resolver always returns all values (values) that are configured in the definition of the dynamic enumeration.

Configuration

Any existing input value is ignored.

The Type required field parameter requires the static single selection of a dynamic enumeration via a Combobox element.

This has a search function that takes into account both the localizations and the internal (class) names for predefined and custom Dynamic enumerations.

images/download/attachments/150865898/image-2024-6-12_8-5-18-version-1-modificationdate-1718172316840-api-v2.png

As soon as a selection for the Type has been made, a list of values ​​of the relevant type (here: volume unit[]) is assumed as the type for the return value in the context of the configuration, for which specific fields may be offered.

images/download/attachments/150865898/image-2024-6-12_8-13-43-version-1-modificationdate-1718172822437-api-v2.png

Examples

Simple use case: 'List' values of an enumeration

In the context of event handling, the user should be asked to enter the 'Economic region' per User prompt (as a text value) under certain conditions.

A custom dynamic enumeration 'Economic region' (REGIONS) has been created that specifies permissible values for this entry. The 'Name' (name) of the respective value should be decisive.

The 'prompt' in the User prompt specifies all permissible text keys ('Name' values) from the underlying enumeration.

Runtime example:

images/download/attachments/150865898/image-2024-6-7_19-58-1-version-1-modificationdate-1717783081366-api-v2.png

Configuration:

The screenshot on the right shows how the User prompt resolver can be used within an Execute with event action to provide the 'Economic region' identified by text input as a reference object for the action block below (still empty in the image on the right)

  • The Message in the User prompt resolver is completely determined by the All values of a dynamic enumeration resolver:

    • The user-defined dynamic enumeration 'Economic region' (REGIONS) is selected as the Type.

    • In the server context (e.g. in an event handling), only the 'Names' from the name field of the values contained appear in the string image of the list generated in this way. For the given purpose, these are abbreviations for regions that are understandable to the user regardless of any applicable localization.

  • The concatenated Input object (type safe) resolver below transforms the text entered by the user into the type defined by the dynamic enumeration 'Economic region' (REGIONS). This ensures that the action block can check whether a valid input has been made, because if none of the 'Names' for enumeration values match the input, 'No value' ($null) is used as the reference object in the action block.

NOTEThis configuration example solves the task of a selection decision more simply than a portal with a Combobox element. When using the User prompt resolver in a productive workflow, however, it should always be borne in mind that the server thread for the workflow is interrupted at runtime and remains occupied until the 'queried' user confirms their input, cancels the dialog or the Time out expires. The User prompt resolver should not be used if the input has to be queried more often and possibly by many users at the same time.

images/download/attachments/150865898/image-2024-6-10_9-40-7-version-1-modificationdate-1718005206360-api-v2.png

More complex use case: 'Reverse search' in a dynamic enumeration

A given text value (String) should specify either the two or three-digit text key for a specific Country (ISO 3166 ALPHA-2 or ALPHA-3).

The corresponding value from the associated dynamic enumeration (Country) is transferred as user data to a portal that displays details for the Country.

Text key
(selectable) →

(ALPHA-3)
'BIH'

(ALPHA-2)
'BA' →

images/download/attachments/150865898/image-2024-6-10_9-25-23-version-1-modificationdate-1718004322410-api-v2.png

Configuration:

The screenshot on the right shows the configuration for a section from an event handling in which the text key is available as an external reference object of an Execute with event action:

  • The text key is initially saved in the variable countryCode to enable access in the Default value resolver (see below).

  • The configuration for the Object resolver parameter aims to obtain the value addressed via the given text key from the Country dynamic enumeration as a temporary reference object for calling the portal (in the action block):

    • The Input object (type safe) resolver with the Type Country attempts a type conversion for the given text key, which succeeds if it matches the 'Name' (name) for a country. By default, this 'Name' corresponds to the ALPHA-2 code for the country. Otherwise, 'No value' ($null) is returned.

    • The concatenated Default value resolver is only evaluated at runtime if there is no Country value with the text key as 'Name' (name). A search is then made for a Country whose configuration feature alpha3Code matches the text key. The value configuration for the Default value parameter defines the required 'reverse search':

The 'found' Country is the reference object for the Open portal (Action) event action in the action block.

images/download/attachments/150865898/image-2024-6-10_9-27-5-version-1-modificationdate-1718004424898-api-v2.png

NOTE◄ No 'error handling' is provided here in the event that the ALPHA-3 reverse search does not return a result.