Typed attribute projection
Projection – Abstract
Purpose: Enables simplified access to values of typed attributes (without explicit configuration of a Join).
A Typed attribute projection searches the attributes of the attribute owner defined by the context or an explicitly defined Attribute owner path for attributes with the specified Type.
Depending on the optional selection for the Property to be evaluated, either the complete attribute value or the value in the selected Property appears in the return value of the Typed attribute projection.
If the specified (sub)Type is considered a 'plural attribute' according to the relevant dynamic enumeration (e.g. Text type, Numeric types, etc.), then the Typed attribute projection may return several values for the same attribute owner as a list.
The interpretation of multi-value return values depends on the environment in which the Typed attribute projection is used.
For an output column, plural return values can be bundled using a Collection projection.
If several restrictions within a condition refer to the same (sub)Type via several instances of the Typed attribute projection, these are all evaluated for each attribute instance.
►NOTE◄ Internally, the use of a Typed attribute projection implies a Typed attribute join for the relevant Type (Join type: 'LEFT', optional):
|
The Typed attribute projection simplifies access to a Property attribute value:
|
Equivalent: Typed attribute join ...
.., and Property projection
|
If several instances of the Typed attribute projection or explicitly configured Typed attribute join (with the Join type: 'LEFT') refer to the same Type, then only a LEFT JOIN is used 'together'.
Configuration
|
Parameter |
Type |
Description |
|
Name |
String |
The optional Name parameter can be used to assign an (alias) name to the projection.
|
|
Attribute owner path |
Entity |
An Attribute owner path only needs to be explicitly defined by configuring a Projection if the entity in the context of the search is not the owner of the attributes that are evaluated. This is relevant in the following cases, for example:
|
|
Attribute |
Class |
In the Combobox element for the Attribute parameter, a selection must be made from the options for the attribute type offered via a dropdown. Only the attribute types that the entity type of the applicable attribute owner supports per implementation are available for selection here. ►NOTE◄ If no options are available for the Attribute or if options are missing, then the Attribute owner path may not have been set appropriately (e.g. the 'address' of an account for which no attributes are implemented). |
|
Type |
Dynamic enumeration value (subtype) |
The Combobox element for the Type parameter offers values from the dynamic enumeration that relate to the attribute type selected by Attribute (e.g. Text type → Text attribute, Numeric types → Numeric attribute, Company type → Company and address attribute, etc.). ►NOTE◄ The options in the dropdown may be restricted in the context of the configuration by applicable Enumeration filters. However, these have no influence on the processing of already configured searches. |
|
Property |
Property (of the attribute value) |
The Combobox element for the Property allows an optional single selection for one of the properties of the attribute type selected by Attribute.
|
Examples
Simple example: Restriction for a Typed Attribute with singular subtype
In the context of user accounts, a typed attribute is used for the address to qualify 'preferred' users:
Attribute type: 'Flag attribute' (FlagAttribute)
(Sub)type: Flag type: VIP
A custom overview (see Custom overviews) should only display 'VIP users'.
Configuration:
|
The Restriction for the custom overview (see Custom overviews) is defined as a Field restriction as shown on the right:
|
|
More complex example: Display typed attribute with plural subtype in an overview
The Datagrid preferences overview regulates, which display columns can be shown in the context of an overview, among other things. While the Add column function offers predefined column configurations for selection for typed attributes with a singular subtype, projections for typed attributes with a plural subtype must be defined as a 'Custom column' without any corresponding help. Using the example of a typed attribute for the plural Text type 'Container No' (CONTAINER_NO), a possible configuration for this purpose in the context of the entity type 'Shipment' (see Shipments) will be shown.
Configuration:
|
Click on the Add column button to create a new Custom column whose Projection can be configured as shown on the right:
|
|
Runtime example:
|
The screenshot on the right shows sample data for the output of container numbers in the column labeled 'Container':
|
|
►NOTE◄ The brackets ([]) and separators (, ) are not available for filter criteria, but could be processed in the Label expression for the 'Custom column' if required:
|
The Label expression shown on the right uses the $replace() function with a regular expression(^.(.*).$) to eliminate the first and last character – i.e. the square brackets ([]) that are not always desired in the output – by replacement. |
|