Commit 4b13647556c777f21242a2be4b666dcc4e76e608
Committed by
Andrew Shvayka
1 parent
0f0a25ce
- Alarm option is added to switch nodes in rule engine.
Showing
2 changed files
with
5 additions
and
2 deletions
@@ -31,7 +31,7 @@ public class TbOriginatorTypeFilterNodeConfiguration implements NodeConfiguratio | @@ -31,7 +31,7 @@ public class TbOriginatorTypeFilterNodeConfiguration implements NodeConfiguratio | ||
31 | public TbOriginatorTypeFilterNodeConfiguration defaultConfiguration() { | 31 | public TbOriginatorTypeFilterNodeConfiguration defaultConfiguration() { |
32 | TbOriginatorTypeFilterNodeConfiguration configuration = new TbOriginatorTypeFilterNodeConfiguration(); | 32 | TbOriginatorTypeFilterNodeConfiguration configuration = new TbOriginatorTypeFilterNodeConfiguration(); |
33 | configuration.setOriginatorTypes(Arrays.asList( | 33 | configuration.setOriginatorTypes(Arrays.asList( |
34 | - EntityType.DEVICE | 34 | + EntityType.ALARM |
35 | )); | 35 | )); |
36 | return configuration; | 36 | return configuration; |
37 | } | 37 | } |
@@ -27,7 +27,7 @@ import org.thingsboard.server.common.msg.TbMsg; | @@ -27,7 +27,7 @@ import org.thingsboard.server.common.msg.TbMsg; | ||
27 | type = ComponentType.FILTER, | 27 | type = ComponentType.FILTER, |
28 | name = "originator type switch", | 28 | name = "originator type switch", |
29 | configClazz = EmptyNodeConfiguration.class, | 29 | configClazz = EmptyNodeConfiguration.class, |
30 | - relationTypes = {"Device", "Asset", "Entity View", "Tenant", "Customer", "User", "Dashboard", "Rule chain", "Rule node"}, | 30 | + relationTypes = {"Device", "Asset", "Alarm", "Entity View", "Tenant", "Customer", "User", "Dashboard", "Rule chain", "Rule node"}, |
31 | nodeDescription = "Route incoming messages by Message Originator Type", | 31 | nodeDescription = "Route incoming messages by Message Originator Type", |
32 | nodeDetails = "Routes messages to chain according to the originator type ('Device', 'Asset', etc.).", | 32 | nodeDetails = "Routes messages to chain according to the originator type ('Device', 'Asset', etc.).", |
33 | uiResources = {"static/rulenode/rulenode-core-config.js"}, | 33 | uiResources = {"static/rulenode/rulenode-core-config.js"}, |
@@ -73,6 +73,9 @@ public class TbOriginatorTypeSwitchNode implements TbNode { | @@ -73,6 +73,9 @@ public class TbOriginatorTypeSwitchNode implements TbNode { | ||
73 | case RULE_NODE: | 73 | case RULE_NODE: |
74 | relationType = "Rule node"; | 74 | relationType = "Rule node"; |
75 | break; | 75 | break; |
76 | + case ALARM: | ||
77 | + relationType = "Alarm"; | ||
78 | + break; | ||
76 | default: | 79 | default: |
77 | throw new TbNodeException("Unsupported originator type: " + originatorType); | 80 | throw new TbNodeException("Unsupported originator type: " + originatorType); |
78 | } | 81 | } |