Commit 96dfc0691bd86fd3f70d755136e3ec9a2064e42d

Authored by Volodymyr Babak
1 parent f8981638

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

... ... @@ -9,10 +9,24 @@
9 9 "configuration": null
10 10 },
11 11 "metadata": {
12   - "firstNodeIndex": 2,
  12 + "firstNodeIndex": 0,
13 13 "nodes": [
14 14 {
15 15 "additionalInfo": {
  16 + "description": "Process incoming messages from devices with the alarm rules defined in the device profile. Dispatch all incoming messages with \"Success\" relation type.",
  17 + "layoutX": 203,
  18 + "layoutY": 259
  19 + },
  20 + "type": "org.thingsboard.rule.engine.profile.TbDeviceProfileNode",
  21 + "name": "Device Profile Node",
  22 + "debugMode": false,
  23 + "configuration": {
  24 + "persistAlarmRulesState": false,
  25 + "fetchAlarmRulesStateOnStart": false
  26 + }
  27 + },
  28 + {
  29 + "additionalInfo": {
16 30 "layoutX": 823,
17 31 "layoutY": 157
18 32 },
... ... @@ -99,42 +113,47 @@
99 113 "connections": [
100 114 {
101 115 "fromIndex": 0,
102   - "toIndex": 6,
  116 + "toIndex": 3,
103 117 "type": "Success"
104 118 },
105 119 {
106 120 "fromIndex": 1,
107   - "toIndex": 6,
  121 + "toIndex": 7,
108 122 "type": "Success"
109 123 },
110 124 {
111 125 "fromIndex": 2,
112   - "toIndex": 4,
  126 + "toIndex": 7,
  127 + "type": "Success"
  128 + },
  129 + {
  130 + "fromIndex": 3,
  131 + "toIndex": 6,
  132 + "type": "RPC Request to Device"
  133 + },
  134 + {
  135 + "fromIndex": 3,
  136 + "toIndex": 5,
113 137 "type": "Other"
114 138 },
115 139 {
116   - "fromIndex": 2,
117   - "toIndex": 1,
  140 + "fromIndex": 3,
  141 + "toIndex": 2,
118 142 "type": "Post attributes"
119 143 },
120 144 {
121   - "fromIndex": 2,
122   - "toIndex": 0,
  145 + "fromIndex": 3,
  146 + "toIndex": 1,
123 147 "type": "Post telemetry"
124 148 },
125 149 {
126   - "fromIndex": 2,
127   - "toIndex": 3,
  150 + "fromIndex": 3,
  151 + "toIndex": 4,
128 152 "type": "RPC Request from Device"
129 153 },
130 154 {
131   - "fromIndex": 2,
132   - "toIndex": 5,
133   - "type": "RPC Request to Device"
134   - },
135   - {
136   - "fromIndex": 3,
137   - "toIndex": 6,
  155 + "fromIndex": 4,
  156 + "toIndex": 7,
138 157 "type": "Success"
139 158 }
140 159 ],
... ...
... ... @@ -103,7 +103,7 @@ public class DeviceProfileController extends BaseController {
103 103 null,
104 104 savedDeviceProfile.getId() == null ? ActionType.ADDED : ActionType.UPDATED, null);
105 105
106   - sendNotificationMsgToEdgeService(getTenantId(), deviceProfile.getId(), EntityType.DEVICE_PROFILE,
  106 + sendNotificationMsgToEdgeService(getTenantId(), savedDeviceProfile.getId(), EntityType.DEVICE_PROFILE,
107 107 deviceProfile.getId() == null ? EdgeEventActionType.ADDED : EdgeEventActionType.UPDATED);
108 108
109 109 return savedDeviceProfile;
... ...
... ... @@ -38,7 +38,6 @@ public class DeviceProfileMsgConstructor {
38 38 .setIdMSB(deviceProfile.getId().getId().getMostSignificantBits())
39 39 .setIdLSB(deviceProfile.getId().getId().getLeastSignificantBits())
40 40 .setName(deviceProfile.getName())
41   - .setDescription(deviceProfile.getDescription())
42 41 .setDefault(deviceProfile.isDefault())
43 42 .setType(deviceProfile.getType().name())
44 43 .setTransportType(deviceProfile.getTransportType().name())
... ... @@ -52,6 +51,9 @@ public class DeviceProfileMsgConstructor {
52 51 // if (deviceProfile.getDefaultQueueName() != null) {
53 52 // builder.setDefaultQueueName(deviceProfile.getDefaultQueueName());
54 53 // }
  54 + if (deviceProfile.getDescription() != null) {
  55 + builder.setDescription(deviceProfile.getDescription());
  56 + }
55 57 if (deviceProfile.getProvisionDeviceKey() != null) {
56 58 builder.setProvisionDeviceKey(deviceProfile.getProvisionDeviceKey());
57 59 }
... ...