浏览代码

enhancement #I6RFOE LiteFlow能否在流程(表达式)添加类似tag字段的属性,提高选择组件的复用率呢

everywhere.z 2 年之前
父节点
当前提交
eaa68adbb0

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

@@ -15,12 +15,7 @@ public class ScriptIfComponent extends NodeIfComponent implements ScriptComponen
 
 
 	@Override
 	@Override
 	public boolean processIf() throws Exception {
 	public boolean processIf() throws Exception {
-		ScriptExecuteWrap wrap = new ScriptExecuteWrap();
-		wrap.setCurrChainId(this.getCurrChainId());
-		wrap.setNodeId(this.getNodeId());
-		wrap.setSlotIndex(this.getSlotIndex());
-		wrap.setTag(this.getTag());
-		wrap.setCmpData(this.getCmpData(Map.class));
+		ScriptExecuteWrap wrap = this.buildWrap(this);
 		return (boolean) ScriptExecutorFactory.loadInstance()
 		return (boolean) ScriptExecutorFactory.loadInstance()
 			.getScriptExecutor(this.getRefNode().getLanguage())
 			.getScriptExecutor(this.getRefNode().getLanguage())
 			.execute(wrap);
 			.execute(wrap);

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

@@ -15,12 +15,7 @@ public class ScriptSwitchComponent extends NodeSwitchComponent implements Script
 
 
 	@Override
 	@Override
 	public String processSwitch() throws Exception {
 	public String processSwitch() throws Exception {
-		ScriptExecuteWrap wrap = new ScriptExecuteWrap();
-		wrap.setCurrChainId(this.getCurrChainId());
-		wrap.setNodeId(this.getNodeId());
-		wrap.setSlotIndex(this.getSlotIndex());
-		wrap.setTag(this.getTag());
-		wrap.setCmpData(this.getCmpData(Map.class));
+		ScriptExecuteWrap wrap = this.buildWrap(this);
 		return (String) ScriptExecutorFactory.loadInstance()
 		return (String) ScriptExecutorFactory.loadInstance()
 			.getScriptExecutor(this.getRefNode().getLanguage())
 			.getScriptExecutor(this.getRefNode().getLanguage())
 			.execute(wrap);
 			.execute(wrap);

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

@@ -15,12 +15,7 @@ public class ScriptWhileComponent extends NodeWhileComponent implements ScriptCo
 
 
 	@Override
 	@Override
 	public boolean processWhile() throws Exception {
 	public boolean processWhile() throws Exception {
-		ScriptExecuteWrap wrap = new ScriptExecuteWrap();
-		wrap.setCurrChainId(this.getCurrChainId());
-		wrap.setNodeId(this.getNodeId());
-		wrap.setSlotIndex(this.getSlotIndex());
-		wrap.setTag(this.getTag());
-		wrap.setCmpData(this.getCmpData(Map.class));
+		ScriptExecuteWrap wrap = this.buildWrap(this);
 		return (boolean) ScriptExecutorFactory.loadInstance()
 		return (boolean) ScriptExecutorFactory.loadInstance()
 			.getScriptExecutor(this.getRefNode().getLanguage())
 			.getScriptExecutor(this.getRefNode().getLanguage())
 			.execute(wrap);
 			.execute(wrap);