目 录
1 简介..............................................................................................................................1
1.1 什么是规则引擎?...............................................................................................................1
1.2 Drools简介............................................................................................................................1
1.3 何时使用Drools....................................................................................................................2
2 Drools工作原理..........................................................................................................4
2.1 产生式规则引擎工作原理...................................................................................................4
2.2 RETE算法.............................................................................................................................5
3 Drools实战..................................................................................................................1
3.1 导入drools依赖包.................................................................................................................1
3.2 Hello Drools..........................................................................................................................1
3.3 规则语言..............................................................................................................................8
3.3.1 规则文件........................................................................................................................................8
3.3.2 规则构成........................................................................................................................................9
3.3.3 保留字............................................................................................................................................9
3.3.4 注释..............................................................................................................................................11
3.3.5 Package........................................................................................................................................11
3.3.6 Import...........................................................................................................................................12
3.3.7 Expander......................................................................................................................................12
3.3.8 Global全局变量...........................................................................................................................12
3.3.9 Function.......................................................................................................................................14
3.3.10 规则............................................................................................................................................14
3.3.11 规则属性....................................................................................................................................16
3.3.12 LHS (when) 条件元素...............................................................................................................18
第 1 页 共 页 机密 – 未经允许不得扩散 红帽软件中国