帮助 Drools 与 Scala 集成

发布于 2024-11-27 23:28:29 字数 811 浏览 1 评论 0 原文

我是 Drools 的新手。我正在将 Drools 与 Scala 集成。我正在尝试 http:// 给出的项目www.gettingcirrius.com/2010/12/using-jboss-rules-drools-in-scala.html。 我对代码进行了一些小更改以提供 Drools 规则文件,如下所示:

File f = new File("WeatherRules.drl"); 
kbuilder.add(ResourceFactory.newFileResource(f), ResourceType.DRL); 

代码运行良好并且没有错误,但规则不起作用。我得到的输出是:

Creating Knowledge Session 
Creating and insertng Temperature 
Firing all rules 

看来配置的规则不起作用。我使用的依赖项是:

Scala: 2.9.0.1
Sbt: 0.7.7 
jaxb-xjc: 2.2.4-1 
drools-core: 5.2.0.Final 
drools-compiler: 5.2.0.Final 
jxl: 2.6 
xstream: 1.3.1 

我错过了什么吗?请帮助我将 Drools 与 scala 集成。提前致谢。任何帮助将不胜感激。

谢谢, 普内特

I am new with Drools. I am integrating Drools with Scala. I am trying the project given at http://www.gettingcirrius.com/2010/12/using-jboss-rules-drools-in-scala.html.
I have made a small change in the code to supply the Drools rule file as given below:

File f = new File("WeatherRules.drl"); 
kbuilder.add(ResourceFactory.newFileResource(f), ResourceType.DRL); 

The code is running fine and there is no error but the rules are not working. The output I got is:

Creating Knowledge Session 
Creating and insertng Temperature 
Firing all rules 

It seems that the configured rules are not working. The dependencies I am using in for is:

Scala: 2.9.0.1
Sbt: 0.7.7 
jaxb-xjc: 2.2.4-1 
drools-core: 5.2.0.Final 
drools-compiler: 5.2.0.Final 
jxl: 2.6 
xstream: 1.3.1 

Am I missing something? Please help me to integrate Drools with scala. Thanks in advance. Any help will be appreciated.

thanks,
Puneet

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

揪着可爱 2024-12-04 23:28:29

我得到了问题的解决方案。解决方案位于:

http://drools.46999.n3.nabble.com/Drools5-2-2-integration-with-scala2-9-0-1-td3229566.html

rel=" nofollow

I got the solution to the problem. The solution is at:

http://drools.46999.n3.nabble.com/Drools5-2-2-integration-with-scala2-9-0-1-td3229566.html

Puneet

莫多说 2024-12-04 23:28:29

我认为您还应该在执行依赖项中包含 Knowledge-API jar,但这让我想知道到目前为止代码没有抛出任何异常...

祝您好运,
伊万诺

I think you should also include the Knowledge-API jar in your dependencies for execution, but it makes me wonder that the code didn't throw any exception so far...

good luck,
Ivano

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文