Item Statuses During Composition
During the composition phase of the Data Hub lifecycle, statuses are updated for all raw items, and assigned to the newly created canonical items. Raw Item statuses indicate whether an item has been successfully composed into a canonical item. Canonical item statuses determine whether the canonical item appears in future publication actions.
Composition actions correspond to a particular data pool. As a composition action executes, statuses for all raw items, and newly created canonical items in that pool are updated.
Raw Item Status
During composition, each raw item is assigned a new status based on the result of the composition process.
- If the item is composed, either successfully or unsuccessfully, it is assigned a new status of PROCESSED.
- If the item is filtered out with a custom composition handler, no attempt is made to compose it as has a status of IGNORED.
At the end of the composition process, there are no more raw items with a status of PENDING in the corresponding data pool.
Canonical Item Status
The status for canonical items is based on the result of the composition of corresponding raw items. Data Hub currently supports five different statuses for canonical items, four of which are relevant to the composition process.
- If the item is composed successfully, it is assigned a status of SUCCESS.
- If the item is composed successfully but the corresponding raw item was marked with the delete flag, it is assigned a status of DELETED.
- If the item could not be composed successfully, it is assigned a status of ERROR.
- If there is already a canonical item with the same integration key, the following occurs:
- If the raw item delete flag is not true, the incoming and existing items are merged to form a new item (with status SUCCESS). The two old items are then assigned a status of ARCHIVED.
- If the raw item delete flag is true, the incoming raw item becomes a new canonical item with status DELETED. If the status of the old item was SUCCESS, it changes to ARCHIVED.
A complete overview of the composition flow and assignment of these three statuses is provided in the following diagram:
Overview of the Statuses
SUCCESS
If the canonical item was composed successfully with no errors, the newly created canonical item gets assigned a status of SUCCESS. There can only be one canonical item with a status of SUCCESS per integration key in the same pool
ERROR
If a canonical item was not composed successfully, it is assigned a status of ERROR. There are two reasons why an item is not composed successfully:
- Invalid Primary Key: An invalid primary key occurs when an attribute marked as a primary key in the canonical item metadata is populated with null, or an empty string. In this case an integration key cannot be generated for that item, and results in the canonical item having a status of ERROR.
- Invalid Locale: Invalid locale occurs when an attribute is marked as localizable but has a null value for isoCode. This results in an item having a value for the localizable attribute. However, it does not have a language set. This also results in the canonical item having a status of ERROR.
ARCHIVED
A status of ARCHIVED occurs when you update an existing canonical item. You can update an item by successfully composing a new canonical item that has the same exact value for the integration key as the existing item. At this point, you have two (A and B) canonical items with the same integration key and a status of SUCCESS. The two items are merged by taking all attributes from the newly created item, as well as attributes that were populated in the older canonical item. Data Hub then places those values into a third canonical item (C). When the attributes are the same, the most recent canonical item A attributes override the previous version ) attributes. The third canonical item (C) contains all of the merged attribute values and has a status of SUCCESS. If A and B contain the exact same attributes, then C contains only the attributes from B. When the merge is completed, the two canonical items (A and B) used for the merge are assigned a status of ARCHIVED. The result is only one canonical item (C) having a status of SUCCESS.
Note that if the updated raw item has the delete flag set to true, the merge process does not occur. Instead, the status of the existing canonical item is changed as shown in the preceding diagram.
DELETED
The DELETED status is unique, as it can be used to delete canonical items that have been already loaded on a system. This deletion behavior is the default for DELETED items entering Platform. It can also be implemented for any other target system in a custom adapter. For a more detailed description of this functionality, see Changing a Canonical Item During Composition.
Only canonical items with a status of either SUCCESS, or DELETED if the adapter supports it, are published to a target system. Any canonical items with other statuses are ignored during publication.