Drools : Firing Rules using a Session vs WorkingMemory

夙愿已清 提交于 2019-12-11 08:39:05

问题


What is the difference in between these two in Drools ?? Means taht we can fire the rules based on the

Creating the WorkingMemory from the loaded Rules RulesBase and firing rules as shown below :

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

vs

Using a Session (Stateful . Stateless ) to fire the rules as shown

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

回答1:


Use KnowledgeBAse and KnowledgeSession, of knowledge-api-.jar. RuleBase and WorkingMemory are the legacy interfaces and will be removed in the future.



来源:https://stackoverflow.com/questions/11205104/drools-firing-rules-using-a-session-vs-workingmemory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!