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"><<a href="mailto:ulrich.kriegel@isst.fraunhofer.de">ulrich.kriegel@isst.fraunhofer.de</a>></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 "set initial state"<br>
dialect "java"<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("ActivityState inserted "+ new Date());<br>
end<br>
<br>
<br>
<br>
<br>
declare Command<br>
@role (event)<br>
end<br>
<br>
<br>
rule "request information"<br>
dialect "java"<br>
when Command(commandType == CommandType.REQUEST_INFORMATION) from<br>
entry-point "XXX"<br>
$s: ActivityState(state == ComponentStateType.ACTIVE||state ==<br>
ComponentStateType.PASSIVE||state == ComponentStateType.STANDBY)<br>
then<br>
System.out.println("Send Report");<br>
end<br>
<br>
<br>
The rule request information doesn't fire with the first command event, but<br>
from the second one it fires always.<br>
<br>
What'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 "Salaboy" Mauricio -</div>
<br>
</div></div>