Commit e729494e82c35e2fa452300d5fecfe7d98bde043

Authored by vparomskiy
1 parent 840c0428

add alarm ack/clear event to the Rule Engine

... ... @@ -605,6 +605,12 @@ public abstract class BaseController {
605 605 case ATTRIBUTES_DELETED:
606 606 msgType = DataConstants.ATTRIBUTES_DELETED;
607 607 break;
  608 + case ALARM_ACK:
  609 + msgType = DataConstants.ALARM_ACK;
  610 + break;
  611 + case ALARM_CLEAR:
  612 + msgType = DataConstants.ALARM_CLEAR;
  613 + break;
608 614 }
609 615 if (!StringUtils.isEmpty(msgType)) {
610 616 try {
... ...
... ... @@ -57,6 +57,8 @@ public class DataConstants {
57 57 public static final String ENTITY_UNASSIGNED = "ENTITY_UNASSIGNED";
58 58 public static final String ATTRIBUTES_UPDATED = "ATTRIBUTES_UPDATED";
59 59 public static final String ATTRIBUTES_DELETED = "ATTRIBUTES_DELETED";
  60 + public static final String ALARM_ACK = "ALARM_ACK";
  61 + public static final String ALARM_CLEAR = "ALARM_CLEAR";
60 62
61 63 public static final String RPC_CALL_FROM_SERVER_TO_DEVICE = "RPC_CALL_FROM_SERVER_TO_DEVICE";
62 64
... ...
... ... @@ -30,7 +30,7 @@ import org.thingsboard.server.common.msg.session.SessionMsgType;
30 30 configClazz = EmptyNodeConfiguration.class,
31 31 relationTypes = {"Post attributes", "Post telemetry", "RPC Request from Device", "RPC Request to Device", "Activity Event", "Inactivity Event",
32 32 "Connect Event", "Disconnect Event", "Entity Created", "Entity Updated", "Entity Deleted", "Entity Assigned",
33   - "Entity Unassigned", "Attributes Updated", "Attributes Deleted", "Other"},
  33 + "Entity Unassigned", "Attributes Updated", "Attributes Deleted", "Alarm Acknowledged", "Alarm Cleared", "Other"},
34 34 nodeDescription = "Route incoming messages by Message Type",
35 35 nodeDetails = "Sends messages with message types <b>\"Post attributes\", \"Post telemetry\", \"RPC Request\"</b> etc. via corresponding chain, otherwise <b>Other</b> chain is used.",
36 36 uiResources = {"static/rulenode/rulenode-core-config.js"},
... ... @@ -75,6 +75,10 @@ public class TbMsgTypeSwitchNode implements TbNode {
75 75 relationType = "Attributes Updated";
76 76 } else if (msg.getType().equals(DataConstants.ATTRIBUTES_DELETED)) {
77 77 relationType = "Attributes Deleted";
  78 + } else if (msg.getType().equals(DataConstants.ALARM_ACK)) {
  79 + relationType = "Alarm Acknowledged";
  80 + } else if (msg.getType().equals(DataConstants.ALARM_CLEAR)) {
  81 + relationType = "Alarm Cleared";
78 82 } else if (msg.getType().equals(DataConstants.RPC_CALL_FROM_SERVER_TO_DEVICE)) {
79 83 relationType = "RPC Request to Device";
80 84 } else {
... ...