Showing
3 changed files
with
5 additions
and
1 deletions
... | ... | @@ -249,6 +249,7 @@ public final class EdgeGrpcSession implements Cloneable { |
249 | 249 | break; |
250 | 250 | } |
251 | 251 | if (entityId != null) { |
252 | + final EntityId finalEntityId = entityId; | |
252 | 253 | ListenableFuture<List<AttributeKvEntry>> ssAttrFuture = ctx.getAttributesService().findAll(edge.getTenantId(), entityId, DataConstants.SERVER_SCOPE); |
253 | 254 | Futures.transform(ssAttrFuture, ssAttributes -> { |
254 | 255 | if (ssAttributes != null && !ssAttributes.isEmpty()) { |
... | ... | @@ -267,7 +268,7 @@ public final class EdgeGrpcSession implements Cloneable { |
267 | 268 | entityNode.put(attr.getKey(), attr.getValueAsString()); |
268 | 269 | } |
269 | 270 | } |
270 | - TbMsg tbMsg = new TbMsg(UUIDs.timeBased(), DataConstants.ATTRIBUTES_UPDATED, entityId, metaData, TbMsgDataType.JSON | |
271 | + TbMsg tbMsg = new TbMsg(UUIDs.timeBased(), DataConstants.ATTRIBUTES_UPDATED, finalEntityId, metaData, TbMsgDataType.JSON | |
271 | 272 | , objectMapper.writeValueAsString(entityNode) |
272 | 273 | , null, null, 0L); |
273 | 274 | log.debug("Sending donwlink entity data msg, entityName [{}], tbMsg [{}]", entityName, tbMsg); | ... | ... |
... | ... | @@ -27,6 +27,7 @@ import org.thingsboard.server.common.data.id.EntityId; |
27 | 27 | import org.thingsboard.server.common.data.id.TenantId; |
28 | 28 | import org.thingsboard.server.common.data.rule.RuleChain; |
29 | 29 | import org.thingsboard.server.common.data.rule.RuleChainMetaData; |
30 | +import org.thingsboard.server.common.data.rule.RuleChainType; | |
30 | 31 | import org.thingsboard.server.common.data.widget.WidgetType; |
31 | 32 | import org.thingsboard.server.common.data.widget.WidgetsBundle; |
32 | 33 | import org.thingsboard.server.dao.dashboard.DashboardService; |
... | ... | @@ -114,6 +115,7 @@ public class InstallScripts { |
114 | 115 | RuleChainMetaData ruleChainMetaData = objectMapper.treeToValue(ruleChainJson.get("metadata"), RuleChainMetaData.class); |
115 | 116 | |
116 | 117 | ruleChain.setTenantId(tenantId); |
118 | + ruleChain.setType(RuleChainType.SYSTEM); | |
117 | 119 | ruleChain = ruleChainService.saveRuleChain(ruleChain); |
118 | 120 | |
119 | 121 | ruleChainMetaData.setRuleChainId(ruleChain.getId()); | ... | ... |