Drools Fusion 5.3.0 example不能运行
Unable to Analyse Expression percent >= -0.08:
[Error: Comparison operation requires compatible types. Found class org.mvel2.util.MethodStub and class java.lang.Double]
[Near : {... percent >= -0.08 ....}]
^
[Line: 52, Column: 28] : [Rule name='If the drop is between 6% and 8%, buy more shares']
Unable to Analyse Expression percent < -0.06:
[Error: Comparison operation requires compatible types. Found class org.mvel2.util.MethodStub and class java.lang.Double]
[Near : {... percent < -0.06 ....}]
^
[Line: 52, Column: 28] : [Rule name='If the drop is between 6% and 8%, buy more shares']
Unable to Analyse Expression percent < -0.08:
[Error: Comparison operation requires compatible types. Found class org.mvel2.util.MethodStub and class java.lang.Double]
[Near : {... percent < -0.08 ....}]
^
[Line: 65, Column: 28] : [Rule name='If the drop is on more than 8%, sell shares']
Unable to Analyse Expression percent >= -0.06:
[Error: Comparison operation requires compatible types. Found class org.mvel2.util.MethodStub and class java.lang.Double]
[Near : {... percent >= -0.06 ....}]
^
[Line: 79, Column: 28] : [Rule name='If the drop is between 5% and 6%, do nothing']
看到这个错误肯定是运行drools-distribution-5.3.0.Final中的fusion-example例子,这个例子实际上是基于5.2.0的代码,5.3.0与5.2.0及以前的版本不同,所以报错。
fusion-example 5.3.0版本的代码实际上是在 droolsjbpm-integration-distribution-5.3.0.Final下,这里面的代码是可以执行的
欢迎关注Drools平台的朋友留言探讨!