Hi,
We are not able to fire specific rules using KBase and
StatefulKnowledgeSession,
//Code snippet
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.fireAllRules(new RuleNameEndsWithAgendaFilter("test"));
If we use the method directly we are getting the below compile time error,
The method fireAllRules(int) in the type StatefulRuleSession is not
applicable for the arguments (RuleNameEndsWithAgendaFilter)
and when we cast it and used the same by
ksession.fireAllRules((AgendaFilter) new
RuleNameEndsWithAgendaFilter("test")); but getting the below exception,
java.lang.ClassCastException: org.drools.base.RuleNameEndsWithAgendaFilter
Same thing we are able to achieve using RuleBase and WorkingMemory as below,
RuleBase ruleBase = agent.getRuleBase();
WorkingMemory wrkMemory = ruleBase.newStatefulSession();
int i=wrkMemory.fireAllRules(new RuleNameEndsWithAgendaFilter("read"));
Any pointers on how to use this functionality for firing specific rules
using KBase and StatefulKnowledgeSession, by filtering out rules based on
rule names. Please help in this regard.
Thanks,
Vignesh
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Firing-Specific-rules...
Sent from the Drools - User mailing list archive at
Nabble.com.