Drools 7.0:在构建资源之前必须注册所有累加函数

jfn*_*eis 0 drools

我们有一个使用 Drools 6.5 的正在运行的项目,并希望将其迁移到 7.0。

更改Drools依赖版本并运行项目时,抛出以下异常:

All accumulate functions must be registered before building a resourceUnknown accumulate function: 'countDistinct' on rule 'IPCPF001'. All accumulate functions must be registered before building a resource. : [Accumulate: input=[AND [[Pattern: id=null; objectType=MyFact]] ]]
Run Code Online (Sandbox Code Playgroud)

我们使用累加函数,它们在 META-INF/drools.packagebuilder.conf 文件中正确注册。7.0 版本有什么变化吗?

jfn*_*eis 6

在调试 Drools 7.1 初始化过程后,我们发现属性命名约定发生了变化。

  • 直到 6.5:META-INF/drools.packagebuilder.conf
  • 从 7.0: META-INF/kie.properties.conf

将文件名更改为 kie.properties.conf 解决了问题。