Browse Source

Merge pull request #7 from ShvaykaD/feature/delete_attributes_node

add validation for empty list of attributes in save attributes node
pull/7238/head
Yurii 4 years ago
committed by GitHub
parent
commit
4bbcfb1917
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/telemetry/TbMsgAttributesNode.java

4
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/telemetry/TbMsgAttributesNode.java

@ -66,6 +66,10 @@ public class TbMsgAttributesNode implements TbNode {
}
String src = msg.getData();
List<AttributeKvEntry> attributes = new ArrayList<>(JsonConverter.convertToAttributes(new JsonParser().parse(src)));
if (attributes.isEmpty()) {
ctx.tellSuccess(msg);
return;
}
String notifyDeviceStr = msg.getMetaData().getValue("notifyDevice");
ctx.getTelemetryService().saveAndNotify(
ctx.getTenantId(),

Loading…
Cancel
Save