Commit e729494e82c35e2fa452300d5fecfe7d98bde043
1 parent
840c0428
add alarm ack/clear event to the Rule Engine
Showing
3 changed files
with
13 additions
and
1 deletions
@@ -605,6 +605,12 @@ public abstract class BaseController { | @@ -605,6 +605,12 @@ public abstract class BaseController { | ||
605 | case ATTRIBUTES_DELETED: | 605 | case ATTRIBUTES_DELETED: |
606 | msgType = DataConstants.ATTRIBUTES_DELETED; | 606 | msgType = DataConstants.ATTRIBUTES_DELETED; |
607 | break; | 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 | if (!StringUtils.isEmpty(msgType)) { | 615 | if (!StringUtils.isEmpty(msgType)) { |
610 | try { | 616 | try { |
@@ -57,6 +57,8 @@ public class DataConstants { | @@ -57,6 +57,8 @@ public class DataConstants { | ||
57 | public static final String ENTITY_UNASSIGNED = "ENTITY_UNASSIGNED"; | 57 | public static final String ENTITY_UNASSIGNED = "ENTITY_UNASSIGNED"; |
58 | public static final String ATTRIBUTES_UPDATED = "ATTRIBUTES_UPDATED"; | 58 | public static final String ATTRIBUTES_UPDATED = "ATTRIBUTES_UPDATED"; |
59 | public static final String ATTRIBUTES_DELETED = "ATTRIBUTES_DELETED"; | 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 | public static final String RPC_CALL_FROM_SERVER_TO_DEVICE = "RPC_CALL_FROM_SERVER_TO_DEVICE"; | 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,7 +30,7 @@ import org.thingsboard.server.common.msg.session.SessionMsgType; | ||
30 | configClazz = EmptyNodeConfiguration.class, | 30 | configClazz = EmptyNodeConfiguration.class, |
31 | relationTypes = {"Post attributes", "Post telemetry", "RPC Request from Device", "RPC Request to Device", "Activity Event", "Inactivity Event", | 31 | relationTypes = {"Post attributes", "Post telemetry", "RPC Request from Device", "RPC Request to Device", "Activity Event", "Inactivity Event", |
32 | "Connect Event", "Disconnect Event", "Entity Created", "Entity Updated", "Entity Deleted", "Entity Assigned", | 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 | nodeDescription = "Route incoming messages by Message Type", | 34 | nodeDescription = "Route incoming messages by Message Type", |
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.", | 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 | uiResources = {"static/rulenode/rulenode-core-config.js"}, | 36 | uiResources = {"static/rulenode/rulenode-core-config.js"}, |
@@ -75,6 +75,10 @@ public class TbMsgTypeSwitchNode implements TbNode { | @@ -75,6 +75,10 @@ public class TbMsgTypeSwitchNode implements TbNode { | ||
75 | relationType = "Attributes Updated"; | 75 | relationType = "Attributes Updated"; |
76 | } else if (msg.getType().equals(DataConstants.ATTRIBUTES_DELETED)) { | 76 | } else if (msg.getType().equals(DataConstants.ATTRIBUTES_DELETED)) { |
77 | relationType = "Attributes Deleted"; | 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 | } else if (msg.getType().equals(DataConstants.RPC_CALL_FROM_SERVER_TO_DEVICE)) { | 82 | } else if (msg.getType().equals(DataConstants.RPC_CALL_FROM_SERVER_TO_DEVICE)) { |
79 | relationType = "RPC Request to Device"; | 83 | relationType = "RPC Request to Device"; |
80 | } else { | 84 | } else { |