One for your list Wolfgang?<br><br><div class="gmail_quote">On 9 September 2010 11:07, Swindells, Thomas <span dir="ltr">&lt;<a href="mailto:TSwindells@nds.com">TSwindells@nds.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Looks like the problem is that there are two agenda filter classes:<br>
org.drools.runtime.rule.AgendaFilter and org.drools.spi.AgendaFilter.<br>
<br>
odrr.AgendaFilter is what is required by the StatefulKnowledgeSession, this then wraps it in a class to convert it to an ods.AgendaFilter which is what the internal classes use.<br>
RuleNameEndsWithAgendaFilter seems to implement ods.AgendaFilter and not odrr.AgendaFilter which is what I&#39;d expect - this is possibly a bug.<br>
Your options are to create a simple wrapper which converts an ods.AgendaFilter to an odrr AgendaFilter so that when you pass it into the knowledge session that can then wrap it back to an odsAF. Alternatively you could just copy or extend RuleNameEndsWithAgendaFilter and give it the &#39;correct&#39; interface.<br>

<br>
Thomas<br>
<br>
&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-">rules-users-</a><br>
&gt; <a href="mailto:bounces@lists.jboss.org">bounces@lists.jboss.org</a>] On Behalf Of Vignesh<br>
&gt; Sent: 09 September 2010 10:32<br>
&gt; To: <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; Subject: [rules-users] Firing Specific rules using KBase and<br>
&gt; StatefulKnowledgeSession<br>
&gt;<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; We are not able to fire specific rules using KBase and<br>
&gt; StatefulKnowledgeSession,<br>
&gt;<br>
&gt; //Code snippet<br>
&gt;<br>
&gt; StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();<br>
&gt; ksession.fireAllRules(new RuleNameEndsWithAgendaFilter(&quot;test&quot;));<br>
&gt;<br>
&gt; If we use the method directly we are getting the below compile time error,<br>
&gt; The method fireAllRules(int) in the type StatefulRuleSession is not<br>
&gt; applicable for the arguments (RuleNameEndsWithAgendaFilter)<br>
&gt;<br>
&gt; and when we cast it and used the same by<br>
&gt; ksession.fireAllRules((AgendaFilter) new<br>
&gt; RuleNameEndsWithAgendaFilter(&quot;test&quot;)); but getting the below exception,<br>
&gt; java.lang.ClassCastException: org.drools.base.RuleNameEndsWithAgendaFilter<br>
&gt;<br>
&gt; Same thing we are able to achieve using RuleBase and WorkingMemory as below,<br>
&gt;<br>
&gt; RuleBase ruleBase = agent.getRuleBase();<br>
&gt; WorkingMemory wrkMemory = ruleBase.newStatefulSession();<br>
&gt; int i=wrkMemory.fireAllRules(new RuleNameEndsWithAgendaFilter(&quot;read&quot;));<br>
&gt;<br>
&gt; Any pointers on how to use this functionality for firing specific rules<br>
&gt; using KBase and StatefulKnowledgeSession, by filtering out rules based on<br>
&gt; rule names. Please help in this regard.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Vignesh<br>
&gt; --<br>
&gt; View this message in context: <a href="http://drools-java-rules-" target="_blank">http://drools-java-rules-</a><br>
&gt; <a href="http://engine.46999.n3.nabble.com/Firing-Specific-rules-using-KBase-and-" target="_blank">engine.46999.n3.nabble.com/Firing-Specific-rules-using-KBase-and-</a><br>
&gt; StatefulKnowledgeSession-tp1444889p1444889.html<br>
&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
**************************************************************************************<br>
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the <a href="mailto:postmaster@nds.com">postmaster@nds.com</a> and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.<br>

<br>
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00<br>
**************************************************************************************<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br>