Are you calling the fireAllRules() method after inserting the events? or using fireUntilHalt()?<div>You can activate the log to see what is happening with:</div><div>KnowledgeRuntimeLoggerFactory.newConsoleLogger(session);</div>

<div><br><div>Cheers<br><br><div class="gmail_quote">On Wed, Nov 9, 2011 at 1:37 PM, ukriegel <span dir="ltr">&lt;<a href="mailto:ulrich.kriegel@isst.fraunhofer.de">ulrich.kriegel@isst.fraunhofer.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi there,<br>
we use drools fusion 5.3. Final.<br>
In a drl-file, a fact and an event and the following rules are declared<br>
<br>
package ... etc<br>
<br>
declare ActivityState<br>
        @role(fact)<br>
        state : StateType<br>
end<br>
<br>
<br>
rule &quot;set initial state&quot;<br>
        dialect &quot;java&quot;<br>
        salience 100<br>
        when not (exists KFActivityState())<br>
        then<br>
                ActivityState $actState = new ActivityState();<br>
                $actState.setState(StateType.STANDBY);<br>
                insert($actState);<br>
                System.out.println(&quot;ActivityState inserted &quot;+ new Date());<br>
end<br>
<br>
<br>
<br>
<br>
declare Command<br>
        @role (event)<br>
end<br>
<br>
<br>
rule &quot;request information&quot;<br>
        dialect &quot;java&quot;<br>
        when Command(commandType == CommandType.REQUEST_INFORMATION) from<br>
entry-point &quot;XXX&quot;<br>
                 $s: ActivityState(state == ComponentStateType.ACTIVE||state ==<br>
ComponentStateType.PASSIVE||state == ComponentStateType.STANDBY)<br>
        then<br>
                 System.out.println(&quot;Send Report&quot;);<br>
end<br>
<br>
<br>
The rule request information doesn&#39;t fire with the first command event, but<br>
from the second one it fires always.<br>
<br>
What&#39;s wrong with my code?<br>
<br>
Thanks in advance<br>
<br>
Ulrich<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/rule-does-not-fire-at-first-event-tp3494056p3494056.html" target="_blank">http://drools.46999.n3.nabble.com/rule-does-not-fire-at-first-event-tp3494056p3494056.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></span></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></div>