Plural attributes (Resolver)
Resolver – Abstract
Purpose: In the context of a reference object (entity type must be attribute owner), a single value for a specific 'Plural attribute' is returned as a list.
The Plural attributes (Resolver) provides access to a Plural attribute of an entity. As a reference object, it expects an entity that is considered an 'Attribute owner' according to its type (see Attribute (Resolvers)) and whose data model provides for at least one Plural attribute. The return value is a list of individual values, which can also be empty. For specific write and read 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.
The Plural attribute parameter specifies the type of 'Plural attributes' whose values are returned as a list. For each single value, the specific data model of the selected attribute type applies. An important common feature is the index field, which specifies a Long value for the sequential line item of the single value within the list. The Plural attributes (Resolver) returns the single values always arranged in ascending order by the index field. The integer index values are automatically assigned by the system (ascending from 0) when the list is accessed, e.g. via a form or the List item value resolver.
►NOTE◄ Accessing the same attribute type via an Attribute value resolver returns the same individual values in principle, but does not sort them by the index field. Instead, the Attribute value resolver returns the individual values in chronologically ascending order, i.e. in the order in which they were added to the list. The chronological order is also reflected in the XML format of the reference object.
In the context of the entities predefined in the various Lobster Data Platform / Orchestration modules, 'Plural attributes' are rarely encountered. Depending on the installed/licensed modules, the following types of plural attributes are relevant:
Plural attributes type |
Owner |
Barcode attribute |
Line items of business transaction objects (Common business object, Orders, Shipments). |
Dangerous goods attribute |
Products (e.g. within the line item level of business transaction objects). |
Communication info |
Addresses (e.g. within attributes of business transaction objects but also for Company accounts und Users). |
Loading aid definition |
►NOTE◄ The 'Plural attributes' are distinguished from 'Typed plural attributes', for which a separate value resolver is provided (see Plural attributes and Plural typed attribute resolver).
Configuration
The Plural attributes (Resolver) expects a reference object whose data model can contain at least one 'Plural attribute'.
The Plural 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 plural 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 language management. |
|
If, on the other hand, the context of the configuration refers to a specific entity type for the reference object, then only the plural attribute types that are explicitly implemented in the relevant data model appear for selection. On the right, a Check type (not shown in the image) refers to an 'Address' (see Addresses), so the only option offered is the plural attribute type 'Communication info'. |
|
If no Plural attribute type is selected, then the return value of the value resolver is always 'no value' (null).
If a selected Plural 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 Plural attribute type, but the reference object does not contain any relevant data, an empty list is returned.
Examples
Example of 'write access'
A new 'Loading aid definition' is added to an existing 'Shipment' (see Shipments) in the course of an event handling.
In the context of the given 'Shipment', the event actions shown on the right are configured within an event handling:
|
|
Example of 'read access'
A Custom action event that is passed an 'Address' (see Addresses) as a reference object sends a specific message by e-mail to the first e-mail address found in the communication information stored in the address.
Configuration:
In an event handling for the relevant custom action event, the 'Validating rule' is configured as shown on the right:
►NOTES◄ The E-Mail takes place only if an e-mail address was determined, since the outer Entity property rule checks whether a 'Value' was determined (Not rule, Is empty). If necessary, a more complex checking logic should be used in practice instead of checking for the '@' symbol. |
|