Hi Everyone,<br><br>I&#39;m aware that in Drools you can use &#39;insert()&#39; in the &#39;then&#39; part of a rule to insert a new fact into the memory, meaning more rules may be fired based on the addition of this new fact. I wish to do a similar thing, but I wish to insert the fact into a specific entry point. My current rule code to do this is:<br>
<br><span style="color: rgb(51, 102, 255);">rule &quot;Allow message buyBook&quot;</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">no-loop true</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    when</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">        $event : MessageRecievedEvent(operationName == &quot;buyBook&quot;) from entry-point &quot;t1 stream&quot;</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    then</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">        MessageRecievedEvent mre = new MessageRecievedEvent();</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        mre.setOperationName(&quot;sellBook&quot;);</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">        StatefulKnowledgeSession session = kcontext.getKnowledgeRuntime().getKnowledgeBase().newStatefulKnowledgeSession();</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        WorkingMemoryEntryPoint obStream = session.getWorkingMemoryEntryPoint(&quot;ob1 stream&quot;);</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">        obStream.insert(mre);</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        session.fireAllRules();</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">end</span><br style="color: rgb(51, 102, 255);"><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">rule &quot;ob1&quot;</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">no-loop true</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">    when</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        $event : MessageRecievedEvent(operationName == &quot;sellBook&quot;) from entry-point &quot;ob1 stream&quot;</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">    then</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        System.out.println(&quot;executed&quot;);</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">end</span><br><br>Which is pretty hideous, but it does work, causing the second rule to fire after the first one. What I would like is something like:<br>
<br><span style="color: rgb(51, 102, 255);">rule &quot;Allow message buyBook&quot;</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">no-loop true</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    when</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        $event : MessageRecievedEvent(operationName == &quot;buyBook&quot;) from entry-point &quot;t1 stream&quot;</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    then</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        MessageRecievedEvent mre = new MessageRecievedEvent();</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        mre.setOperationName(&quot;sellBook&quot;);</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        <span style="color: rgb(255, 0, 0);">insert(mre, &quot;ob1 stream&quot;)</span></span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">end</span><br style="color: rgb(51, 102, 255);">
<br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">rule &quot;ob1&quot;</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">no-loop true</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    when</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        $event : MessageRecievedEvent(operationName == &quot;sellBook&quot;) from entry-point &quot;ob1 stream&quot;</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    then</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">        System.out.println(&quot;executed&quot;);</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">end</span><br><br><font color="#000000">Is something like this possible or will I have to write a function to do it? I&#39;m also a bit concerned about the performance hit of creating a whole new StatefulKnowledgeSession to fire the second rule, I&#39;d like to just use the current one.<br>
<br>Thanks,<br><br>Justin<br></font>