mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-06-12 13:21:04 +08:00
脚本加上language属性
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<nodes>
|
||||
<node id="x0" type="if_script">
|
||||
<node id="x0" type="if_script" language="groovy">
|
||||
<![CDATA[
|
||||
return true;
|
||||
return true
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="x1" type="if_script">
|
||||
<node id="x1" type="if_script" language="groovy">
|
||||
<![CDATA[
|
||||
return false;
|
||||
return false
|
||||
]]>
|
||||
</node>
|
||||
</nodes>
|
||||
|
||||
@@ -2,27 +2,27 @@
|
||||
<flow>
|
||||
|
||||
<nodes>
|
||||
<node id="x" type="for_script">
|
||||
<node id="x" type="for_script" language="groovy">
|
||||
<![CDATA[
|
||||
return 3;
|
||||
return 3
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="y" type="break_script">
|
||||
<node id="y" type="break_script" language="groovy">
|
||||
<![CDATA[
|
||||
def count = defaultContext.getData("test");
|
||||
return count > 3;
|
||||
def count = defaultContext.getData("test")
|
||||
return count > 3
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="z" type="while_script">
|
||||
<node id="z" type="while_script" language="groovy">
|
||||
<![CDATA[
|
||||
def key = "test";
|
||||
def key = "test"
|
||||
if (defaultContext.hasData(key)){
|
||||
def count = defaultContext.getData("test");
|
||||
return count < 5;
|
||||
def count = defaultContext.getData("test")
|
||||
return count < 5
|
||||
}else{
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
]]>
|
||||
</node>
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
<flow>
|
||||
|
||||
<nodes>
|
||||
<node id="d" type="script">
|
||||
<node id="d" type="script" language="groovy">
|
||||
<![CDATA[
|
||||
def str = demo.getDemoStr1();
|
||||
defaultContext.setData("demo", str);
|
||||
def str = demo.getDemoStr1()
|
||||
defaultContext.setData("demo", str)
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="e" type="script">
|
||||
<node id="e" type="script" language="groovy">
|
||||
<![CDATA[
|
||||
def str = demo.getDemoStr2("kobe");
|
||||
defaultContext.setData("demo", str);
|
||||
def str = demo.getDemoStr2("kobe")
|
||||
defaultContext.setData("demo", str)
|
||||
]]>
|
||||
</node>
|
||||
</nodes>
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<nodes>
|
||||
<node id="s1" name="普通脚本1" type="script">
|
||||
<node id="s1" name="普通脚本1" type="script" language="groovy">
|
||||
<![CDATA[
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.DateUtil
|
||||
|
||||
def date = DateUtil.parse("2022-10-17 13:31:43");
|
||||
println(date);
|
||||
defaultContext.setData("demoDate", date);
|
||||
def date = DateUtil.parse("2022-10-17 13:31:43")
|
||||
println(date)
|
||||
defaultContext.setData("demoDate", date)
|
||||
|
||||
class Student {
|
||||
int studentID;
|
||||
String studentName;
|
||||
};
|
||||
int studentID
|
||||
String studentName
|
||||
}
|
||||
|
||||
Student student = new Student();
|
||||
student.studentID = 100301;
|
||||
student.studentName = "张三";
|
||||
defaultContext.setData("student",student);
|
||||
Student student = new Student()
|
||||
student.studentID = 100301
|
||||
student.studentName = "张三"
|
||||
defaultContext.setData("student",student)
|
||||
|
||||
def a=3;
|
||||
def b=2;
|
||||
defaultContext.setData("s1",a*b);
|
||||
def a=3
|
||||
def b=2
|
||||
defaultContext.setData("s1",a*b)
|
||||
]]>
|
||||
</node>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<nodes>
|
||||
<node id="s1" name="普通脚本" type="script">
|
||||
<node id="s1" name="普通脚本" type="script" language="groovy">
|
||||
<![CDATA[
|
||||
def a=3;
|
||||
def b=2;
|
||||
@@ -9,23 +9,23 @@
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="s2" name="条件脚本_改" type="switch_script">
|
||||
<node id="s2" name="条件脚本_改" type="switch_script" language="groovy">
|
||||
<![CDATA[
|
||||
count = defaultContext.getData("count");
|
||||
count = defaultContext.getData("count")
|
||||
if(count > 150){
|
||||
return "b";
|
||||
return "b"
|
||||
}else{
|
||||
return "a";
|
||||
return "a"
|
||||
}
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="s3" name="普通脚本_新增" type="script">
|
||||
<node id="s3" name="普通脚本_新增" type="script" language="groovy">
|
||||
<![CDATA[
|
||||
def a=3;
|
||||
def b=2;
|
||||
def c=10;
|
||||
defaultContext.setData("s1",a*b+c);
|
||||
def a=3
|
||||
def b=2
|
||||
def c=10
|
||||
defaultContext.setData("s1",a*b+c)
|
||||
]]>
|
||||
</node>
|
||||
</nodes>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<nodes>
|
||||
<node id="s1" name="普通脚本1" type="script">
|
||||
<node id="s1" name="普通脚本1" type="script" language="js">
|
||||
<![CDATA[
|
||||
var a=3;
|
||||
var b=2;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<nodes>
|
||||
<node id="x0" type="if_script">
|
||||
<node id="x0" type="if_script" language="js">
|
||||
<![CDATA[
|
||||
return true;
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="x1" type="if_script">
|
||||
<node id="x1" type="if_script" language="js">
|
||||
<![CDATA[
|
||||
return false;
|
||||
]]>
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
<flow>
|
||||
|
||||
<nodes>
|
||||
<node id="x" type="for_script">
|
||||
<node id="x" type="for_script" language="js">
|
||||
<![CDATA[
|
||||
return 3;
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="y" type="break_script">
|
||||
<node id="y" type="break_script" language="js">
|
||||
<![CDATA[
|
||||
var count = defaultContext.getData("test");
|
||||
return count > 3;
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="z" type="while_script">
|
||||
<node id="z" type="while_script" language="js">
|
||||
<![CDATA[
|
||||
var key = "test";
|
||||
if (defaultContext.hasData(key)){
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<nodes>
|
||||
<node id="s1" name="选择脚本" type="switch_script">
|
||||
<node id="s1" name="选择脚本" type="switch_script" language="js">
|
||||
<![CDATA[
|
||||
var count = defaultContext.getData("count");
|
||||
if(count > 100){
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<nodes>
|
||||
<node id="s1" name="选择脚本_改" type="switch_script">
|
||||
<node id="s1" name="选择脚本_改" type="switch_script" language="js">
|
||||
<![CDATA[
|
||||
var count = defaultContext.getData("count");
|
||||
if(count > 150){
|
||||
@@ -12,7 +12,7 @@
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="s2" name="普通脚本_新增" type="script">
|
||||
<node id="s2" name="普通脚本_新增" type="script" language="js">
|
||||
<![CDATA[
|
||||
var a=3;
|
||||
var b=2;
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
<flow>
|
||||
|
||||
<nodes>
|
||||
<node id="d" type="script">
|
||||
<node id="d" type="script" language="js">
|
||||
<![CDATA[
|
||||
var str = demo.getDemoStr1();
|
||||
defaultContext.setData("demo", str);
|
||||
]]>
|
||||
</node>
|
||||
|
||||
<node id="e" type="script">
|
||||
<node id="e" type="script" language="js">
|
||||
<![CDATA[
|
||||
var str = demo.getDemoStr2("kobe");
|
||||
defaultContext.setData("demo", str);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow>
|
||||
<nodes>
|
||||
<node id="s1" name="选择脚本" type="switch_script">
|
||||
<node id="s1" name="选择脚本" type="switch_script" language="js">
|
||||
<![CDATA[
|
||||
var count = defaultContext.getData('count');
|
||||
if(count > 100){
|
||||
|
||||
Reference in New Issue
Block a user