空action不处理

This commit is contained in:
zhou-hao 2020-04-21 14:10:29 +08:00
parent ab86a102d8
commit 1dcafe5f57
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import org.jetlinks.rule.engine.api.model.RuleModel;
import org.jetlinks.rule.engine.api.model.RuleNodeModel;
import org.jetlinks.rule.engine.model.RuleModelParserStrategy;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.Collections;
import java.util.HashMap;
@ -91,6 +92,9 @@ public class DeviceAlarmModelParser implements RuleModelParserStrategy {
if (CollectionUtils.isNotEmpty(rule.getAlarmRule().getActions())) {
int index = 0;
for (Action operation : rule.getAlarmRule().getActions()) {
if (!StringUtils.hasText(operation.getExecutor())) {
continue;
}
RuleNodeModel action = new RuleNodeModel();
action.setId("device_alarm_action:" + index);
action.setName("执行动作:" + index);