Data Factory > exchange-receive-items β
TIP
The full documentation of the behavior of this task is detailed in the Learning Center.
Technical details β
Please note: Item publication is only available in the following cases
- The table can only have a single level
- Publication is only possible from a shared context (a supplier account) to the context of the table owner (the distributor).
More details in the document dealing with the publication/collection mechanism.
TIP
If at least one task parameters (whether mandatory or not) is invalid, task execution is stopped and the returned status is FAILED. For example:
- The proposed value for the
existproperty is invalid.
| Property | Description |
|---|---|
exist | Mandatory - Enum - SUGGEST, UPDATEDefines the behavior to adopt when collecting suggestions on an item (if it exists in the target table). SUGGEST: Propose an update to the userUPDATE: Automatically applies all suggested updates |
matching | Mandatory - Object Allows you to define reconciliation rules between items that have been published and items present in the target table. |
matching.first | Mandatory - String The key of the first identifier to be taken into account when reconciling items |
matching.second | String The second identifier key |
matching.third | String The key to the third identifier |
matching.fourth | String The key to the fourth identifier |
matching.fifth | String The key to the fifth identifier |
handleDeletedValues | Boolean Enables to collect deleted field values from partner so that users can see and accept fields deletion and update their items |
TIP
The handleDeletedValues parameter allows to compare the current version of the item and the last published version of it (the last publication made). So if the current item does not have a value for a field, and the last suggestion contains a value for it, then deletion will be suggested in the suggestion sent to the partner.
Les sorties β
Status management β
- If the publication of suggestions on an item succeeds
- The suggestion status is then
SENT
- The suggestion status is then
- If the reception (collect) of the suggestion on an item succeeds
- The suggestion status is then
RECEIVED
- The suggestion status is then
- If the reception (collect) of the suggestion on an item fails (see error cases)
- The suggestion status is then
REJECTED
- The suggestion status is then
- If the suggestion on an item is applied
- The item is created/updated
- The suggestion status is then
ACKNOWLEDGED
Error case β
When the task exchange-receive-items fails on a suggestion, a comment is automatically created on the suggestion with the explanation of the error so that the user who published the suggestion can know, understand what happened and act on it.
The comment created is made of :
| Property | Value |
|---|---|
| Sender | First name and last name of the user who launched the task exchange-send-itemsIn case of automatic execution, it is the name of the account which launched the task exchange-send-items. |
| Receiver | The name of the account which launched the task exchange-send-items. |
| Date & Time | The date and time of the suggestion collect failure. |
| Content | The error message faced by the task exchanged-received-items.See below |
| Status | open |
| Assignee | The account which launched the task exchange-send-items. |
More detail on comments available here.
More details on item matching β
First example β
Consider the following case:
- Below, 2 items published by a publishing task
+---+-----------------------------+
| | Table (sender account) |
+---+--------------+--------------+
| | Identifier 1 | Identifier 2 |
+---+--------------+--------------+
| | | |
+---+--------------+--------------+
| 1 | A | 1 |
+---+--------------+--------------+
| 2 | Z | 42 |
+---+--------------+--------------+2
3
4
5
6
7
8
9
10
11
- Below are the items on the target table
+---+-----------------------------+
| | Table (receiver account) |
+---+--------------+--------------+
| | Identifier 1 | Identifier 2 |
+---+--------------+--------------+
| | | |
+---+--------------+--------------+
| 1 | A | 1 |
+---+--------------+--------------+
| 2 | B | 2 |
+---+--------------+--------------+
| 3 | C | 42 |
+---+--------------+--------------+2
3
4
5
6
7
8
9
10
11
12
13
- if we consider the following parameters
{
"name": "exchange-receive-items",
"taskReferenceName": "receive_items",
"description": "Receive products",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"exist": "SUGGEST",
"matching": {
"first": "Identifier 2"
}
}
}2
3
4
5
6
7
8
9
10
11
12
13
Result obtained
+---+-----------------------------+---+-----------------------------+
| | Table (receiver account) | | Table (sender account) |
+---+--------------+--------------+---+--------------+--------------+
| | Identifier 1 | Identifier 2 | | Identifier 1 | Identifier 2 |
+---+--------------+--------------+---+--------------+--------------+
| | | | | | |
+---+--------------+--------------+---+--------------+--------------+
| 1 | A | 1 | = | A | 1 |
+---+--------------+--------------+---+--------------+--------------+
| 2 | B | 2 | | | |
+---+--------------+--------------+---+--------------+--------------+
| 3 | C | 42 | = | Z | 42 |
+---+--------------+--------------+---+--------------+--------------+2
3
4
5
6
7
8
9
10
11
12
13
Remarks:
- The user will be offered an update suggestion for item
3,Identifier 1 = Z. - Suggesting a second identifier (
second) in the collect task parameter is optional, and would have had no impact in this case, since all items found their match using only the first suggested identifier.
Second example β
- If we consider the following parameters instead
{
"name": "exchange-receive-items",
"taskReferenceName": "receive_items",
"description": "Receive products",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"exist": "SUGGEST",
"matching": {
"first": "Identifier 1"
}
}
}2
3
4
5
6
7
8
9
10
11
12
13
Result obtained
+---+-----------------------------+---+-----------------------------+
| | Table (receiver account) | | Table (sender account) |
+---+--------------+--------------+---+--------------+--------------+
| | Identifier 1 | Identifier 2 | | Identifier 1 | Identifier 2 |
+---+--------------+--------------+---+--------------+--------------+
| | | | | | |
+---+--------------+--------------+---+--------------+--------------+
| 1 | A | 1 | = | A | 1 |
+---+--------------+--------------+---+--------------+--------------+
| 2 | B | 2 | | | |
+---+--------------+--------------+---+--------------+--------------+
| 3 | C | 42 | | | |
+---+--------------+--------------+---+--------------+--------------+
| | | | = | Z | 42 |
+---+--------------+--------------+---+--------------+--------------+2
3
4
5
6
7
8
9
10
11
12
13
14
15
Remarks:
- In this case, the second published item does not find a match on
Identifier 1. The item will then be created on the target table of the receiving account. - It is not possible to date to prevent the creation of the third item.
Third example β
- If we consider the following parameters instead
{
"name": "exchange-receive-items",
"taskReferenceName": "receive_items",
"description": "Receive products",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"exist": "SUGGEST",
"matching": {
"first": "Identifier 1",
"second": "Identifier 2"
}
}
}2
3
4
5
6
7
8
9
10
11
12
13
14
Result obtained
+---+-----------------------------+---+-----------------------------+
| | Table (receiver account) | | Table (sender account) |
+---+--------------+--------------+---+--------------+--------------+
| | Identifier 1 | Identifier 2 | | Identifier 1 | Identifier 2 |
+---+--------------+--------------+---+--------------+--------------+
| | | | | | |
+---+--------------+--------------+---+--------------+--------------+
| 1 | A | 1 | = | A | 1 |
+---+--------------+--------------+---+--------------+--------------+
| 2 | B | 2 | | | |
+---+--------------+--------------+---+--------------+--------------+
| 3 | C | 42 | = | Z | 42 |
+---+--------------+--------------+---+--------------+--------------+2
3
4
5
6
7
8
9
10
11
12
13
Remarks:
- The second item published does not match the first identifier entered, but matches the second.
- Up to 5 identifiers can be entered
Details on the execution report β
General notes β
- The report follows the execution report standard structure.
Example β
<Report task="exchange-receive-items" start-at="2023-01-20T13:27:54.810Z" task-cid="..." job-cid="..." end-at="2023-01-20T13:28:51.414Z" duration-ms="56604">
<Input name="request">(...)</Input>
<Log type="info" code="ITEM_CREATED">
<Metadata-Collection name="identifiers">
<Metadata name="ean">123</Metadata>
</Metadata>
<Metadata name="tableKey">product</Metadata>
<Metadata name="partitionKey">active</Metadata>
<Message>The following item was imported (and created) successfully.</Message>
</Log>
</Report>2
3
4
5
6
7
8
9
10
11
Available logs β
| code | Message | Metadata | Type | Remarks |
|---|---|---|---|---|
IDENTIFIER_ALREADY_EXISTS | An item with identifier ${identifier.keyName}: ${item[identifier${identifier.typeIndex}]} already exists | partitionKey | error | The current item was not imported |
ITEM_QUOTA_ERROR | The following item was not imported. The quota for the table "${suggestion.screen.table.keyName}" has been reached | quota, identifier, partitionKey, tableKey | error | The current item was not imported |
IDENTIFIER_NOT_FOUND | The following item was not imported. The identifier "${identifierKey}" is missing. | identifiers, partitionKey, tableKey | error | The current item was not imported |
IDENTIFIER_IS_ARCHIVED | The following item was not imported. The identifier "${identifierKey}" is archived. | identifiers, partitionKey, tableKey | error | The current item was not imported |
NO_MATCHING_OPTIONS_RECEIVED | The following item was not imported. No matching options were received. | identifiers, partitionKey, tableKey | error | The current item was not imported |
ITEM_CREATED_IN_COLLECT | The following item was imported (and created) successfully. | identifiersBeforeCollect, identifiersAfterCollect, partitionKey, tableKey | info | The current item was imported |
ITEM_UPDATED_IN_COLLECT | The following item was imported successfully. | identifiersBeforeCollect, identifiersAfterCollect, partitionKey, tableKey | info | The current item was imported |
SUGGESTION_CREATED | A suggestion was successfully created. | identifiers, partitionKey, screenKey | info |