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

This commit is contained in:
everywhere.z 2022-11-06 13:12:59 +08:00
parent 97b17095fe
commit 513e532687
7 changed files with 8 additions and 9 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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