<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=Drools_Kie_-_Rule_Templates</id>
	<title>Drools Kie - Rule Templates - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=Drools_Kie_-_Rule_Templates"/>
	<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Drools_Kie_-_Rule_Templates&amp;action=history"/>
	<updated>2026-04-19T09:31:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://training-course-material.com/index.php?title=Drools_Kie_-_Rule_Templates&amp;diff=41277&amp;oldid=prev</id>
		<title>Wang Hao: /* Create New Rule Template - Source   新建规则模板 - 源码 。⌘ */</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Drools_Kie_-_Rule_Templates&amp;diff=41277&amp;oldid=prev"/>
		<updated>2016-08-31T03:42:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Create New Rule Template - Source   新建规则模板 - 源码 。⌘&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Cat|Drools|032}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;slideshow style=&amp;quot;nobleprog&amp;quot; headingmark=&amp;quot;⌘&amp;quot; incmark=&amp;quot;…&amp;quot; scaled=&amp;quot;true&amp;quot; font=&amp;quot;Trebuchet MS&amp;quot; lang=&amp;quot;中文版&amp;quot; headingmark2=&amp;quot;。&amp;quot; &amp;gt;&lt;br /&gt;
;title: Drools Guvnor - Decision Table&lt;br /&gt;
;author: Bernard Szlachta (NobleProg Ltd)&lt;br /&gt;
&amp;lt;/slideshow&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Drools Guvnor - Rule Templates ==&lt;br /&gt;
{{Can I use your material}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Copy existing project and tests。⌘==&lt;br /&gt;
# Copy npproj2 to npproj3&lt;br /&gt;
# Remove Decision Table&lt;br /&gt;
# Keep Data Objects and Tests&lt;br /&gt;
== Create New Rule Template  新建规则模板  。⌘==&lt;br /&gt;
* Create New -&amp;gt; New Rule Template&lt;br /&gt;
[[File:Drools-RulesTemplates.png|400px]]&lt;br /&gt;
&lt;br /&gt;
== Create New Rule Template - Source   新建规则模板 - 源码 。⌘==&lt;br /&gt;
Source should look like that:&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
package nppack;&lt;br /&gt;
&lt;br /&gt;
rule &amp;quot;Progressive Discount Rule Template_3&amp;quot;&lt;br /&gt;
	dialect &amp;quot;mvel&amp;quot;&lt;br /&gt;
	when&lt;br /&gt;
		$sc : ShoppingCart( totalPrice &amp;gt;= 80000B , totalPrice &amp;lt; 99999999999B , discountRate == null )&lt;br /&gt;
	then&lt;br /&gt;
		modify( $sc ) {&lt;br /&gt;
				setDiscountRate( 0.15 )&lt;br /&gt;
		}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rule &amp;quot;Progressive Discount Rule Template_2&amp;quot;&lt;br /&gt;
	dialect &amp;quot;mvel&amp;quot;&lt;br /&gt;
	when&lt;br /&gt;
		$sc : ShoppingCart( totalPrice &amp;gt;= 50000B , totalPrice &amp;lt; 80000B , discountRate == null )&lt;br /&gt;
	then&lt;br /&gt;
		modify( $sc ) {&lt;br /&gt;
				setDiscountRate( 0.12 )&lt;br /&gt;
		}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rule &amp;quot;Progressive Discount Rule Template_1&amp;quot;&lt;br /&gt;
	dialect &amp;quot;mvel&amp;quot;&lt;br /&gt;
	when&lt;br /&gt;
		$sc : ShoppingCart( totalPrice &amp;gt;= 10000B , totalPrice &amp;lt; 50000B , discountRate == null )&lt;br /&gt;
	then&lt;br /&gt;
		modify( $sc ) {&lt;br /&gt;
				setDiscountRate( 0.1 )&lt;br /&gt;
		}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
rule &amp;quot;Progressive Discount Rule Template_0&amp;quot;&lt;br /&gt;
	dialect &amp;quot;mvel&amp;quot;&lt;br /&gt;
	when&lt;br /&gt;
		$sc : ShoppingCart( totalPrice &amp;gt;= 0B , totalPrice &amp;lt; 10000B , discountRate == null )&lt;br /&gt;
	then&lt;br /&gt;
		modify( $sc ) {&lt;br /&gt;
				setDiscountRate( 0 )&lt;br /&gt;
		}&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ⌘==&lt;br /&gt;
* Disable Decision Table&lt;br /&gt;
* Use the same test and in the [[Drools Guvnor - Decision Table]] section&lt;br /&gt;
&lt;br /&gt;
== 测试 。==&lt;br /&gt;
* 关闭决策表&lt;br /&gt;
* 在 [[Drools Guvnor - Decision Table]] 部分使用相同的测试&lt;/div&gt;</summary>
		<author><name>Wang Hao</name></author>
	</entry>
</feed>