Singular attribute
Rule types – Abstract
Purpose: In the context of a reference object (entity type must be attribute owner), a specific 'Singular attribute' is returned that can be accessed in read and write mode.
The Singular attribute value resolver allows access to a singular attribute of an entity. It expects an entity as a reference object, that is considered as an 'Attribute owner' according to its type (see Attribut (Wertauflöser)) and whose data model provides at least one singular attribute. Its specific data structure can be read and write accessed via the return value of the value resolver. A write access implies the creation of the attribute, even if it does not yet exist.
The Singular attribute parameter specifies the type of singular attribute to be returned.
►NOTE◄ In principle, the Attribute value resolver could also be used to access a singular attribute of a particular type. However, this formally returns a list with exactly one or no instance of the attribute.
In the context of the default entities predefined in the various Lobster Data Platform / Orchestration name modules, singular attributes do not play a role as long as specific extensions are not implemented through Custom type definition. Instead, typed attributes of different types are almost always used (see Geschäftsobjekte und Attribute) to assign 'singular' data to an entity.
In connection with specific add-on modules (General, GLS, IDS, TOF), singular attributes appear for Company accounts, each offering all fields for specific 'add-ons' bundled in a single attribute in the company account.
Configuration
The Singular attribute value resolver expects a reference object whose data model can contain at least one singular attribute.
The Singular attribute parameter provides a static single selection for the attribute type to be accessed. As long as the context of the configuration does not refer to a specific entity type, all types of singular attributes that the system supports will appear for selection (due to the installation and licensing of modules). Whether the Role of session has permissions for the specific add-on modules for Company accounts (see above) is not important for the options when configuring the value resolver. 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 types of singular attributes that are explicitly implemented in the relevant data model appear for selection. On the right, within a company account, an erroneous attempt is made to access the singular attributes for 'add-ons' within the 'address' (address) of the company. The dropdown then shows no entries to choose from, because the singular attributes for 'add-ons' are directly in the attributes accounts of the company account and not within the address of the company. |
|
If no Singular attribute is selected, then the return value of the resolver is always 'no value' (null).
If a selected Singular attribute of the type of reference object present at runtime is not supported, the return value is also 'no value' (null).
If the reference object present at runtime supports the selected Singular attribute, but the reference object does not contain any relevant data, 'no value' (null) is also returned.
Example
An entity type defined via Custom type definition is intended to map the master data of discrete 'storage capacities' (e.g. within a building, site or vehicle). For identification purposes and, if necessary, as a basis for calculations for loading (weight & balance), it should be possible to define the position of each 'storage capacity' relative to a reference point by three coordinates (x, y, z).
The 'position information' (i.e. the coordinate triplet) is summarized in a user-defined singular attribute (see Custom type definition).
When copying an existing 'storage capacity', this attribute should be deleted automatically, so that the coordinates in the copy must always be assigned by starting from empty input fields.
Runtime example:
Display in the form |
Entity in XML format |
|
<cst:StorageCapacity ...> <name>LEFT/REAR BAGGAGE HOLD</name> ... <attributes> ... <cst:StoragePositionXyz id= "2" ...> <value x= "-0.65" y= "3.75" z= "-1.2" /> </cst:StoragePositionXyz> ... </attributes> </cst:StorageCapacity> |
Configuration:
An event handler that reacts to 'Copy' (see Common action event as a Triggering event is configured as shown on the right:
|
|