Drools.Net Bug?

这两天在看这个规则引擎,Drools JAVA版已经5.0了,可怜的drools.net,是基于3.0版本的.郁闷的是,MS有BUG.

  • 这是BUG么?

1.在rule文件,你可以:
global System.Collections.ArrayList list
global System.Text.StringBuilder str
global System.Int32 num
但是不可以:
global System.String myStr
error: "Illegal class for global. Expected [cli.System.String], found [java.lang.String]."

global cli.System.String myStr 显然错误,
global java.lang.String myStr 编译通过,但运行不正确

2.如此正确的rule:

rule "eval test"
when
    eval (true)
then
    System.Console.WriteLine("eval test");
end

 

运行不了,或者说所测试过的任何eval语法,运行都是抛错误.drools.dotnet.examples 内所有示例也未见eval语法的使用例程,相当怀疑是drools.net的bug.

  • 这叫鬼异么?

1.使用duration后是异步的
假设你在一个rule前加duration 问题时,归则引擎的执行本身是在另外一个线程中进行的,反之在你的程序主线程的进行,(GolfingExample示例,加大外层循环,rule加入duration可试)

rule "find solution"
duration 1000
    when
       Golfer( fredsName : Name == "Fred",
                fredsPosition : Position,
                fredsColor : Color  )

...

在哪个不知名的文档说明过,我找了半天也没发现...

posted on 2009-11-20 11:35  Haozes  阅读(1778)  评论(2编辑  收藏  举报