Kai*_*har 2 drools business-rules jboss7.x
我在Drools中实现了业务规则,而执行时我得到java RuntimeException
Unexpected global [myService]
org.drools.common.AbstractWorkingMemory.setGlobal(AbstractWorkingMemory.java:588)
可能是什么原因?
规则:
rule "Tax Rule"
  when
    calculateTax : calculateTax(
        objOne : objOne,
        objTwo : objTwo,
        objThree : objThree
    );
    objFour : objFour();
    System.out.println("debug");
  then
    ...
end
要在DRL中声明和设置全局,您需要声明并初始化它:
// DRL file
global Service myService
// Java application
StatefulKnowledgeSession session = ...
session.setGlobal("myService", new Service() );
未能在DRL文件中声明全局或全局名称与setGlobal调用中的第一个参数不匹配会导致错误消息发布.
| 归档时间: | 
 | 
| 查看次数: | 6177 次 | 
| 最近记录: |