?? reteexample.drl
字號:
package com.sample.rete
/*
* This rule code and the accompanying presentation is licensed for use in the United States under a
* Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
* http://creativecommons.org/licenses/by-nc-sa/3.0/us/
* All other rights reserved, copyright 2008, EBDX.COM, LLC
* Author: Lawrence Terrill, Sr. Partner, EBDX.COM, LLC, 5/1/2008
* This code supports the presentation, Basics of Rete, by Lawrence Terrill
*
*/
rule "rule-1"
when
a: A( a1 == 1, $x: a2 )
b: B( b1 == 2, $y: b2, b3 == $x )
c: C( c1 == $y)
then
System.out.println( "rule-1 fired: " + a + ", " + b + ", " + c );
end
rule "rule-2"
when
b: B( b1 == 2, $y: b2 )
d: D( d1 == 300, d2 == $y )
then
System.out.println( "rule-2 fired: " + b + ", " + d );
end
rule "rule-3"
when
b: B( b1 == 2, $y: b2, $z: b3 )
d: D( d1 == 300, d2 == $y )
e: E( e1 == $z )
then
System.out.println( "rule-3 fired: " + b + ", " + d + ", " + e );
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -