1

Drools 中这两者有什么区别?意味着我们可以根据

从加载的规则规则库和触发规则创建 WorkingMemory,如下所示:

WorkingMemory  workingmemory = rulebase.newWorkingMemory();
workingmemory.fireAllRules();

对比

使用 Session (Stateful . Stateless ) 触发规则,如图所示

KnowledgeBase knowledgebase = createKnowledgeBase();
StatefulKnowledgeSession session = knowledgebase.newStatefulKnowledgeSession();
session.insert(Object);
session.fireRules();
4

1 回答 1

5

使用knowledge-api- .jar 的KnowledgeBASE 和KnowledgeSession。RuleBase 和 WorkingMemory 是遗留接口,将来会被删除。

于 2012-06-26T13:33:58.403 回答