Browse Source

Added device profile rule node to default edge root. Fixed notification event

pull/3811/head
Volodymyr Babak 6 years ago
parent
commit
96dfc0691b
  1. 53
      application/src/main/data/json/tenant/rule_chains/edge_root_rule_chain.json
  2. 2
      application/src/main/java/org/thingsboard/server/controller/DeviceProfileController.java
  3. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DeviceProfileMsgConstructor.java

53
application/src/main/data/json/tenant/rule_chains/edge_root_rule_chain.json

@ -9,8 +9,22 @@
"configuration": null
},
"metadata": {
"firstNodeIndex": 2,
"firstNodeIndex": 0,
"nodes": [
{
"additionalInfo": {
"description": "Process incoming messages from devices with the alarm rules defined in the device profile. Dispatch all incoming messages with \"Success\" relation type.",
"layoutX": 203,
"layoutY": 259
},
"type": "org.thingsboard.rule.engine.profile.TbDeviceProfileNode",
"name": "Device Profile Node",
"debugMode": false,
"configuration": {
"persistAlarmRulesState": false,
"fetchAlarmRulesStateOnStart": false
}
},
{
"additionalInfo": {
"layoutX": 823,
@ -99,42 +113,47 @@
"connections": [
{
"fromIndex": 0,
"toIndex": 6,
"toIndex": 3,
"type": "Success"
},
{
"fromIndex": 1,
"toIndex": 6,
"toIndex": 7,
"type": "Success"
},
{
"fromIndex": 2,
"toIndex": 4,
"toIndex": 7,
"type": "Success"
},
{
"fromIndex": 3,
"toIndex": 6,
"type": "RPC Request to Device"
},
{
"fromIndex": 3,
"toIndex": 5,
"type": "Other"
},
{
"fromIndex": 2,
"toIndex": 1,
"fromIndex": 3,
"toIndex": 2,
"type": "Post attributes"
},
{
"fromIndex": 2,
"toIndex": 0,
"fromIndex": 3,
"toIndex": 1,
"type": "Post telemetry"
},
{
"fromIndex": 2,
"toIndex": 3,
"fromIndex": 3,
"toIndex": 4,
"type": "RPC Request from Device"
},
{
"fromIndex": 2,
"toIndex": 5,
"type": "RPC Request to Device"
},
{
"fromIndex": 3,
"toIndex": 6,
"fromIndex": 4,
"toIndex": 7,
"type": "Success"
}
],

2
application/src/main/java/org/thingsboard/server/controller/DeviceProfileController.java

@ -103,7 +103,7 @@ public class DeviceProfileController extends BaseController {
null,
savedDeviceProfile.getId() == null ? ActionType.ADDED : ActionType.UPDATED, null);
sendNotificationMsgToEdgeService(getTenantId(), deviceProfile.getId(), EntityType.DEVICE_PROFILE,
sendNotificationMsgToEdgeService(getTenantId(), savedDeviceProfile.getId(), EntityType.DEVICE_PROFILE,
deviceProfile.getId() == null ? EdgeEventActionType.ADDED : EdgeEventActionType.UPDATED);
return savedDeviceProfile;

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DeviceProfileMsgConstructor.java

@ -38,7 +38,6 @@ public class DeviceProfileMsgConstructor {
.setIdMSB(deviceProfile.getId().getId().getMostSignificantBits())
.setIdLSB(deviceProfile.getId().getId().getLeastSignificantBits())
.setName(deviceProfile.getName())
.setDescription(deviceProfile.getDescription())
.setDefault(deviceProfile.isDefault())
.setType(deviceProfile.getType().name())
.setTransportType(deviceProfile.getTransportType().name())
@ -52,6 +51,9 @@ public class DeviceProfileMsgConstructor {
// if (deviceProfile.getDefaultQueueName() != null) {
// builder.setDefaultQueueName(deviceProfile.getDefaultQueueName());
// }
if (deviceProfile.getDescription() != null) {
builder.setDescription(deviceProfile.getDescription());
}
if (deviceProfile.getProvisionDeviceKey() != null) {
builder.setProvisionDeviceKey(deviceProfile.getProvisionDeviceKey());
}

Loading…
Cancel
Save