use of org.thingsboard.server.common.data.rule.RuleChainData in project thingsboard by thingsboard.
the class BaseRuleChainService method exportTenantRuleChains.
@Override
public RuleChainData exportTenantRuleChains(TenantId tenantId, PageLink pageLink) {
Validator.validateId(tenantId, "Incorrect tenant id for search rule chain request.");
Validator.validatePageLink(pageLink);
PageData<RuleChain> ruleChainData = ruleChainDao.findRuleChainsByTenantId(tenantId.getId(), pageLink);
List<RuleChain> ruleChains = ruleChainData.getData();
List<RuleChainMetaData> metadata = ruleChains.stream().map(rc -> loadRuleChainMetaData(tenantId, rc.getId())).collect(Collectors.toList());
RuleChainData rcData = new RuleChainData();
rcData.setRuleChains(ruleChains);
rcData.setMetadata(metadata);
setRandomRuleChainIds(rcData);
resetRuleNodeIds(metadata);
return rcData;
}
Aggregations