Singular attribute projection
Projection – Abstract
Purpose: Enables simplified access to the values of a singular attribute (without explicit configuration of a Join).
A Singular 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 Singular attribute projection.
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). |
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 use case: Output property of a singular attribute in tuple search
Locations in three-dimensional space are often specified using a triple of numerical coordinates that define a position relative to a specific reference point in space.
The geographical location of a point is often defined, for example, using geocoordinates (angular degrees for longitude and latitude) in conjunction with the height above sea level.
As a custom type definition (see Custom type definition), a custom singular attribute 'PositionXyz' (PositionXyz) is defined, which can store three numerical coordinates (x, y, z) in double properties that can be interpreted as a payload as desired.
This singular attribute can be implemented for any other entities that require a location specification. The reference system for the location information can be completely different for each implementation context.
In the following example, the PositionXyz attribute is used in the context of a custom entity (see Custom type definition) 'Point of Interest' (POI), for which it is to 'encode' geocoordinates with altitude information.
In a tuple search for 'Points of Interest', the height above sea level (the value of the z-coordinate) should appear as an output column.
Configuration:
The screenshot on the right shows the configuration for two output columns of a tuple search:
|
|
Runtime example:
<core:TupleSearchResult maxResults="100" count="123">
<columns>
<name>POI_NAME</name>
<name>ELEVATION_FT_AMSL</name>
</columns>
<result>
<row>
<item xsi:type="xsd:string">GREENWICH_PRIME_MERIDIAN</item>
<item xsi:type="xsd:double">223.0</item>
</row>
<row>
<item xsi:type="xsd:string">TAJ_MAHAL</item>
<item xsi:type="xsd:double">240.0</item>
</row>
<row>
<item xsi:type="xsd:string">TOUR_EIFFEL</item>
<item xsi:type="xsd:double">108.0</item>
</row>
...
</result>
</core:TupleSearchResult>
More complex use case: Display geographic coordinates in text column
In the context of an overview for the entity type 'Point of Interest' (POI) from the previous example, an output column should display the 'Position' in meaningful text form, taking into account all coordinates from the 'PositionXyz' attribute.
Runtime example:
Configuration:
The screenshot on the right shows how a Chained projection for a 'Custom column' can be used in the data grid settings for the overview in order to access the individual values contained in the attribute via a Singular attribute projection:
|
|
►NOTE◄ As the runtime example (above) illustrates, the Double values saved as coordinates appear here with a large number of decimals. When constructing the output string in the context of the Concatenated projection, there is no function available for formatting the numerical values with a limited precision.