You need to analyze what the rules are doing, probably you have an infinite loop in your rules that is causing recursion and never ending. <div>Can you share your rules? or activate the console logs to see what&#39;s happening (KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession)).</div>
<div>Cheers</div><div><br><div class="gmail_quote">On Wed, Sep 21, 2011 at 1:24 PM, bishopmm <span dir="ltr">&lt;<a href="mailto:michael.marion.bishop@hp.com">michael.marion.bishop@hp.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I&#39;m using Drools to build a wizard app within a web application. The<br>
StatefulKnowledgeSession runs within its own thread. After loading the<br>
rules, I call fireAllRules() to start the knowledge session. Within the<br>
wizard app, the user has the option to click on a cancel button in order to<br>
stop the wizard. When the user cancels the wizard, a rule is fired that<br>
attempts to stop the knowledge session. I&#39;ve tried calling drools.halt() and<br>
drools.getWorkingMemory().clearAgenda() from within that rule, but<br>
fireAllRules() doesn&#39;t return, and the thread is left hanging. What do I<br>
need to do to get fireAllRules() to return? I&#39;m fairly new to Drools, and I<br>
apologize in advance if I&#39;ve missed something blatantly obvious.<br>
<br>
Thanks,<br>
Mike<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/How-to-terminate-a-StatefulKnowledgeSession-tp3355958p3355958.html" target="_blank">http://drools.46999.n3.nabble.com/How-to-terminate-a-StatefulKnowledgeSession-tp3355958p3355958.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br> - CTO @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com</a>  <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div>
- Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br> - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div>
<br>
</div>