Hi Ric,<br><br>The method fireAllRules shouldn&#39;t block you ... I&#39;m also using similar rules and similar fact inyection system and the fireAllRules never block me ... isnt it?<br><br><div class="gmail_quote">2009/11/13 richarda <span dir="ltr">&lt;<a href="mailto:richard.ambridge@gmail.com">richard.ambridge@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
I may have solved this, but still not sure I am doing this &#39;correctly&#39;<br>
<br>
I have changed this to use one call to fireUntilHalt()<br>
and then from the insert code it now inserts the fact and runs:<br>
                ksession.startProcess(&quot;rulesflow&quot;);<br>
(and no fireAllRules)<br>
<br>
which seems to bring the engine to life again..<br>
<br>
Is this correct?<br>
<div><div></div><div class="h5"><br>
<br>
richarda wrote:<br>
&gt;<br>
&gt; Hi all,<br>
&gt;<br>
&gt;  I am stuck trying to understand how to setup my drools system..<br>
&gt;<br>
&gt;  I am using Stream mode, with some negative rules, and a continuous stream<br>
&gt; of facts.<br>
&gt; Facts are evaluated and will in turn insert events into the memory if<br>
&gt; required.<br>
&gt;<br>
&gt; I thought it would be like this:<br>
&gt; First, setup,<br>
&gt;<br>
&gt; KnowledgeBaseConfiguration conf =<br>
&gt; KnowledgeBaseFactory.newKnowledgeBaseConfiguration();<br>
&gt; conf.setOption(EventProcessingOption.STREAM);<br>
&gt; KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(conf);<br>
&gt; kbase.addKnowledgePackages(builder.getKnowledgePackages());<br>
&gt; ksession = kbase.newStatefulKnowledgeSession();<br>
&gt;<br>
&gt; Then we have ksession...<br>
&gt; The code that handles an incoming message will have a reference to<br>
&gt; ksession..<br>
&gt; and it will run:<br>
&gt;<br>
&gt; WorkingMemoryEntryPoint eStream =<br>
&gt; ksession.getWorkingMemoryEntryPoint(&quot;MessageStream&quot;);<br>
&gt; eStream.insert(msg);<br>
&gt; ksession.fireAllRules();<br>
&gt;<br>
&gt; but here is my problem...<br>
&gt; as some rules have things like  not(Event(this after [0s,90m] $a))<br>
&gt; then the fireAllRules can wait for the 90minutes to pass before<br>
&gt; completing..<br>
&gt;<br>
&gt; How do I do it so that there is one WorkingMemory,<br>
&gt; and I can pump facts into that memory and the engine just keeps running<br>
&gt; and my &#39;inputter&#39; doesn&#39;t hang..?<br>
&gt;<br>
&gt; Thanks<br>
&gt; Ric<br>
&gt;<br>
&gt;<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://old.nabble.com/Help-with-StatefulSession-and-Stream-Mode-tp26335206p26335542.html" target="_blank">http://old.nabble.com/Help-with-StatefulSession-and-Stream-Mode-tp26335206p26335542.html</a><br>

<div><div></div><div class="h5">Sent from the drools - user mailing list archive at Nabble.com.<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>
</div></div></blockquote></div><br>