Skip to content
Permalink
Browse files

修复错误

  • Loading branch information...
zhou-hao committed Apr 17, 2019
1 parent ec4395e commit d7f3508d7f8d9119c1128827e86a116cd939d7c3
@@ -11,6 +11,7 @@
import org.jetlinks.rule.engine.api.model.*;
import org.jetlinks.rule.engine.api.persistent.RulePersistent;
import org.jetlinks.rule.engine.api.cluster.NodeInfo;
import org.jetlinks.rule.engine.api.persistent.repository.RuleRepository;
import org.jetlinks.rule.engine.cluster.TestExecutor;
import org.jetlinks.rule.engine.cluster.redisson.RedissonClusterManager;
import org.jetlinks.rule.engine.cluster.redisson.RedissonHaManager;
@@ -109,13 +110,21 @@ public RuleModel parse(String format, String modelDefineString) {
return Collections.emptyList();
}
});
ruleEngine.setRuleRepository(ruleId -> {
RulePersistent persistent = new RulePersistent();
persistent.setRuleId(ruleId);
persistent.setModelFormat("re.xml");
persistent.setModel(modelString);
persistent.setId(IDGenerator.MD5.generate());
return Optional.of(persistent);
ruleEngine.setRuleRepository(new RuleRepository() {
@Override
public Optional<RulePersistent> findRuleById(String ruleId) {
RulePersistent persistent = new RulePersistent();
persistent.setRuleId(ruleId);
persistent.setModelFormat("re.xml");
persistent.setModel(modelString);
persistent.setId(IDGenerator.MD5.generate());
return Optional.of(persistent);
}

@Override
public void save(RulePersistent persistent) {

}
});
ruleEngine.start();

0 comments on commit d7f3508

Please sign in to comment.
You can’t perform that action at this time.