Drools - 能够在运行时定义规则? [英] Drools - Ability to define rules at runtime?

查看:176
本文介绍了Drools - 能够在运行时定义规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在运行时动态地定义规则吗?
还可以在运行时更改规则集。

It is possible to define rules dynamically completely at runtime ? Also change the ruleset at runtime.

例如,

at time = t_1 the ruleset is { R1, R2, R3 } 
at time = t_2 the ruleset is { R1, R3, R4 } 
..... 

R1,R2是在运行时定义的规则。

R1, R2 are rules that are defined at runtime.

谢谢。

推荐答案

是的,Drools是完全动态的。您可以在运行时添加/删除/替换规则。所有现有会话都会自动更新,以保持一致性。检查文档/ javadoc:

Yes, Drools is completely dynamic. You can add/remove/replaces rules at runtime. All the existing sessions are automatically updated in order to keep consistency. Check the documentation/javadoc:

http://www.jboss.org / drools / documentation

这里可以看到一些集成测试:

And here you can see some integration tests:

DynamicRulesTest.java

这篇关于Drools - 能够在运行时定义规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