mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
43 lines
1.2 KiB
XML
43 lines
1.2 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE flow PUBLIC "liteflow" "liteflow.dtd">
|
|
<flow>
|
|
<nodes>
|
|
<node id="s1" name="普通脚本1" type="script" language="python">
|
|
<![CDATA[
|
|
import json
|
|
|
|
x='{"name": "杰克", "age": 75, "nationality": "China"}'
|
|
jsonData=json.loads(x)
|
|
name=jsonData['name']
|
|
defaultContext.setData("name", name.decode('utf-8'))
|
|
|
|
|
|
a=6
|
|
b=10
|
|
if a>5:
|
|
b=5
|
|
print '你好'.decode('UTF-8')
|
|
else:
|
|
print 'hi'
|
|
defaultContext.setData("s1",a*b)
|
|
defaultContext.setData("td", td.sayHi("jack"))
|
|
]]>
|
|
</node>
|
|
|
|
<node id="s2" name="文件脚本" type="script" file="common/s2.py" language="python"/>
|
|
|
|
<node id="s3" name="普通脚本1" type="switch_script" language="python">
|
|
<![CDATA[
|
|
"a"
|
|
]]>
|
|
</node>
|
|
</nodes>
|
|
|
|
<chain name="chain1">
|
|
THEN(a, b, c, s1, s2);
|
|
</chain>
|
|
|
|
<chain name="chain2">
|
|
SWITCH(s3).TO(a,b);
|
|
</chain>
|
|
</flow> |