?? helloworld.python.drl
字號:
<?xml version="1.0"?>
<rule-set name="helloworld"
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 java.lang import Object</import>
<import>from java.lang import String</import>
<python:functions>
def helloWorld(hello):
print "%s World" % hello
def goodbyeWorld(goodbye):
print "%s Cruel World" % goodbye
</python:functions>
<rule name="Hello World">
<parameter identifier="hello">
<class>String</class>
</parameter>
<python:condition>hello == 'Hello'</python:condition>
<python:consequence>
helloWorld(hello)
</python:consequence>
</rule>
<rule name="Goodbye Cruel World">
<parameter identifier="goodbye">
<class>String</class>
</parameter>
<python:condition>goodbye == 'Goodbye'</python:condition>
<python:consequence>
goodbyeWorld(goodbye)
</python:consequence>
</rule>
<rule name="Debug">
<parameter identifier="object">
<class>Object</class>
</parameter>
<python:consequence>
print "Asserted object: %s" % object
</python:consequence>
</rule>
</rule-set>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -