You are invoking thread.run() instead of thread.start()... Huge difference.<div><br></div><div>Best,<br><br><div class="gmail_quote">2010/7/1 Edson Tirelli <span dir="ltr">&lt;<a href="mailto:tirelli@post.com">tirelli@post.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">   From what I can see from your code, it looks ok, but to know what is happening we would need the audit log and some example rule that you would expect to fire, but is not being fired.<div>

<br></div><div>   Edson<br><br>
<div class="gmail_quote">2010/6/30 Jean-Philippe Steinmetz <span dir="ltr">&lt;<a href="mailto:jeanphilippe@trilogystudios.com" target="_blank">jeanphilippe@trilogystudios.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div></div><div class="h5">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">Hello all,</p><p class="MsoNormal"> </p><p class="MsoNormal">I’d like to get Drools working in such a way that it is always running and I can just stream new events into the runtime and have it execute rules against them. From what I can tell I need to use stream mode in order to do this. I’ve got everything set up for how I think it should work (based on what I can decipher from the documentation) but what’s happening is that I’m never getting a hit on the rules I write. I can see the event be asserted but nothing happens.</p>


<p class="MsoNormal"> </p><p class="MsoNormal">Here is my set up…</p><p class="MsoNormal" style="text-autospace:none"> </p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">KnowledgeBaseConfiguration config = KnowledgeBaseFactory.<i>newKnowledgeBaseConfiguration</i>();</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">config.setOption(EventProcessingOption.</span><i><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#0000C0">STREAM</span></i><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">);</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">setKnowledgeBase(KnowledgeBaseFactory.<i>newKnowledgeBase</i>(config));</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#3F7F5F">// Create a knowledge agent to pull load the necessary resources</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#0000C0">kagent</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> = KnowledgeAgentFactory.<i>newKnowledgeAgent</i>(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF">&quot;MyAgenda&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">, getKnowledgeBase());</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">initResources(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#0000C0">kagent</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">);</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">setKnowledgeBase(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#0000C0">kagent</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">.getKnowledgeBase());</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">getSession().addEventListener(</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> DebugAgendaEventListener());</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">getSession().addEventListener(</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> DebugWorkingMemoryEventListener());</span></p>


<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p><p class="MsoNormal">And here is how I start up Drools…</p><p class="MsoNormal"> </p><p class="MsoNormal" style="text-autospace:none">


<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#0000C0">thread</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> = </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> Thread() {</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">    </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#646464">@Override</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">    </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">public</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">void</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> run() {</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">        getSession().fireUntilHalt();</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">    }</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p><p class="MsoNormal">


<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">};</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#0000C0">thread</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">.run();</span></p>


<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p><p class="MsoNormal">I then feed events into the engine like this…</p><p class="MsoNormal"> </p><p class="MsoNormal" style="text-autospace:none">


<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">WorkingMemoryEntryPoint stream = getSession().getWorkingMemoryEntryPoint(origin);</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">stream.insert(event);</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>


<p class="MsoNormal">I’m obviously missing something in my setup. Any help on understanding how this is supposed to work is greatly appreciated. Again, the goal here is to get Drools in a state that is always running so I can pipe in events to it and have rules execute against them.</p>


<p class="MsoNormal"> </p><font color="#888888"><p class="MsoNormal">Jean-Philippe</p></font></div></div><br></div></div><div class="im">_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
<br></div></blockquote></div><div class="im"><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
</div></div>
<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>
<br></blockquote></div><br><br clear="all"><br>-- <br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>
</div>