Duplicate to Related¶
The Duplicate to Related node copies the msg from the input to the specified asset(s).
Node Type¶
EnOS.
Input and Output Ability¶
This node has 1 entry points and 2 exit points. The output msg for exit point “original” will remain the same as the input msg, while asset IDs of the assets with the copied msg will be added to the output msg for exit point “duplicate to related”.
Node Properties¶
Name
The name for this node.
Specify Asset and Value
The criteria to specify the asset. Select one option from the drop-down.
By asset ID: Enter one or more asset IDs (maximum 8 characters for each asset ID) in the subsequent textfield, separated by commas. The msg will be duplicated to the asset that matches the asset ID.
By tag: Enter one asset tag key (maximum 50 characters) in the subsequent textfield. The msg will be duplicated to all assets with a tag key and value that matches the key and value of what is entered. For example, asset A has a tag key/value
tag1:value1
, asset B has a tag key/valetag1:value1
, asset C has a tag key/valuetag1:value321
, andtag1
is entered in the textfield. The msg will be duplicated to asset B but not asset C.By asset tree parent node: There is no need to enter any value in the subsequent textfield. If the asset ID in the input metadata exists in an asset tree, the msg will be duplicated to the parent node of the asset with the asset ID.
By asset tree child node: There is no need to enter any value in the subsequent textfield. If the asset ID in the input metadata exists in an asset tree, the msg will be duplicated to all the children nodes (first-level) of the asset with the asset ID.
By file mapping: Upload a CSV file with a list of source and target asset IDs. The msg will be duplicated to assets of the target IDs with source IDs that match the
assetId
in the input metadata.
Description
The description for this node.
Limitations¶
By tag
Only one tag key can be specified.
Character limit for tag key is 50.
By asset ID
Character limit for each asset ID is 8.
By file mapping
Max mapping file size is 2MB.
Currently can only upload CSV files as the mapping file.
Input & Output Samples¶
Sample 1¶
Input¶
{
"MetaData": {
"messageType": "PostAttribute",
"assetId": "assetA",
"deviceKey": "deviceKey",
"productKey": "productKey",
"orgId": "yourOrgId"
},
"Body": {
"capacity": 98,
"color": "blue"
}
}
Output 1 - Single Asset¶
{
"MetaData": {
"messageType": "PostAttribute",
"assetId": "assetA",
"deviceKey": "deviceKey",
"productKey": "productKey",
"orgId": "yourOrgId"
},
"Body": {
"capacity": 98,
"color": "blue",
"assetId": "assetB"
}
}
Output 2 - Multiple Assets¶
{
"MetaData": {
"messageType": "PostAttribute",
"assetId": "assetA",
"deviceKey": "deviceKey",
"productKey": "productKey",
"orgId": "yourOrgId"
},
"Body": [
{
"capacity": 98,
"color": "blue",
"assetId": "assetB",
},
{
"capacity": 98,
"color": "blue",
"assetId": "assetC",
},
{
"capacity": 98,
"color": "blue",
"assetId": "assetD",
}
]
}
Sample 2¶
The samples below are based on a CSV mapping file with the following data.
Source Asset ID |
Target Asset ID |
---|---|
source01 |
target01 |
source01 |
target02 |
source02 |
target01 |
source03 |
target02 |
source03 |
target03 |
Input¶
{
"MetaData": {
"messageType": "PostAttribute",
"assetId": "source03",
"deviceKey": "deviceKey",
"productKey": "productKey",
"orgId": "yourOrgId"
},
"Body": {
"capacity": 98,
"color": "blue"
}
}
Output¶
{
"MetaData": {
"messageType": "PostAttribute",
"assetId": "source03",
"deviceKey": "deviceKey",
"productKey": "productKey",
"orgId": "yourOrgId"
},
"Body": [
{
"capacity": 98,
"color": "blue",
"assetId": "target02",
},
{
"capacity": 98,
"color": "blue",
"assetId": "target03",
}
]
}