我在 drools 中执行规则时遇到问题,当我使用 StatefulKnowledgeSession 执行规则时没有问题:
final KnowledgeBase kbase = knowledgeAgent.getKnowledgeBase();
final StatefulKnowledgeSession session = kbase.newStatefulKnowledgeSession();
session.getAgenda().getAgendaGroup("Third").setFocus();
session.getAgenda().getAgendaGroup("Second").setFocus();
session.getAgenda().getAgendaGroup("First").setFocus();
session.execute(CommandFactory.newBatchExecution(commands));
session.dispose();
但我尝试在 StatelessKnowledgeSession 中执行相同的规则,因为它是一个多线程进程,但我无法集中议程组,结果会有所不同。
我的知识库在执行期间不会改变。
怎么能做到这一点?
谢谢!!