Browse Source

added field notifyDevice for TbMsgAttributesNode in demo data

pull/3548/head
YevhenBondarenko 6 years ago
committed by Andrew Shvayka
parent
commit
b925149e7a
  1. 3
      application/src/main/data/json/demo/rule_chains/root_rule_chain.json
  2. 3
      application/src/main/data/json/tenant/rule_chains/root_rule_chain.json
  3. 6
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/telemetry/TbMsgAttributesNode.java

3
application/src/main/data/json/demo/rule_chains/root_rule_chain.json

@ -43,7 +43,8 @@
"name": "Save Client Attributes",
"debugMode": false,
"configuration": {
"scope": "CLIENT_SCOPE"
"scope": "CLIENT_SCOPE",
"notifyDevice": "true"
}
},
{

3
application/src/main/data/json/tenant/rule_chains/root_rule_chain.json

@ -31,7 +31,8 @@
"name": "Save Client Attributes",
"debugMode": false,
"configuration": {
"scope": "CLIENT_SCOPE"
"scope": "CLIENT_SCOPE",
"notifyDevice": "true"
}
},
{

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

@ -51,6 +51,9 @@ public class TbMsgAttributesNode implements TbNode {
@Override
public void init(TbContext ctx, TbNodeConfiguration configuration) throws TbNodeException {
this.config = TbNodeUtils.convert(configuration, TbMsgAttributesNodeConfiguration.class);
if (config.getNotifyDevice() == null) {
config.setNotifyDevice(true);
}
}
@Override
@ -68,7 +71,8 @@ public class TbMsgAttributesNode implements TbNode {
config.getScope(),
new ArrayList<>(attributes),
new TelemetryNodeCallback(ctx, msg),
config.getNotifyDevice() || StringUtils.isEmpty(notifyDeviceStr) || Boolean.parseBoolean(notifyDeviceStr));
config.getNotifyDevice() || StringUtils.isEmpty(notifyDeviceStr) || Boolean.parseBoolean(notifyDeviceStr)
);
}
@Override

Loading…
Cancel
Save