you need to call ksession.fireAllRules() after: ksession.insert(new Event(a))<br><br><br><div class="gmail_quote">On Sun, Jan 10, 2010 at 6:29 PM, Khalil Hafsi <span dir="ltr"><<a href="mailto:hafsi@fzi.de">hafsi@fzi.de</a>></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;">Hi Guys,<br>
<br>
I am using DROOLS FUSION last version<br>
It is very important for me that events arrive in the order i fire them<br>
, this is a part of the code used for stream mode :<br>
> KnowledgeBuilder kbuilder =<br>
> KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
><br>
> kbuilder.add(ResourceFactory.newClassPathResource("pol.drl"),<br>
> ResourceType.DRL);<br>
> if ( kbuilder.hasErrors() ) {<br>
> System.err.println( kbuilder.getErrors().toString() );<br>
> }<br>
> KnowledgeBaseConfiguration config =<br>
> KnowledgeBaseFactory.newKnowledgeBaseConfiguration();<br>
> config.setOption(EventProcessingOption.STREAM);<br>
> KnowledgeBase kbase =<br>
> KnowledgeBaseFactory.newKnowledgeBase(config);<br>
> kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());<br>
><br>
> StatefulKnowledgeSession ksession =<br>
> kbase.newStatefulKnowledgeSession();<br>
<br>
after this part I just start inserting Events into the ksession , i.e<br>
ksession.insert(new Event(a)) ...<br>
<br>
does this suffice to make the the engine in stream mode and hence ordered ?<br>
In the example app , Events were fired as they arrive , but a timestamp<br>
was given , and also agenda and jobs were used.<br>
Is that necessary for the engine to work in stream mode ?<br>
I have a piece of code that gives me different results every time I run<br>
it ?! it is in stream mode , but for some reason the rule either do not<br>
fire , or do not print the output. is there a way to debug into this ?<br>
<br>
thank you .<br>
k-<br>
<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>
</blockquote></div><br><br clear="all"><br>-- <br> - <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br> - <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br> - Salatino "Salaboy" Mauricio -<br>