<div>There are two values that Drools uses with facts that have been given @role(event): timestamp and duration. </div><div><br></div><div>The timestamp may be a fact field, provided by you, or added automatically (in a hidden location) by Drools. If it is a field called &quot;x&quot;, you must say</div>
<div>   @timestamp( x )</div><div>in the declare. The duration field must be provided as a fact field, say &quot;y&quot;, so you must say</div><div>   @duration( y )</div><div>in the declare, or else duration is 0. </div>
<div><br></div><div>@timestamp and @duration cannot be changed after the event&#39;s insertion. </div><div><br></div><div>If you have an event whose end you don&#39;t know when you are informed about it&#39;s beginning, then you&#39;ll have to make do with two events, one marking the start and the other one the end.</div>
<div><br></div><div>If you&#39;re in CLOUD mode, you can combine a start and a matching end event to one with a start and a duration and continue to reason with that.</div><div><br></div><div>-W</div><br><br><div class="gmail_quote">
2012/3/9 Matteo Cusmai <span dir="ltr">&lt;<a href="mailto:cusmaimatteo@gmail.com">cusmaimatteo@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>i have the same problem, i haven&#39;t well understood meaning and use of timestamp and duration fields.<br>From my understanding, timestamp field is start time and duration is difference between end time and start time.<br>

Is it rigth?<br>On the other hand, i know that it is a good practice don&#39;t change these 2 fields. I mean, it isn&#39;t suggested to modify duration or timestamp after that the event is inserted in session (is it right?)<br>

Furthermore, it is bad practice to insert an event with old timestamp, compared to system time.<br>So, i don&#39;t understand, how is it possible to manage event with duration.<br><br>If i have an event with timestamp t1 and duration 5s, of course i know it when it is finished, so i have to insert it into session with old timestamp.<br>

<br>Sorry for bad English, i hope i was clear.<br><br>Thanks a lot,<div class="HOEnZb"><div class="h5"><br><br><br><div class="gmail_quote">On Fri, Mar 9, 2012 at 5:08 PM, mind <span dir="ltr">&lt;<a href="mailto:gil.vegliach@gmail.com" target="_blank">gil.vegliach@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">1) Ok, I need the precise semantics for interval-based event, not the point<br>
events.<br>
2) Well the docs lacks information on the starting time and the ending time<br>
of events and then defines the semantics of temporal operators: there must<br>
be something missing. Moreover even looking at the example I couldn&#39;t fine<br>
anything.<br>
3) I want to set the duration though, all my software works with<br>
interval-based events...<br>
<br>
Gil<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Duration-attritube-and-Temporal-Operators-tp3810201p3813079.html" target="_blank">http://drools.46999.n3.nabble.com/Duration-attritube-and-Temporal-Operators-tp3810201p3813079.html</a><br>


<div><div>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" 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>
</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>