|
|
@ -84,7 +84,7 @@ public class BaseRuleChainService extends AbstractEntityService implements RuleC |
|
|
private static final int DEFAULT_PAGE_SIZE = 1000; |
|
|
private static final int DEFAULT_PAGE_SIZE = 1000; |
|
|
|
|
|
|
|
|
public static final String INCORRECT_TENANT_ID = "Incorrect tenantId "; |
|
|
public static final String INCORRECT_TENANT_ID = "Incorrect tenantId "; |
|
|
|
|
|
public static final String TB_RULE_CHAIN_INPUT_NODE = "org.thingsboard.rule.engine.flow.TbRuleChainInputNode"; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private RuleChainDao ruleChainDao; |
|
|
private RuleChainDao ruleChainDao; |
|
|
|
|
|
|
|
|
@ -566,6 +566,19 @@ public class BaseRuleChainService extends AbstractEntityService implements RuleC |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (!CollectionUtils.isEmpty(metaData.getNodes())) { |
|
|
|
|
|
metaData.getNodes().stream() |
|
|
|
|
|
.filter(ruleNode -> ruleNode.getType().equals(TB_RULE_CHAIN_INPUT_NODE)) |
|
|
|
|
|
.forEach(ruleNode -> { |
|
|
|
|
|
ObjectNode configuration = (ObjectNode) ruleNode.getConfiguration(); |
|
|
|
|
|
if (configuration.has("ruleChainId")) { |
|
|
|
|
|
if (configuration.get("ruleChainId").asText().equals(oldRuleChainId.toString())) { |
|
|
|
|
|
configuration.put("ruleChainId", newRuleChainId.toString()); |
|
|
|
|
|
ruleNode.setConfiguration(configuration); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|