当规则空间中的事实(fact)有多个时,规则会匹配多个组合.
Rule rule = new Rule();
rule.setRuleName("test");
rule.setSalience(100);
ksession.insert(rule);
ksession.fireAllRules();
import test.Rule;
rule "test second"
salience 20
activation-group "test"
no-loop true
when
$test: Rule(ruleName matches "test", salience >= 110)
then
System.out.println($test + " the 1st");
end
rule "test first"
salience 10
no-loop true
when
$test: Rule( )
$show : String( )
then
System.out.println($test + " the 2nd");
System.out.println($show + " the 2nd");
end
rule "test three"
salience -10
activation-group "test"
no-loop true
when
$test: Rule( )
then
System.out.println($test + " the 3rd");
$test.setNo_loop(true);
Rule temp = new Rule();
temp.setRuleName("test");
temp.setSalience(110);
insert("show");
insert("test");
insert(temp);
end
测试结果
test.Rule@90d8ea the 3rd
test.Rule@17cec96 the 1st
test.Rule@17cec96 the 2nd
test the 2nd
test.Rule@17cec96 the 2nd
show the 2nd
test.Rule@90d8ea the 2nd
test the 2nd
test.Rule@90d8ea the 2nd
show the 2nd
分享到:
相关推荐
测试详细记录文件 博文链接:https://rishon.iteye.com/blog/662812
9 Drools WorkBench使用9.1 WorkBench基本使用9.2 创建会话9.3 编译并部署9.4 执行代码10 Drools决策表入门11 Drools决策表加强12 Drools决策表整合Springboot和MybatiesPlus13 动态编译Class文件实现Drools规则调用...
Drools是Jboss公司旗下一款开源的规则引擎,它完整的实现了Rete 算法;提供了强大的Eclipse Plugin开发支持; 通过使用其中的DSL(Domain Specific Language),可以实现用自然语言方式来描述业务规则,使得业务分析...
从基础讲起,结合应用场景,由浅到深细化讲解drools规则引擎的的相关知识,并结合具体实例,演示功能的使用和注意事项。后面通过搭建具体的项目并结合springboot框架联合使用Drools的相关知识包括决策表的使用,囊括...
NULL 博文链接:https://wangmengbk.iteye.com/blog/2120259
Drools 规则引擎的介绍及应用,全面介绍了Drools的规则集文件语法
Drools规则引擎及教程,需在jdk1.6下运行,不缺jar包
drools动态生成规则文件
Drools规则引擎是一种嵌套在应用程序中的组件, 是用Java语言编写的开放源码规则引擎,使用Rete算法对所编写的规则求值。 它实现了将业务规则从程序代码忠分离出来,规则引擎使用特定的语法编写业务规则,规则引擎...
drools开发
drools规则引擎,了解规则匹配,专家系统的可以学习一下,java的同学也可以学习一下,各大厂也在用哦
一个关于drools规则引擎的说明文档,说明的很详细,包括对drools的简介,运行方式介绍,语言编写教程,集成和测试教程,同时包括一些案例,应该是由外文文档进行的翻译
描述Drools规则引擎的相关内容,并讲述java环境下如何集成drools工具实现规则的推理
用Spring boot与Drools规则引擎写的Demo,适用于刚接触Drools想要快速入门,熟悉规则建立和使用。
drools规则引擎系统概要设计.pdf
Drools规则引擎介绍,Drools规则引擎介绍,Drools规则引擎介绍
drools-规则语言
基于Drools规则引擎开发的一个规则验证样例系统,包含java代码源码、规则源码及所依赖的jar包。
Drools(JBoss Rules )具有一个易于访问企业策略、易于调整以及易于管理的开源业务规则引擎,符合业内标准,速度快、效率高。业务分析师或审核人员可以利用它轻松查看业务规则,从而检验是否已编码的规则执行了所需...