All attributes of one type

Resolver – Abstract

Purpose: In the context of a reference object (entity type must be attribute owner), returns the single values of all attributes of a given type as a list.

images/download/attachments/201661201/image-2025-3-10_9-54-20-version-1-modificationdate-1741596859915-api-v2.png

The All attributes of one type value resolver provides access to all attributes of an entity that belong to a specific attribute type. It expects an entity as a reference object, which is an 'attribute owner' according to the type (see Attribute (Resolvers)). The return value is a list of single values of the specified attribute type, which can also be empty. For specific read and write accesses (see 'Examples'), the Resolvers specific to lists (e.g. List item, Rule list resolver) and Event actions (e.g. For each loop, Modify list) can be used.

As an Attribute, exactly one attribute type must be selected from one of the following categories:

Category

Example for 'Attribute' (Attribute type)

Return value of the value resolver

Singular attribute

'Additions GLS' in Company accounts

A list that contains exactly one singular 'Additions GLS' attribute or is empty.
NOTE◄ For accessing a singular attribute, the Singular attribute value resolver is preferable.

Plural attributes

'Communication infos' in Addresses

A list containing all 'Communication infos' (attributes) of the address or is empty.
NOTE◄ Unlike an access via the Plural attributes (Resolver) value resolver, this list is not sorted by the index field.

Typed attributes

'Text attribute' (e.g. in Shipments)

A list containing all 'Text attributes' (of all subtypes) of the business transaction object or is empty.
NOTE◄ As far as the list contains plural subtypes for the selected attribute type, each single value appears in the list as a separate entry.

Other attributes

'Product ID'/'Price attribute' for Products

A list containing either all 'Price attributes', 'Product ID' attributes for the product, or is empty.
NOTE◄ Attribute types in this category, are the only ones that can be accessed exclusively through the All attributes of one type value resolver.

Configuration

The All attributes of one type value resolver expects a reference object whose data model is considered the 'Attribute owner' (see Attribute (Resolvers)).

The Attribute parameter provides a static single selection for the attribute type whose value list is accessed.

As long as the context of the configuration does not refer to a specific entity type, all attribute types that the system supports appear for selection.

The Combobox element offers a search function that takes into account the internal class names of the attributes as well as associated localizations from the localization.

images/download/attachments/201661201/image-2025-3-10_9-55-28-version-1-modificationdate-1741596927820-api-v2.png

If, on the other hand, the context of the configuration refers to a specific entity type for the reference object, then only the multiple attribute types explicitly implemented in the relevant data model appear for selection.

On the right, a Check type (not in the image) refers to a Routing table entry, so that only the (typed) attributes intended for this entity are selectable.

images/download/attachments/201661201/image-2025-3-10_9-56-9-version-1-modificationdate-1741596969218-api-v2.png

If no Attribute type is selected, then the return value of the value resolver is always 'no value' (null).

If a selected Attribute type is not supported by the type of the reference object present at runtime, the return value is also 'no value' (null).

If the reference object present at runtime supports the selected Attribute type, but no relevant data is contained in the reference object, an empty list is returned.

Examples

Example of 'write access'

When saving a product catalog entry in a specific catalog, the data of the price attributes contained in the product should be automatically 'revised':

  • If the 'Tax rate' (taxRate)has not yet been filled for a price attribute, it can be determined in the dynamic enumeration Tax rate whether a 'Default tax rate' has been defined for the 'Country' (country).

  • A 'Default tax rate' should be recognizable by arbitrary convention by the fact that the internal name for the value in question (in the dynamic enumeration Tax rate) is the text concatenation of a country code (see Country) with the suffix '_default'.

  • If a 'Default tax rate' exists for the 'Country' (country), it should be assigned to the 'Tax rate' (taxRate) field.

Runtime example

Values entered in price attributes (before saving)

Automatic revision (after saving)

images/download/attachments/201661201/image-2025-3-10_9-57-32-version-1-modificationdate-1741597052280-api-v2.png

