?? state.python.drl
字號:
<?xml version="1.0"?>
<rule-set name="State Example"
xmlns="http://drools.org/rules"
xmlns:python="http://drools.org/semantics/python"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/rules rules.xsd
http://drools.org/semantics/python python.xsd">
<import>from org.drools.examples.state import State</import>
<rule name="Bootstrap">
<parameter identifier="a">
<class-field field="name" value="A">State</class-field>
</parameter>
<python:condition>a.getState() == "NOTRUN"</python:condition>
<python:consequence>
print "%s finished" % a.getName();
a.setState("FINISHED");
</python:consequence>
</rule>
<rule name="AtoB" salience="30">
<parameter identifier="a">
<class-field field="name" value="A">State</class-field>
</parameter>
<parameter identifier="b">
<class-field field="name" value="B">State</class-field>
</parameter>
<python:condition>a.getState() == "FINISHED"</python:condition>
<python:condition>b.getState() == "NOTRUN"</python:condition>
<python:consequence>
print "%s finished" % b.getName();
b.setState("FINISHED");
</python:consequence>
</rule>
<rule name="BtoC" salience="20">
<parameter identifier="b">
<class-field field="name" value="B">State</class-field>
</parameter>
<parameter identifier="c">
<class-field field="name" value="C">State</class-field>
</parameter>
<python:condition>b.getState() == "FINISHED"</python:condition>
<python:condition>c.getState() == "NOTRUN"</python:condition>
<python:consequence>
print "%s finished" % c.getName();
c.setState("FINISHED");
</python:consequence>
</rule>
<rule name="BtoD" salience="10">
<parameter identifier="b">
<class-field field="name" value="B">State</class-field>
</parameter>
<parameter identifier="d">
<class-field field="name" value="D">State</class-field>
</parameter>
<python:condition>b.getState() == "FINISHED"</python:condition>
<python:condition>d.getState() == "NOTRUN"</python:condition>
<python:consequence>
print "%s finished" % d.getName();
d.setState("FINISHED");
</python:consequence>
</rule>
</rule-set>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -