if you don't put any timestamp fusion will automatically assign the timestamp at the insertion time.<br>I see the problem now. You are probably not using the entry points for events.<br>In your rules you need to add for example:<br>
Alarm() from entry-point "alarmsEntryPoint"<br><br>and then you need to insert the events in:<br><br>ksession.getWorkingMemoryEntryPoint("alarmsEntryPoint").insert(new Alarm());<br><br>that will treat your POJO as event in fusion.<br>
Please read the fusion documentation:<br><a href="http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-fusion/html_single/index.html#d0e523">http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-fusion/html_single/index.html#d0e523</a><br>
<br><br><div class="gmail_quote">2010/1/10 Khalil Hafsi <span dir="ltr"><<a href="mailto:hafsi@fzi.de">hafsi@fzi.de</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
<tt>Hi Mauricio,<br>
<br>
Of course I did. What about the timestamps , agenda and jobs that were
used in the example , are they necessary ?<br>
<br>
Thanks,<br><font color="#888888">
k-<br>
</font></tt><div><div></div><div class="h5"><br>
Mauricio Salatino wrote:
<blockquote type="cite">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" target="_blank">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" target="_blank">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" target="_blank">http://salaboy.wordpress.com</a><br>
- <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br>
- Salatino "Salaboy" Mauricio -<br>
</blockquote>
</div></div></div>
<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>
<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>