瀏覽代碼

executor 为空时忽略

zhou-hao 5 年之前
父節點
當前提交
cbbeaa3813

+ 7 - 0
jetlinks-manager/rule-engine-manager/src/main/java/org/jetlinks/community/rule/engine/model/SqlRuleModelParser.java

@@ -10,6 +10,7 @@ import org.jetlinks.rule.engine.api.model.RuleNodeModel;
 import org.jetlinks.rule.engine.model.RuleModelParserStrategy;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -46,6 +47,9 @@ public class SqlRuleModelParser implements RuleModelParserStrategy {
         if (!CollectionUtils.isEmpty(sqlRule.getWhenErrorThen())) {
             int index = 0;
             for (Action act : sqlRule.getWhenErrorThen()) {
+                if (!StringUtils.hasText(act.getExecutor())) {
+                    continue;
+                }
                 RuleNodeModel action = new RuleNodeModel();
                 action.setId("error:action:" + index);
                 action.setName("错误处理:" + index);
@@ -85,6 +89,9 @@ public class SqlRuleModelParser implements RuleModelParserStrategy {
         if (!CollectionUtils.isEmpty(sqlRule.getActions())) {
             int index = 0;
             for (Action operation : sqlRule.getActions()) {
+                if (!StringUtils.hasText(operation.getExecutor())) {
+                    continue;
+                }
                 RuleNodeModel action = new RuleNodeModel();
                 action.setId("action:" + index);
                 action.setName("执行动作:" + index);