Fixed install rule chains
This commit is contained in:
parent
c409e2d9c1
commit
d0214db56c
@ -4,6 +4,7 @@
|
||||
"name": "Root Rule Chain",
|
||||
"firstRuleNodeId": null,
|
||||
"root": true,
|
||||
"type": "SYSTEM",
|
||||
"debugMode": false,
|
||||
"configuration": null
|
||||
},
|
||||
|
||||
@ -249,6 +249,7 @@ public final class EdgeGrpcSession implements Cloneable {
|
||||
break;
|
||||
}
|
||||
if (entityId != null) {
|
||||
final EntityId finalEntityId = entityId;
|
||||
ListenableFuture<List<AttributeKvEntry>> ssAttrFuture = ctx.getAttributesService().findAll(edge.getTenantId(), entityId, DataConstants.SERVER_SCOPE);
|
||||
Futures.transform(ssAttrFuture, ssAttributes -> {
|
||||
if (ssAttributes != null && !ssAttributes.isEmpty()) {
|
||||
@ -267,7 +268,7 @@ public final class EdgeGrpcSession implements Cloneable {
|
||||
entityNode.put(attr.getKey(), attr.getValueAsString());
|
||||
}
|
||||
}
|
||||
TbMsg tbMsg = new TbMsg(UUIDs.timeBased(), DataConstants.ATTRIBUTES_UPDATED, entityId, metaData, TbMsgDataType.JSON
|
||||
TbMsg tbMsg = new TbMsg(UUIDs.timeBased(), DataConstants.ATTRIBUTES_UPDATED, finalEntityId, metaData, TbMsgDataType.JSON
|
||||
, objectMapper.writeValueAsString(entityNode)
|
||||
, null, null, 0L);
|
||||
log.debug("Sending donwlink entity data msg, entityName [{}], tbMsg [{}]", entityName, tbMsg);
|
||||
|
||||
@ -27,6 +27,7 @@ import org.thingsboard.server.common.data.id.EntityId;
|
||||
import org.thingsboard.server.common.data.id.TenantId;
|
||||
import org.thingsboard.server.common.data.rule.RuleChain;
|
||||
import org.thingsboard.server.common.data.rule.RuleChainMetaData;
|
||||
import org.thingsboard.server.common.data.rule.RuleChainType;
|
||||
import org.thingsboard.server.common.data.widget.WidgetType;
|
||||
import org.thingsboard.server.common.data.widget.WidgetsBundle;
|
||||
import org.thingsboard.server.dao.dashboard.DashboardService;
|
||||
@ -114,6 +115,7 @@ public class InstallScripts {
|
||||
RuleChainMetaData ruleChainMetaData = objectMapper.treeToValue(ruleChainJson.get("metadata"), RuleChainMetaData.class);
|
||||
|
||||
ruleChain.setTenantId(tenantId);
|
||||
ruleChain.setType(RuleChainType.SYSTEM);
|
||||
ruleChain = ruleChainService.saveRuleChain(ruleChain);
|
||||
|
||||
ruleChainMetaData.setRuleChainId(ruleChain.getId());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user