keyAttributesURI options
Learn about the keyAttributes options to manage the behavior of partial overrides when you update entities.
Overview
- keyAttributeURIs: Override the specified nested attributes if all keyAttributes are the same for a crosswalk.
- keyAttributeURIsExactOrAllNull: Override the specified nested attributes if all keyAttributes are the same or missing in both nested attributes of a crosswalk.
- keyAttributeURIsExactOrNull: Override the specified nested attributes if all keyAttributes are the same or are missing in any one nested attribute of a crosswalk.
By default, the keyAttributeURIs nested attribute property is case sensitivity for attribute values, when performing matching for keyAttributes configuration. Set keyAttributeURIsIgnoreCase to true for keyAttributeURIs, keyAttributeURIsExactOrAllNull, and keyAttributeURIsExactOrNull configuration to get case insensitive matching.
- They differ only in the way they compare the values of the specified sub attributes.
- They work only when you update an entity together with using the
enableNestedPartialOverride
andpartialOverride
options. - They don't take into account OV logic.
- They work only at the entity type level.
- They can contain only first-level simple sub attributes of the specified nested attribute.
A validation rule has been added for the keyAttributeURIs
, keyAttributeURIsExactOrAllNull
, and keyAttributeURIsExactOrNull
parameters. For details, see topic L3 validation errors.
Parameter | Default | Description |
---|---|---|
keyAttributeURIs | absent |
Array of sub attribute URIs whose values are compared by
Exact logic:
|
keyAttributeURIsExactOrAllNull | absent |
Array of sub attribute URIs whose values are compared by
Exact or All NULL logic:
|
keyAttributeURIsExactOrNull | absent |
Array of sub attribute URIs whose values are compared by
Exact Or NULL logic:
|
keyAttributeURIsIgnoreCase | false | Will make the sub-attributes (specified in keyAttributeURIs, keyAttributeURIsExactOrAllNull, and keyAttributeURIsExactOrNull) comparison case insensitive if it's set to true. |
Example
Set enableNestedPartialOverride
true
in the physical configuration of the tenant.
The business configuration with entity type HCP
contains the nested attribute License
and the configured keyAttributeURIs
and matchFieldURIs
properties with the list of Number
and State
nested sub-attributes.
Business Configuration
The HCP
entity has two License
nested attribute values, as shown in the Existing Entity example:
Existing Entity
The following partial override update is posted.
Overwrite With the partialOverride
Option
Then, the resulting entity has two values for the License
attribute. The value with Number
=222
remains the same, and the value with Number
=111
is updated (it has a new value for the Category
attribute and no value for the State
).
Result
Lookups
resolveLookupCode
property, and that value is considered as the main (lookup code or lookup value).Example
In this example, you configure your tenant to work with lookups:
Physical Configuration
Lookups
Meta Configuration
Next, create the entity with raw value CA
for State
(the value is equal to the lookup code).
Existing Entity
Result
POST
the following partial override update with the change (the value of State
is equal to the lookup value California
).
Overwrite With the partialOverride
Option
Then, the resulting entity will have overwritten nested values for California
, because it was resolved to the same lookup code CA
. Additionally, it was overwritten because another attribute Number
was also the same.
Result
preserveURIs
partialOverride
and preseveURIs
options with keyAttributeURIs
and enableNestedPartialOverride
logic.Case 1
Override keyAttributesURIs
Value
preserveURIs
option is more robust than the keyAttributeURIs
option.Configure your Meta Configuration
Create the Entity
Existing Entity
Result
Try to change values in the second nested value so that it will collapse with the first nested value (include the preserveURIs
option and attribute/sub-attribute URIs of the second nested value).
Overwrite With the partialOverride
Option
Because preserveURIs
is more robust than keyAttributeURIs
, as a result, the second nested value is overwritten in accordance with uris and was collapsed with the first nested value in accordance with matchFieldURIsExactOrNull
.
Result of the Override