Drools 6.0在运行时动态加载规则 [英] Drools 6.0 dynamically load rules at runtime
问题描述
我想在运行时加载drl文件。我发现的帖子包括一个适用于5.0版但是我无法弄清楚如何为drools版本6.0做这件事。
I want to load a drl file at runtime. The posts I've found including this one work for version 5.0 but I can't figure out how to do it for drools version 6.0.
推荐答案
在Drools 6中,你的规则包被部署到Maven的。提供KieScanner,您可以将其附加到KieContainer。这将按照定义的时间间隔轮询您的存储库,以查看是否已更新软件包,如果是这种情况,则下载最新软件包。
In Drools 6, your rules packages are deployed to Maven. A KieScanner is provided, which you can attach to your KieContainer. This polls your repository at a defined interval to see whether a package has been updated and downloads the latest if that's the case.
有关如何定义KieScanner的完整说明(包括代码示例)在Drools文档中提供:
A full explanation of how to define a KieScanner (including code samples) is provided in the Drools documentation here:
https://docs.jboss.org/dolols/release/latest/drools-docs/html/ch04.html
这篇关于Drools 6.0在运行时动态加载规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!