Last modified by Hera Guo on 2024/11/11 16:48

From version 1.1
edited by Hera Guo
on 2024/10/31 12:04
Change comment: There is no comment for this version
To version 2.1
edited by Hera Guo
on 2024/10/31 14:53
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -59,18 +59,172 @@
59 59  
60 60  === 6.1.1 check fidles presence ===
61 61  
62 +
63 +(% id="cke_bm_11489S" style="display:none" %) (%%)This rule node is used to verify the existence of certain attributes in the message body or metadata, and distribute the message based on the verification results. The configuration content of this node includes:
64 +
65 +* **Name:** required field, indicating the name of the node;
66 +* **Message field names:** The name of the attribute to be verified in the message body, which is the content of the message actively sent by the device. Multiple attributes can be configured here, and after entering each attribute, press' Enter 'to enter;
67 +* **Metadata field names:** The attribute names that need to be validated in the message metadata. The metadata is the data attached to the system and generally includes three metadata attributes: DeviceType, DeviceName, and ts. Multiple attributes can be configured here, and after entering each attribute, press' Enter 'to enter;
68 +* **Check that all specified fields are present: **Select the box, and when performing the above attribute verification, connect each verification condition with "and"; When not selected, during the above attribute verification, each verification condition is connected by "or";
69 +* **Explanation: **Non mandatory field, additional explanation;
70 +
71 +According to the judgment result, there are two types of exits for this rule node: true and false.
72 +
73 +A simple usage example is as follows:
74 +
75 +
76 +[[image:1730353965218-437.png||height="724" width="1374"]]
77 +
62 62  === 6.1.2 script ===
63 63  
80 +
81 +
82 +(% id="cke_bm_12553S" style="display:none" %) (%%)This rule node allows developers to implement data filtering through programming, that is, to distribute messages using custom filtering rules. The configuration content of this node includes:
83 +
84 +* **Name:** required field, indicating the name of the node;
85 +* **Function Filter:** Code (customizing filtering rules through code), the function parameters include msg (message), metadata (metadata), msgType (message type pushed by the previous node), and the return value should be a Boolean value;
86 +* **Explanation:** Non mandatory field, additional explanation;
87 +
88 +According to the code logic, there are two types of exits for this rule node: true and false.
89 +
90 +A simple usage example is as follows:
91 +
92 +
93 +[[image:1730354366308-318.png||height="708" width="1374"]]
94 +
64 64  === 6.1.3 switch ===
65 65  
97 +
98 +
99 +This rule node allows developers to implement data grouping filtering through programming, that is, to distribute data using custom distribution rules. The configuration content of this node includes:
100 +
101 +* **Name:** required field, indicating the name of the node;
102 +* **Function Switch: **Code (customizing grouping rules through code), function parameters include msg (message), metadata (metadata), msgType (message type pushed by the previous node), return value should be a string array, indicating the path to be distributed;
103 +* **Explanation: **Non mandatory field, additional explanation;
104 +
105 +According to the code logic, the exit of this rule node is defined by the coding personnel, as shown in the example.
106 +
107 +A simple usage example is as follows
108 +
109 +{{code language="none"}}
110 +if (msg.temperature > 25) {
111 + return ['High temperature'];
112 +} else if (msg.temperature < 18) {
113 + return ['Low temperature'];
114 +} else {
115 + return ['Normal temperature'];
116 +}
117 +
118 +{{/code}}
119 +
120 +(% class="wikigeneratedid" %)
121 +(((
122 +The above code defines three exits, namely High temperature, Low temperature, and Normal temperature. Therefore, when connecting to the next node, we need to customize the connection according to our defined exit path, as shown in the following figure. After completing the input, press "Enter" to create a link label, and then click "Add".
123 +)))
124 +
125 +(% class="wikigeneratedid" %)
126 +(((
127 +
128 +)))
129 +
130 +(% class="wikigeneratedid" %)
131 +(((
132 +[[image:1730355203367-790.png||height="715" width="1392"]]
133 +)))
134 +
135 +(% class="wikigeneratedid" %)
136 +(((
137 +[[image:1730355288161-463.png||height="725" width="1390"]]
138 +)))
139 +
66 66  == 6.2 properties ==
67 67  
68 68  === 6.2.1 calculate delta ===
69 69  
144 +
145 +
146 +
147 +
148 +This rule node is used to calculate the difference between the data in this message and the corresponding data in the previous message, and to refine and distribute the message content based on the calculation results. The configuration content of this node includes:
149 +
150 +* **Name:** required field, indicating the name of the node;
151 +* **Input value Key:** required field, the name of the attribute to be incrementally calculated;
152 +* **Output value Key:** required field, the attribute name of the incremental value calculated and added to the message body;
153 +* **Decimals: **Accuracy of incremental computation;
154 +* **Use cache:** Select option to store the value of the previous data in memory, checked by default;
155 +* **Tell Failure if delta is negative:** Select option. If the increment value is negative, it is considered a message processing failure and is checked by default;
156 +* **Add period between messages: **Select option to add the time difference from the previous message in the message body, not checked by default. After selecting, you need to fill in the Period value key as the attribute name added to the message body as the calculated time difference;
157 +* **Exclude zero deltas from outbound message:**Only output data with delta difference non-zero.
158 +* **Explanation:** Non mandatory field, additional explanation;
159 +
160 +According to the running results, there are three types of exits for this rule node:** Success**, **Failure**, and **Other**:
161 +
162 +* **Success:** The data export for successful incremental calculation;
163 +* **Failure:** The data exit for message processing failure. If Tell Failure if delta is negative is checked, the data with a negative increment will be calculated and output from this exit;
164 +* **Other:** The data export for the attribute value to be incrementally calculated is missing from the message;
165 +
166 +A simple usage example is as follows:
167 +
168 +
169 +
170 +[[image:1730356036784-417.png||height="734" width="1378"]]
171 +
172 +
173 +
174 +
175 +
70 70  === 6.2.2 customer attributes ===
71 71  
178 +
179 +
180 +
181 +
182 +This rule node is used to add some attributes configured for users to the metadata of messages and distribute data based on the processing results. The configuration content of this node includes:
183 +
184 +* **Name:** required field, indicating the name of the node;
185 +* **Latest telemetry:** a selection option that will retrieve the latest attribute values reported remotely by the client based on the configured key. Unchecking it will query the server attributes of the client to which the device belongs, and it will be unchecked by default;
186 +* **Source telemetry key:** input item, the name of the customer attribute to be added to the message metadata;
187 +* **Target attribute: **Input item, the attribute name to be added to the message metadata, which appears in conjunction with the Source telemetry key and can add multiple pairs of attributes;
188 +* **Explanation: **Non mandatory field, additional explanation;
189 +
190 +According to the running results, there are two types of exits for this rule node: Success and Failure. When the customer to which the device belongs is not configured, data is output from the Failure exit.
191 +
192 +This involves setting user attributes, which can be configured as follows.
193 +
194 +
195 +[[image:1730357095598-358.png||height="717" width="1377"]]
196 +
197 +
198 +A simple example of using this rule node is as follows:
199 +
200 +
201 +[[image:1730357340823-311.png||height="613" width="1372"]]
202 +
203 +
204 +
72 72  === 6.2.3 customer details ===
73 73  
207 +
208 +
209 +
210 +
211 +This rule node is used to add some detailed information configured for users to the message and distribute data based on the processing results. The configuration content of this node includes:
212 +
213 +* **Name:** required field, indicating the name of the node;
214 +* **Select entity details: **Multiple options, select the detailed information of the customer to be added to the message (the information configured when creating the customer, including country, city, address, email, etc.), and the attribute name format of the added information is "customer-specific content name";
215 +* **Add selected details to message metadata:** If checked, the corresponding information will be added to the metadata and passed to downstream nodes; If not checked, the corresponding information will be added to the data and passed to downstream nodes. Not selected by default;
216 +* **Explanation: **Non mandatory field, additional explanation;
217 +
218 +According to the running results, there are two types of exits for this rule node: Success and Failure. When the customer to which the device belongs is not configured, data is output from the Failure exit.
219 +
220 +A simple usage example is as follows:
221 +
222 +
223 +
224 +[[image:1730357528275-219.png||height="711" width="1387"]]
225 +
226 +
227 +
74 74  === 6.2.4 tenant attributes ===
75 75  
76 76  === 6.2.5 tenant details ===
1730353965218-437.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.hera
Size
... ... @@ -1,0 +1,1 @@
1 +317.8 KB
Content
1730354366308-318.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.hera
Size
... ... @@ -1,0 +1,1 @@
1 +310.8 KB
Content
1730355203367-790.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.hera
Size
... ... @@ -1,0 +1,1 @@
1 +306.8 KB
Content
1730355288161-463.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.hera
Size
... ... @@ -1,0 +1,1 @@
1 +312.5 KB
Content
1730356036784-417.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.hera
Size
... ... @@ -1,0 +1,1 @@
1 +322.9 KB
Content
1730357095598-358.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.hera
Size
... ... @@ -1,0 +1,1 @@
1 +295.9 KB
Content
1730357340823-311.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.hera
Size
... ... @@ -1,0 +1,1 @@
1 +284.3 KB
Content
1730357528275-219.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.hera
Size
... ... @@ -1,0 +1,1 @@
1 +311.5 KB
Content