images/download/attachments/201661201/image-2025-3-10_9-58-1-version-1-modificationdate-1741597080935-api-v2.png

  • The input form allows the Net value for each price attribute to be entered and a selection for the Tax rate (see Tax rate).

  • The element for the Gross value is configured here as a calculation field (see Calculation field) with an expression according to the scheme $product($el(<netValue>),$taxRate($el(<taxRate>))) (see product (Multiplication), taxRate (Tax rate)).
    NOTE◄ The Gross value element is also disabled so that it cannot be modified, and its data field is set to 'Skip' so that the calculated value is not stored in the attribute field (grossValue).

  • After saving (right), the Tax rate (taxRate) field was filled just for the countries 'Germany' and 'Switzerland'. It appears there is no default Tax rate (with the internal name VAT_default) for 'Austria' (yet).

Configuration:

An event handler that reacts to the events 'Create' and 'Update', i.e. 'Saving' an entity (see Common action event) is configured as shown on the right:

  • The Validating rule (collapsed in the image) uses a Check type to ensure that a 'product catalog entry' is present as the reference object. The productCatalogId is also checked via an AND junction using an Entity property rule in order to check whether the entry belongs to the Product catalog that is 'predefined' according to the request.

  • As an Action on passed rule, a For each loop event action is executed. The basis for the loop is a list of all price attributes for the product referenced in the product catalog entry (see Products), which is restricted as described below to the price attributes for which no Tax rate has yet been specified and for whose 'Country' a default tax rate is stored.

  • Within the loop, a simple assignment to the Object property 'Tax rate' (taxRate) is made for all relevant price attributes. The internal name for the Tax rate in question is systematically constructed by Concat strings from the value for the Object property 'Country' (country) of the price attribute and the static suffix '_default' defined by the arbitrary convention.

    NOTE◄ Since the configuration for the Resolver for entities (see below) ensures that the loop will only execute price attributes for which a suitable Tax rate exists, automatic type conversion from text value to enumeration value can be set here without further provisions.

images/download/attachments/201661201/image-2025-3-10_9-59-31-version-1-modificationdate-1741597171335-api-v2.png

The Resolver for entities, which defines the basis for iteration within the loop, is configured as a concatenation of value resolvers as shown on the right:

  • In the first step, the Object property value resolver must be used to evaluate the product field, which refers to a product in the product catalog entry

  • Within the product, the All attributes of one type value resolver is used, in which the Attribute type 'Price attribute' must be selected here. The return value is a list of all price attributes found for the product.

  • The list of all price attributes is restricted by the concatenated Rule list resolver to Resolve all as list for which the following conditions are met:

    • The first condition is that the 'Tax rate' (taxRate) field of the price attribute does not contain a value yet (see Entity property rule and Is empty). For example, if a price attribute has already been assigned a tax rate that differs from the default, this selection remains unchanged.

    • The second AND-linked junction ensures that a default Tax rate is stored for the 'Country' (country) to which the price attribute applies by definition. This check is configured in the example as a With rule, where the internal name is constructed in the Entity property resolver by Concat strings, which according to convention applies to the default Tax rate of the respective country:

      • First (similar to the assignment in the Set value event action, see above) the static suffix '_default' is added to the internal name in the country field.

      • This string is passed to an Input object (type safe) value resolver. Since the selected Type of Tax rate is a dynamic enumeration, an incoming text value is interpreted as an internal 'Name' within this enumeration and the corresponding enumeration value is returned (otherwise: 'no value').

      • In the rule definition of the With rule, a Check type can therefore be performed on the Tax rate type, which is passed only if a Tax rate is stored that corresponds to the 'Name' structured according to the convention.

The Rule list resolver returns a list of all price attributes of the product for which a default tax rate can be assigned. The assignment is only performed for these within the loop (see above).

