Browse Source

Default Math Node configuration fix

pull/7348/head
Andrii Shvaika 4 years ago
parent
commit
0501034508
  1. 4
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/math/TbMathArgument.java
  2. 2
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/math/TbMathNodeConfiguration.java

4
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/math/TbMathArgument.java

@ -34,4 +34,8 @@ public class TbMathArgument {
this(key, type, key, null, null);
}
public TbMathArgument(String name, TbMathArgumentType type, String key) {
this(name, type, key, null, null);
}
}

2
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/math/TbMathNodeConfiguration.java

@ -33,7 +33,7 @@ public class TbMathNodeConfiguration implements NodeConfiguration<TbMathNodeConf
public TbMathNodeConfiguration defaultConfiguration() {
TbMathNodeConfiguration configuration = new TbMathNodeConfiguration();
configuration.setOperation(TbRuleNodeMathFunctionType.ADD);
configuration.setArguments(Arrays.asList(new TbMathArgument(TbMathArgumentType.CONSTANT, "2"), new TbMathArgument(TbMathArgumentType.CONSTANT, "2")));
configuration.setArguments(Arrays.asList(new TbMathArgument("x", TbMathArgumentType.CONSTANT, "2"), new TbMathArgument("y", TbMathArgumentType.CONSTANT, "2")));
configuration.setResult(new TbMathResult(TbMathArgumentType.MESSAGE_BODY, "result", 2, false, false, null));
return configuration;
}

Loading…
Cancel
Save