Unit

Resolver – Abstract

Purpose: Returns a value defined by static single selection from one of the dynamic enumerations for Units.

images/download/attachments/128387014/image2023-1-9_10-52-12-version-1-modificationdate-1676010663003-api-v2.png

IMPORTANT◄ All resolvers for Static values ignore the input value. Within a resolver chain (see Chained resolver) this prevents the processing of all preceding resolvers (if any).

The Unit resolver returns a value determined by static single selection via Combobox from one of the predefined dynamic enumerations (see Dynamic enumerations) for Units:

The only difference to the Any dynamic enumeration resolver is the restriction of the selection to values from these dynamic enumerations.

The resolver appears by default as a suggestion for value configurations when a dynamic enumeration value is expected to define a 'unit'.

Typically, this affects the 'unit' (unit) field in one of the following contexts:

Class

Context

'Unit number' (UnitNumber)

e.g. Calculate value (resolver)

'Number with unit field' (NumericValue)

Custom type definition or their instances

'Numeric attribute' (NumericValueAttribute)

Implementation of a typed attribute for a Numeric types for an entity



images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/warning.svg CAUTIONimages/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/warning.svg The definition for a Number with unit field or a Numeric types specifies via a multiple selection of one or more of the named dynamic enumerations which Units should be selectable in the given context by default in forms.
The Unit resolver ignores such specifications (as well as any applicable Dynamic enum filters) and always offers all values of all Units for selection.
Any assignments to a 'unit' field will be stored without any plausibility check regarding the 'stored' multiple selection for Units.


Configuration

The Combobox element allows static single selection for values from all dynamic enumerations for Units.

Its search function looks for matches between the text input and the labels listed in the dropdown for the enumeration values of Units. The label contains the following components:

  • The localization for the name of the dynamic enumeration, e.g. 'Volume unit'.

  • The localization for the dynamic enumeration value, e.g. 'US Barrel'.

  • The internal name of the dynamic enumeration value, e.g. BARREL_US

NOTE◄ If Dynamic enum filters are configured for these Units, they do not restrict the selection of values during configuration or their use as return values at runtime.

images/download/attachments/128387014/image2023-1-9_10-52-57-version-1-modificationdate-1676010662993-api-v2.png

The dynamic enumeration to which a selected value belongs is identified as the class for the return value.

images/download/attachments/128387014/image2023-1-9_10-53-26-version-1-modificationdate-1676010662988-api-v2.png

Example

An association criteria (see Association criteria) is passed if the input value is a business object of the type 'Shipment' (see Shipments), whose value is specified in a Currency from a statically defined positive list.

Configuration:

images/download/attachments/128387014/image2023-1-9_10-50-31-version-1-modificationdate-1676010663009-api-v2.png

  • Within the Entity property rule expanded in the image, the 'Unit' (unit) field for the numeric attribute 'Goods value' (GOODS_VALUE) is accessed on the left.

  • The In list comparison type searches the positive list configured on the right, which here statically defines a Create list resolver in which two entries are defined by one instance each of the Unit resolver.

NOTE◄ As can be seen in the screenshot, the search function can limit the selection in the dropdown to specific units of a certain type (here: Currency). In the search text (^Cur), the ^ symbol has been prefixed here so that only options whose label begins with 'Cur' are considered matches.