NOTEProducts are Referenced objects, so changes to attributes of a product referenced in a product catalog entry do not change the properties of that product if it has already been saved. Rather, when saving, the system checks whether the changed feature combination corresponds to an existing product. Otherwise, this product will be automatically recreated. Then the reference in the product catalog entry is changed to the existing or newly created product. Existing references, e.g. in items of business objects or other product catalogs, continue to refer to the original product.

images/download/attachments/201661201/image-2025-3-10_10-1-33-version-1-modificationdate-1741597293147-api-v2.png

images/download/attachments/201661201/image-2025-3-10_10-3-28-version-1-modificationdate-1741597408030-api-v2.png

Example of 'Read access'

In an overview for Users, a click on a custom ribbon button ‘Flags’ (see Ribbon macros) should open a notification with a list of all ‘flags’ that are set for a selected user.

Specifically, all indicator attributes that are assigned to the user's address and for which the indicator value is $true are evaluated.

The localised name for the Flag type from the respective attribute should then appear in the list.

Runtime example:

images/download/attachments/201661201/image-2025-3-10_10-9-28-version-1-modificationdate-1741597767596-api-v2.png

Configuration:

A Custom action event ‘Show flags (user)’ must be created and the corresponding ribbon macro added and assigned in the context of the ‘User overview’. Details on this are not provided here.

An event handling that uses the ‘Display flags (user)’ event as the Triggering event is configured as shown on the right:

  • The Validating rule uses a Check type to ensure that the reference object is a ‘user’.

  • A Show alert (Popup) event action is configured as an Action on passed rule as follows:

    • ‘Info’ was selected as the Type of notification, which means that it is displayed as a temporary overlay on the right-hand side of the screen (see ‘Runtime example’).

    • The selected user should be identified in the Title. For this purpose, an object property value resolver accesses the ‘username’ field.

    • The Message contains a value resolver chain (see Chained resolver), through which the entire data preparation for the output of the desired information can be performed without having to configure a For each loop (see below for details).

      NOTE◄ In the following detailed depiction, only the second step in the concatenation of value resolvers directly affects the read access per All attributes of one type value resolver. All other value resolvers are intended to demonstrate how the returned list of attributes can be prepared to fulfil the specific requirements in the example.

images/download/attachments/201661201/image-2025-3-10_10-12-8-version-1-modificationdate-1741597928532-api-v2.png

  • Within the Message, an Object property value resolver first accesses the address field of the user account, as the user's address is typically considered the owner of its attributes.

  • For the concatenated All attributes of one type, the Attribute type ‘Flag attribute’ (FlagAttribute) is selected, which provides a list of all flag attributes of the address.

  • The concatenated Rule list resolver is intended to restrict this list to those flag types that not only exist, but are also considered ‘assigned’. As a return value, all values that meet the configured Entity property rule should be passed as Resolve all as list to the value resolvers chained below. The Equals compare type is used to check whether the 'flag value' (flagValue) of the attribute is set to $true.

The subset of all flag attributes that are ‘set’ for the user is therefore passed on to the concatenated value resolvers below. This list is empty if no flags are set.

  • The Collect values resolver uses the Value to collect parameter to define how the filtered list of flag attributes is converted into output texts. Specifically, a value resolver of the Value from localization type is used here:

    • The class Flag type is assigned as a static value for the Bundle using the Class resolver.

    • The name for the Resource in this Bundle can be found in the ‘flag type’ (flagType) field of the analysed flag attribute. Specifically, the ‘Name’ (name) of the Flag type value defines the resource.

    • The requested Resource Name should also be used here as the Default value in the event that there is no localisation for a Flag type. In the runtime example (see above), this applies to the ‘VIP’ flag, for example, for which localisation was deliberately omitted.

  • The list of text values that are to identify the selected indicator types is then formatted using a concatenated Join string list resolver so that a line break is inserted between two values.

images/download/attachments/201661201/image-2025-3-10_10-14-23-version-1-modificationdate-1741598072703-api-v2.png