Explorar o código

enhancement #I5ULVA 修正不规范的问题,chain的name和id混用,不太严谨

everywhere.z %!s(int64=2) %!d(string=hai) anos
pai
achega
513e532687

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/core/ScriptBreakComponent.java

@@ -12,7 +12,7 @@ public class ScriptBreakComponent extends NodeBreakComponent implements ScriptCo
     @Override
     public boolean processBreak() throws Exception {
         ScriptExecuteWrap wrap = new ScriptExecuteWrap();
-        wrap.setCurrChainName(this.getCurrChainName());
+        wrap.setCurrChainId(this.getCurrChainId());
         wrap.setNodeId(this.getNodeId());
         wrap.setSlotIndex(this.getSlotIndex());
         wrap.setTag(this.getTag());

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/core/ScriptCommonComponent.java

@@ -17,7 +17,7 @@ public class ScriptCommonComponent extends NodeComponent implements ScriptCompon
     @Override
     public void process() throws Exception {
         ScriptExecuteWrap wrap = new ScriptExecuteWrap();
-        wrap.setCurrChainName(this.getCurrChainName());
+        wrap.setCurrChainId(this.getCurrChainId());
         wrap.setNodeId(this.getNodeId());
         wrap.setSlotIndex(this.getSlotIndex());
         wrap.setTag(this.getTag());

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/core/ScriptForComponent.java

@@ -12,7 +12,7 @@ public class ScriptForComponent extends NodeForComponent implements ScriptCompon
     @Override
     public int processFor() throws Exception {
         ScriptExecuteWrap wrap = new ScriptExecuteWrap();
-        wrap.setCurrChainName(this.getCurrChainName());
+        wrap.setCurrChainId(this.getCurrChainId());
         wrap.setNodeId(this.getNodeId());
         wrap.setSlotIndex(this.getSlotIndex());
         wrap.setTag(this.getTag());

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/core/ScriptIfComponent.java

@@ -12,7 +12,7 @@ public class ScriptIfComponent extends NodeIfComponent implements ScriptComponen
     @Override
     public boolean processIf() throws Exception {
         ScriptExecuteWrap wrap = new ScriptExecuteWrap();
-        wrap.setCurrChainName(this.getCurrChainName());
+        wrap.setCurrChainId(this.getCurrChainId());
         wrap.setNodeId(this.getNodeId());
         wrap.setSlotIndex(this.getSlotIndex());
         wrap.setTag(this.getTag());

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/core/ScriptSwitchComponent.java

@@ -13,7 +13,7 @@ public class ScriptSwitchComponent extends NodeSwitchComponent implements Script
     @Override
     public String processSwitch() throws Exception {
         ScriptExecuteWrap wrap = new ScriptExecuteWrap();
-        wrap.setCurrChainName(this.getCurrChainName());
+        wrap.setCurrChainId(this.getCurrChainId());
         wrap.setNodeId(this.getNodeId());
         wrap.setSlotIndex(this.getSlotIndex());
         wrap.setTag(this.getTag());

+ 1 - 1
liteflow-core/src/main/java/com/yomahub/liteflow/core/ScriptWhileComponent.java

@@ -13,7 +13,7 @@ public class ScriptWhileComponent extends NodeWhileComponent implements ScriptCo
     @Override
     public boolean processWhile() throws Exception {
         ScriptExecuteWrap wrap = new ScriptExecuteWrap();
-        wrap.setCurrChainName(this.getCurrChainName());
+        wrap.setCurrChainId(this.getCurrChainId());
         wrap.setNodeId(this.getNodeId());
         wrap.setSlotIndex(this.getSlotIndex());
         wrap.setTag(this.getTag());

+ 2 - 3
liteflow-script-plugin/liteflow-script-qlexpress/src/main/java/com/yomahub/liteflow/script/qlexpress/QLExpressScriptExecutor.java

@@ -54,7 +54,7 @@ public class QLExpressScriptExecutor implements ScriptExecutor {
     }
 
     @Override
-    public Object execute(ScriptExecuteWrap wrap) {
+    public Object execute(ScriptExecuteWrap wrap) throws Exception{
         List<String> errorList = new ArrayList<>();
         try{
             if (!compiledScriptMap.containsKey(wrap.getNodeId())){
@@ -98,8 +98,7 @@ public class QLExpressScriptExecutor implements ScriptExecutor {
             for (String scriptErrorMsg : errorList){
                 log.error("\n{}", scriptErrorMsg);
             }
-            String errorMsg = StrUtil.format("script execute error for node[{}]", wrap.getNodeId());
-            throw new ScriptExecuteException(errorMsg);
+            throw e;
         }
     }