- Alarm option is added to switch nodes in rule engine.

This commit is contained in:
yusufc 2020-08-27 18:33:44 +03:00 committed by Andrew Shvayka
parent 0f0a25ce38
commit 4b13647556
2 changed files with 5 additions and 2 deletions

View File

@ -31,7 +31,7 @@ public class TbOriginatorTypeFilterNodeConfiguration implements NodeConfiguratio
public TbOriginatorTypeFilterNodeConfiguration defaultConfiguration() { public TbOriginatorTypeFilterNodeConfiguration defaultConfiguration() {
TbOriginatorTypeFilterNodeConfiguration configuration = new TbOriginatorTypeFilterNodeConfiguration(); TbOriginatorTypeFilterNodeConfiguration configuration = new TbOriginatorTypeFilterNodeConfiguration();
configuration.setOriginatorTypes(Arrays.asList( configuration.setOriginatorTypes(Arrays.asList(
EntityType.DEVICE EntityType.ALARM
)); ));
return configuration; return configuration;
} }

View File

@ -27,7 +27,7 @@ import org.thingsboard.server.common.msg.TbMsg;
type = ComponentType.FILTER, type = ComponentType.FILTER,
name = "originator type switch", name = "originator type switch",
configClazz = EmptyNodeConfiguration.class, configClazz = EmptyNodeConfiguration.class,
relationTypes = {"Device", "Asset", "Entity View", "Tenant", "Customer", "User", "Dashboard", "Rule chain", "Rule node"}, relationTypes = {"Device", "Asset", "Alarm", "Entity View", "Tenant", "Customer", "User", "Dashboard", "Rule chain", "Rule node"},
nodeDescription = "Route incoming messages by Message Originator Type", nodeDescription = "Route incoming messages by Message Originator Type",
nodeDetails = "Routes messages to chain according to the originator type ('Device', 'Asset', etc.).", nodeDetails = "Routes messages to chain according to the originator type ('Device', 'Asset', etc.).",
uiResources = {"static/rulenode/rulenode-core-config.js"}, uiResources = {"static/rulenode/rulenode-core-config.js"},
@ -73,6 +73,9 @@ public class TbOriginatorTypeSwitchNode implements TbNode {
case RULE_NODE: case RULE_NODE:
relationType = "Rule node"; relationType = "Rule node";
break; break;
case ALARM:
relationType = "Alarm";
break;
default: default:
throw new TbNodeException("Unsupported originator type: " + originatorType); throw new TbNodeException("Unsupported originator type: " + originatorType);
} }