enrichment.ts
9.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
export default {
title: 'Enrichment',
description: 'Add additional information to message metadata',
calculateDelta: {
name: 'Calculate delta',
details:
"Calculates delta and period based on the previous time-series reading and current data. Delta calculation is done in scope of the message originator, e.g. device, asset or customer. If there is input key, the output relation will be 'Success' unless delta is negative and corresponding configuration parameter is set. If there is no input value key in the incoming message, the output relation will be 'Other'.",
description:
"Calculates and adds 'delta' value into message based on the incoming and previous value",
fields: {
inputValueKey: 'Input value key',
outputValueKey: 'Output value key',
round: 'Decimals',
useCache: 'Use cache for latest value',
tellFailureIfDeltaIsNegative: 'Tell Failure if delta is negative',
addPeriodBetweenMsgs: 'Add period between messages',
periodValueKey: 'Period value key',
},
},
customerAttributes: {
name: 'Customer attributes',
details:
'If Attributes enrichment configured, server scope attributes are added into Message metadata. If Latest Telemetry enrichment configured, latest telemetry added into metadata. To access those attributes in other nodes this template can be used <code>metadata.temperature</code>.',
description: 'Add Originators Customer Attributes or Latest Telemetry into Message Metadata',
fields: {
attrMapping: 'Attributes mapping',
telemetry: 'Latest telemetry',
originalAttr: 'Original attribute',
targetAttr: 'Target attribute',
attrMappingDesc: `"Note: use the <b> \${'{</b> metadataKey <b>} '} </b> said the values in the metadata, <b> $[</b> messageKey <b>] </b> said the values in the message body. Use the "Source" and "Target" key names instead. "`,
},
},
customerDetails: {
name: 'Customer details',
details:
'If checkbox: <b>Add selected details to the message metadata</b> is selected, existing fields will be added to the message metadata instead of message data.<br><br><b>Note:</b> only Device, Asset, and Entity View type are allowed.<br><br>If the originator of the message is not assigned to Customer, or originator type is not supported - Message will be forwarded to <b>Failure</b> chain, otherwise, <b>Success</b> chain will be used.',
description: 'Adds fields from Customer details to the message body or metadata',
fields: {
detailsList: 'Select entity details',
addToMetadata: 'Add selected details to message metadata',
},
},
originatorAttributes: {
name: 'Originator attributes',
details:
'If Attributes enrichment configured, <b>CLIENT/SHARED/SERVER</b> attributes are added into Message metadata with specific prefix: <i>cs/shared/ss</i>. Latest telemetry value added into metadata without prefix. To access those attributes in other nodes this template can be used <code>metadata.cs_temperature</code> or <code>metadata.shared_limit</code> ',
description: 'Add Message Originator Attributes or Latest Telemetry into Message Metadata',
fields: {
getLatestValueWithTsDesc:
'Message metadata, for example, "temp": "{\'{"ts":1574329385897, "value":42}\'}"',
tellFailureIfAbsent: 'Tell Failure',
clientAttributeNames: 'Client attributes',
sharedAttributeNames: 'Shared attributes',
serverAttributeNames: 'Server attributes',
latestTsKeyNames: 'Latest timeseries',
getLatestValueWithTs: 'Fetch Latest telemetry with Timestamp',
},
},
originatorFields: {
name: 'Originator fields',
details:
'Will fetch fields values specified in mapping. If specified field is not part of originator fields it will be ignored.',
description: 'Add Message Originator fields values into Message Metadata',
fields: {
fieldsMapping: 'Fields mapping',
fieldsMappingHelp:
'Allowed initiator type: Tenant, Customer, User, Device, Alarm, and rule chain',
entityField: 'Field of entity',
targetAttr: 'Target attribute',
},
},
originatorTelemetry: {
name: 'Originator telemetry',
details:
'The node allows you to select fetch mode: <b>FIRST/LAST/ALL</b> to fetch telemetry of certain time range that are added into Message metadata without any prefix. If selected fetch mode <b>ALL</b> Telemetry will be added like array into Message Metadata where <b>key</b> is Timestamp and <b>value</b> is value of Telemetry.</br>If selected fetch mode <b>FIRST</b> or <b>LAST</b> Telemetry will be added like string without Timestamp.</br>Also, the rule node allows you to select telemetry sampling order: <b>ASC</b> or <b>DESC</b>. </br>Aggregation feature allows you to fetch aggregated telemetry as a single value by <b>AVG, COUNT, SUM, MIN, MAX, NONE</b>. </br><b>Note</b>: The maximum size of the fetched array is 1000 records.\n ',
description: 'Add Message Originator Telemetry for selected time range into Message Metadata\n',
fields: {
latestTsKeyNames: 'Timeseries key',
aggregation: 'Data aggregation function',
fetchMode: 'Fetch Mode',
orderBy: 'Order by',
limit: 'Limit',
useMetadataIntervalPatterns: 'Use interval patterns',
startInterval: 'Start interval',
startIntervalTimeUnit: 'Start interval time unit',
endInterval: 'End interval',
endIntervalTimeUnit: 'End interval time unit',
startIntervalPattern: 'Start interval pattern',
endIntervalPattern: 'End interval pattern',
},
},
relatedAttributes: {
name: 'Related attributes',
details:
'Related Entity found using configured relation direction and Relation Type. If multiple Related Entities are found, only first Entity is used for attributes enrichment, other entities are discarded. If Attributes enrichment configured, server scope attributes are added into Message metadata. If Latest Telemetry enrichment configured, latest telemetry added into metadata. To access those attributes in other nodes this template can be used <code>metadata.temperature</code>.',
description:
'Add Originators Related Entity Attributes or Latest Telemetry into Message Metadata',
fields: {
relationsQuery: 'Relations query',
attrMapping: 'Attributes mapping',
telemetry: 'Latest telemetry',
},
},
relatedDeviceAttributes: {
name: 'Related device attributes',
details:
'If Attributes enrichment configured, <b>CLIENT/SHARED/SERVER</b> attributes are added into Message metadata with specific prefix: <i>cs/shared/ss</i>. Latest telemetry value added into metadata without prefix. To access those attributes in other nodes this template can be used <code>metadata.cs_temperature</code> or <code>metadata.shared_limit</code>',
description:
'Add Originators Related Device Attributes and Latest Telemetry value into Message Metadata',
fields: {
deviceRelationsQuery: 'DeviceRelationsQuery',
tellFailureIfAbsent: 'Tell Failure',
clientAttributeNames: 'Client attributes',
sharedAttributeNames: 'Shared attributes',
serverAttributeNames: 'Server attributes',
latestTsKeyNames: 'Latest timeseries',
getLatestValueWithTs: 'Fetch Latest telemetry with Timestamp',
fetchLastLevelOnly: 'Obtain only the last level of association',
direction: 'Direction',
maxLevel: 'Max relation level',
relationType: 'Association type',
deviceTypes: 'Device Type',
},
},
tenantAttributes: {
name: 'Tenant attributes',
details:
'If Attributes enrichment configured, server scope attributes are added into Message metadata. If Latest Telemetry enrichment configured, latest telemetry added into metadata. To access those attributes in other nodes this template can be used <code>metadata.temperature</code>.',
description: 'Add Originators Tenant Attributes or Latest Telemetry into Message Metadata',
fields: {
attrMapping: 'Attribute Mapping',
telemetry: 'Latest telemetry',
originalAttr: 'Original attribute',
targetAttr: 'Target attribute',
attrMappingDesc: `"Note: use the <b> \${'{</b> metadataKey <b>} '} </b> said the values in the metadata, <b> $[</b> messageKey <b>] </b> said the values in the message body. Use the "Source" and "Target" key names instead. "`,
},
},
tenantDetails: {
name: 'Tenant details',
details:
'If checkbox: <b>Add selected details to the message metadata</b> is selected, existing fields will be added to the message metadata instead of message data.<br><br><b>Note:</b> only Device, Asset, and Entity View type are allowed.<br><br>If the originator of the message is not assigned to Tenant, or originator type is not supported - Message will be forwarded to <b>Failure</b> chain, otherwise, <b>Success</b> chain will be used.',
description: 'Adds fields from Tenant details to the message body or metadata',
fields: {
detailsList: 'Add selected details to message metadata',
addToMetadata: 'Select entity details',
},
},
originatorAttributesNameEnum: {
fields: {
tellFailureIfAbsent: 'Tell Failure',
clientAttributeNames: 'Client attributes',
sharedAttributeNames: 'Shared attributes',
serverAttributeNames: 'Server attributes',
latestTsKeyNames: 'Latest timeseries',
getLatestValueWithTs: 'Fetch Latest telemetry with Timestamp',
},
},
originator: {
fields: {
fieldsMapping: 'Fields mapping',
},
},
};