<br>&nbsp;&nbsp; There are two concepts that need to be understood here: SessionClock and type declaration.<br><br>&nbsp;&nbsp; SessionClock is the clock of the session. You can use a realtime clock for your session, or any other session clock implementation. At this moment we only provide a realtime one, and a PseudoClock (meaning it is a clock controlled by the application code). We can add heartbeat clocks and any other implementations of the session clock interface, but they are not there. <br>
&nbsp;&nbsp;&nbsp; When developing unit tests for instance, I imagine you will always use PseudoClock, because the test controls the clock and make sure the rules are behaving accordingly.<br><br>&nbsp;&nbsp;&nbsp; The other concept is type declaration. When you declare a type as an &quot;event&quot;, you can optionaly tell the engine what field in that type is used as timestamp. If you don&#39;t, the engine will assign to the event the timestamp of the session clock in the momment the event is inserted into the engine.<br>
<br>declare CreditAuthorizationRequest<br>&nbsp;&nbsp;&nbsp; @role( event )<br>&nbsp;&nbsp;&nbsp; @timestamp( datetimeOfRequest )<br>end<br><br>&nbsp;&nbsp;&nbsp; For your case, you can either tell the engine to use a specific timestamp attribute when running the batch autorizations at the end of the date, or use the PseudoClock, setting it to the appropriate time, before inserting each event. There are semantic differences in both approaches, so you need to look at the whole of your scenario to decide what is more appropriate to you. <br>
<br>&nbsp;&nbsp; Ok, can someone help translating this into a users manual? ;) Or examples?<br><br>&nbsp;&nbsp;&nbsp; /me back to docs<br><br>&nbsp;&nbsp;&nbsp; Edson<br><br>&nbsp;&nbsp; <br><br><div class="gmail_quote">2009/2/2 John A Thompson <span dir="ltr">&lt;<a href="mailto:fly.yamaha@gmail.com">fly.yamaha@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Edson,<br><br>I&#39;m very interested in fusion.&nbsp; I&#39;m looking at it using it for fraud detection in a credit card authorization system.<br>
<br>Quick question - can the time of facts be asserted?&nbsp; I&#39;m thinking around how to handle testing, and business requirements of batch authorizations. (where 3rd parties send in batch at the end of the day)<br>
<br>Thanks!<br><font color="#888888"><br>JT</font><div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Mon, Feb 2, 2009 at 3:30 PM, Edson Tirelli <span dir="ltr">&lt;<a href="mailto:tirelli@post.com" target="_blank">tirelli@post.com</a>&gt;</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;">
<br>&nbsp;&nbsp; Do you know the concept of sliding time windows? Meaning you define a time interval, for instance the last 30 seconds, so at time T30, the window contains anything that happened between T1 and T30. At T31, it forgets anything that happened on T1 and the window now contains everything from T2 to T31, and so on.<br>


<br>&nbsp;&nbsp; So, think about sliding windows as a filter.<br><br>
StockTick( symbol == &quot;RHAT&quot; ) over window:time( 60s )<br><br>&nbsp;&nbsp; The pattern above will match all StockTicks whose symbol is RHAT and that happened in the last 60 seconds. Since time is continuous (unless you use a pseudo clock that you control manually), events will age and fall outside the boundary of the window (in this case, older than 60 seconds). When that happens, they will expired and will no longer match.<br>


<br>&nbsp;&nbsp; Once a regular activation is created, it will remain in the agenda until it is fired. Even if the event expires before the activation is fired. The only &quot;special case&quot; for this are the aggregations, that are constantly updated and at fire time, will contain the current result.<br>


<br>&nbsp;&nbsp; Over is just the keyword used to introduce behaviors of a pattern, like time windows, length windows and so on. Hopefully docs will contain a better explanation.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><br><div class="gmail_quote">


2009/2/2 Trägenap <span dir="ltr">&lt;<a href="mailto:traegenap@ttc-informatik.de" target="_blank">traegenap@ttc-informatik.de</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


I hope you will not be interrupted by too many postings....<br>
<br>
but -sorry- what is the result of<div><br>
<br>
StockTick( symbol == &quot;RHAT&quot; ) over window:time( 1h30m15s )<br>
<br></div>
?<br>
<br>
a) all StockTick Entities which has symbol &quot;RHAT&quot; at some point during the time period? In other words: are StockTicks included where symbol had changed for e.g. within the first 30 minutes?<br>
<br>
b) all StockTick Entities which have symbol &quot;RHAT&quot; when rule fires?<br>
<br>
What means &quot;over&quot;? Is the rule allowed to fire after period of 1h30m14s, is this right?<br>
<br>
<br>
Thanks<br>
Thorsten<br>
<br>
<br>
Edson Tirelli schrieb:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
<br>
 &nbsp; I started writing fusion docs a couple days ago. You can follow the progress through hudson builds or checking out the source code from svn.<br>
<br>
 &nbsp; Regarding your question, clock ticks are an abstract concept that depends on the clock implementation you are using. Since I wrote the test case you saw, I added support for proper time units, and as so, I recommend you use them. So, if you want to create a sliding window of 1 hour 30 min and 15 seconds, for instance, just do:<br>



<br>
StockTick( symbol == &quot;RHAT&quot; ) over window:time( 1h30m15s )<br>
<br>
 &nbsp; I did not wrote that part of the docs yet, and in case anyone want to help, it would be most welcome.<br>
<br>
 &nbsp; []s<br>
 &nbsp; Edson<br>
<br></div>
2009/2/1 Trägenap &lt;<a href="mailto:traegenap@ttc-informatik.de" target="_blank">traegenap@ttc-informatik.de</a> &lt;mailto:<a href="mailto:traegenap@ttc-informatik.de" target="_blank">traegenap@ttc-informatik.de</a>&gt;&gt;<div>


<br>
<br>
 &nbsp; &nbsp;Hi,<br>
<br>
 &nbsp; &nbsp;2 questions:<br>
<br>
 &nbsp; &nbsp;1. I want to start a ruleflow-group for e.g. only once a day? I am<br>
 &nbsp; &nbsp;not interested in the pattern matches during the complete day, just<br>
 &nbsp; &nbsp;interested in the result of the single computation. My<br>
 &nbsp; &nbsp;ruleflow-group is ordered using a salience, the final/last rule<br>
 &nbsp; &nbsp;should be processed once a day, repeating at the next day, and so on...<br>
<br>
 &nbsp; &nbsp;I found the example like this<br>
<br>
 &nbsp; &nbsp;StockTick( symbol == &quot;RHAT&quot; ) over window:time( 60 )<br>
<br>
 &nbsp; &nbsp;(...that happened in the last 60 clock ticks...)<br>
<br>
 &nbsp; &nbsp;What is declared as &quot;clock ticks&quot;?<br>
<br>
<br>
 &nbsp; &nbsp;2. I guess that drools fusion can solve my problem, is some more<br>
 &nbsp; &nbsp;detailed doc available at this moment? (more than the ´pure´<br>
 &nbsp; &nbsp;headlines containing doc I found everywhere?)<br>
<br>
 &nbsp; &nbsp;Thanks for advice, including just giving keywords!<br>
<br>
 &nbsp; &nbsp;Thorsten<br>
 &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp;rules-users mailing list<br></div>
 &nbsp; &nbsp;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a> &lt;mailto:<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<div>
<br>
 &nbsp; &nbsp;<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
<br>
<br>
-- <br>
&nbsp;Edson Tirelli<br>
&nbsp;JBoss Drools Core Development<br></div>
&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a> &lt;<a href="http://www.jboss.com" target="_blank">http://www.jboss.com</a>&gt;<br>
<br>
<br>
------------------------------------------------------------------------<div><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>
</div></blockquote>
<br>
<br>
-- <br>
<br>
<br>
*Gesprächspartner:*<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<br>
<br>
<br>
<br>
*Datum:*<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<br>
<br>
<br>
<br>
*Inhalt:*<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<br>
<br>
<br>
<br>
*TODO:*<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<br>
<br>
<br>
<br>
*Rückmeldung bis:*<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<br>
<br>
<br>
<br>
*Absender:*<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<br>
<br>
&nbsp;TT<div><div></div><div><br>
<br>
<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><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>
<br></blockquote></div><br>
</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> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>