<div>Hi Mauricio,<br></div><div></div><div>We are using Drools Fusion. However, the classes from the example that you mentioned in your previous post ( <a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-examples/drools-examples-fusion">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-examples/drools-examples-fusion</a> ) are not documented in the documentation (org.drools.time.Trigger and org.drools.time.TimerService are not mentioned in the documentation: <a href="http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-fusion/html_single/index.html">http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-fusion/html_single/index.html</a> ).</div>

<div></div><div>The events that we are creating have the role &quot;event&quot; and they are matched with the rules which are written in Fusion using the temporal reasoning enabling operators. To get the comlex events feedback (printouts), please uncomment the &quot;println&quot; statements in the &quot;then&quot; part in the fusion.drl (rule file), these were commented out to get better results in the benchmarks. </div>

<div>I attached the sources in this email.<br><br>BTW: We have a second question regarding aggregate functions (count, sum, etc.). Does Drools Fusion provides any kind of aggregates over events or these should be created separately in the .drl file (as rules)? We cannot find anything like that in the documentation.</div>

<div></div><div>Regards,</div><div>Paul Fodor.</div><div></div><div>fusion.drl: </div><div>//package tests<br><br>//Check docu at <a href="http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html/ch02.html">http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html/ch02.html</a><br>

import Event<br>declare Event<br> @role (event)<br> @expires (64m)<br>end<br><br>/*rule Newevent_detected_debug_only<br>dialect &quot;mvel&quot;<br>when<br> $a : Event()<br>then<br> System.out.println(&quot;Event &quot;+ $a.symbol + &quot; has been fired !&quot;);<br>

end*/<br><br>rule &quot;experiment A -Rule 0/0&quot;<br>when<br> $ae1 :Event(symbol == 1, $Pr1 : price) and<br> $ce1 :Event(this after $ae1 , symbol == 1, price &gt; ($Pr1/1.2))<br>then<br> //System.out.println(&quot;Ce1 fired !&quot;);<br>

end<br>rule &quot;experiment A -Rule 0/1&quot;<br>when<br> (<br> $ae2 :Event(symbol == 2,$Pr2 : price) and<br> $ce2 : Event(this after $ae2 , symbol == 2,price &gt; ($Pr2/1.2) )<br> ) <br>then <br> //System.out.println(&quot;Ce2 fired !&quot;);<br>

end<br>rule &quot;experiment A -Rule1&quot;<br>when<br> (<br> $ae1 :Event(symbol == 1, $Pr1 : price) and<br> $ce1 :Event(this after $ae1 , symbol == 1, price &gt; ($Pr1/1.2) )<br> ) <br>         or <br> (<br> $ae2 :Event(symbol == 2,$Pr2 : price) and<br>

 $ce2 : Event(this after $ae2 , symbol == 2,price &gt; ($Pr2/1.2) )<br> ) <br>then<br> //System.out.println(&quot;Ce3 fired !&quot;);<br>end<br><br>rule &quot;experiment A -Rule4&quot;<br>when<br> (<br> $ae1 :Event(symbol == 1, $Pr1 : price) and<br>

 $ce1 :Event(this after $ae1 , symbol == 1, price &gt; ($Pr1/1.2) )<br> ) <br>         and<br> (<br> $ae2 :Event(symbol == 2,$Pr2 : price) and<br> $ce2 : Event(this after $ae2 , symbol == 2,price &gt; ($Pr2/1.2) , this after[0,20m] $ce1 )<br>

 )<br>then<br> //System.out.println(&quot;Ce4 fired !&quot;);<br>end<br><br>rule &quot;experiment A -Rule5&quot;<br>when<br> (<br> $ae1 :Event(symbol == 1, $Pr1 : price) and <br> $ce1 :Event(this after $ae1 , symbol == 1, price &gt; ($Pr1/1.2))<br>

 ) <br>         and<br> (<br> $ae2 :Event(symbol == 2,$Pr2 : price)  and<br> $ce2 : Event(this after $ae2 , symbol == 2,price &gt; ($Pr2/1.2) , this overlaps $ce1)<br> )<br> <br>then<br><br> //System.out.println(&quot;Ce5 fired !&quot;);<br>

end<br><br><br></div><div></div>