Browse Source
Merge pull request #9019 from thingsboard/tbel_switch_node
[3.5.2]Tbel_rollback_validation_switch
pull/9033/head
Andrew Shvayka
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
3 additions and
15 deletions
-
common/script/script-api/src/main/java/org/thingsboard/script/api/tbel/DefaultTbelInvokeService.java
-
pom.xml
-
ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js
|
|
|
@ -66,8 +66,6 @@ public class DefaultTbelInvokeService extends AbstractScriptInvokeService implem |
|
|
|
|
|
|
|
protected final Map<UUID, String> scriptIdToHash = new ConcurrentHashMap<>(); |
|
|
|
protected final Map<String, TbelScript> scriptMap = new ConcurrentHashMap<>(); |
|
|
|
private final String tbelSwitch = "switch"; |
|
|
|
private final String tbelSwitchErrorMsg = "TBEL does not support the 'switch'."; |
|
|
|
protected Cache<String, Serializable> compiledScriptsCache; |
|
|
|
|
|
|
|
private SandboxedParserConfiguration parserConfig; |
|
|
|
@ -183,11 +181,6 @@ public class DefaultTbelInvokeService extends AbstractScriptInvokeService implem |
|
|
|
lock.unlock(); |
|
|
|
} |
|
|
|
return scriptId; |
|
|
|
} catch (CompileException ce) { |
|
|
|
if ( ce.getExpr() != null && new String(ce.getExpr()).contains(tbelSwitch)) { |
|
|
|
ce = new CompileException(tbelSwitchErrorMsg, ce.getExpr(), ce.getCursor(), ce.getCause()); |
|
|
|
} |
|
|
|
throw new TbScriptException(scriptId, TbScriptException.ErrorCode.COMPILATION, scriptBody, ce); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new TbScriptException(scriptId, TbScriptException.ErrorCode.COMPILATION, scriptBody, e); |
|
|
|
} |
|
|
|
|
|
|
|
@ -78,7 +78,7 @@ |
|
|
|
<zookeeper.version>3.8.1</zookeeper.version> |
|
|
|
<protobuf.version>3.21.9</protobuf.version> |
|
|
|
<grpc.version>1.42.1</grpc.version> |
|
|
|
<tbel.version>1.0.6</tbel.version> |
|
|
|
<tbel.version>1.0.7</tbel.version> |
|
|
|
<lombok.version>1.18.18</lombok.version> |
|
|
|
<paho.client.version>1.2.4</paho.client.version> |
|
|
|
<paho.mqttv5.client.version>1.2.5</paho.mqttv5.client.version> |
|
|
|
|
|
|
|
@ -5229,10 +5229,6 @@ var JSHINT = (function() { |
|
|
|
var a = [], p; |
|
|
|
|
|
|
|
while (!state.tokens.next.reach && state.tokens.next.id !== "(end)") { |
|
|
|
if (state.tokens.next.value === "switch") { |
|
|
|
warning("E067", state.tokens.next, "switch"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (state.tokens.next.id === ";") { |
|
|
|
p = peek(); |
|
|
|
|
|
|
|
@ -9219,7 +9215,7 @@ var JSHINT = (function() { |
|
|
|
statements(0); |
|
|
|
} |
|
|
|
|
|
|
|
if (state.tokens.next.id !== "(end)"&& state.tokens.next.value !== "switch") { |
|
|
|
if (state.tokens.next.id !== "(end)") { |
|
|
|
quit("E041", state.tokens.curr); |
|
|
|
} |
|
|
|
|
|
|
|
@ -11270,8 +11266,7 @@ var errors = { |
|
|
|
E064: "Super call may only be used within class method bodies.", |
|
|
|
E065: "Functions defined outside of strict mode with non-simple parameter lists may not " + |
|
|
|
"enable strict mode.", |
|
|
|
E066: "Asynchronous iteration is only available with for-of loops.", |
|
|
|
E067: "Expected an 'if/else' and instead saw 'switch'. TBEL does not support the 'switch' statement." |
|
|
|
E066: "Asynchronous iteration is only available with for-of loops." |
|
|
|
}; |
|
|
|
|
|
|
|
var warnings = { |
|
|
|
|