Normally a Fusion session is created once, possibly initialized with some static facts,<br>and then you use the entry point to insert events, call fireAllRules, and wait for the<br>next event to arrive from its source. Therefore, keep the session and the entry point<br>
for repeated use by the last two statements.<br>-W<br><br><div class="gmail_quote">On 22 October 2010 06:08, Pankaj Khattar <span dir="ltr">&lt;<a href="mailto:pankaj.khattar1@alcatel-lucent.com">pankaj.khattar1@alcatel-lucent.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hi,<br>
<br>
I am facing the same problem, i have read somewhere that we can use the same<br>
session throughout the application but I&#39;m unable to figure it how?<br>
<br>
Also how can we insert events from my application into the same working<br>
memory entry-point?<br>
<br>
Below is the code I&#39;m using please let me know if this is the right way to<br>
do it<br>
<br>
static StatefulKnowledgeSession session;<br>
<br>
session  = knowledgeBase.newStatefulKnowledgeSession();<br>
WorkingMemoryEntryPoint entryPoint =<br>
session.getWorkingMemoryEntryPoint(&quot;NotificationStream&quot;);<br>
entryPoint.insert(new MyReceivedEvent());<br>
session.fireAllRules();<br>
<br>
I&#39;m calling the above code every time a new event is received. Also in the<br>
finally block I&#39;m calling session.dispose();<br>
<br>
While inserting the 2nd event in entry-point I&#39;m getting<br>
org.drools.RuntimeDroolsException: Unexpected exception executing action<br>
org.drools.reteoo.PropagationQueuingNode$PropagateAction@9ff411  Caused by:<br>
java.util.concurrent.RejectedExecutionException.<br>
<br>
Can anyone please let me know the right way to do it?<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Error-Inserting-events-into-drools-fusion-stream-tp1746213p1750434.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Error-Inserting-events-into-drools-fusion-stream-tp1746213p1750434.html</a><br>

Sent from the Drools - User 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>