There are two values that Drools uses with facts that have been given
@role(event): timestamp and duration.
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 "x", you must say
@timestamp( x )
in the declare. The duration field must be provided as a fact field, say
"y", so you must say
@duration( y )
in the declare, or else duration is 0.
@timestamp and @duration cannot be changed after the event's insertion.
If you have an event whose end you don't know when you are informed about
it's beginning, then you'll have to make do with two events, one marking
the start and the other one the end.
If you'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.
-W
2012/3/9 Matteo Cusmai <cusmaimatteo(a)gmail.com>
Hi all,
i have the same problem, i haven't well understood meaning and use of
timestamp and duration fields.
From my understanding, timestamp field is start time and duration is
difference between end time and start time.
Is it rigth?
On the other hand, i know that it is a good practice don't change these 2
fields. I mean, it isn't suggested to modify duration or timestamp after
that the event is inserted in session (is it right?)
Furthermore, it is bad practice to insert an event with old timestamp,
compared to system time.
So, i don't understand, how is it possible to manage event with duration.
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.
Sorry for bad English, i hope i was clear.
Thanks a lot,
On Fri, Mar 9, 2012 at 5:08 PM, mind <gil.vegliach(a)gmail.com> wrote:
> 1) Ok, I need the precise semantics for interval-based event, not the
> point
> events.
> 2) Well the docs lacks information on the starting time and the ending
> time
> of events and then defines the semantics of temporal operators: there must
> be something missing. Moreover even looking at the example I couldn't fine
> anything.
> 3) I want to set the duration though, all my software works with
> interval-based events...
>
> Gil
>
> --
> View this message in context:
>
http://drools.46999.n3.nabble.com/Duration-attritube-and-Temporal-Operato...
> Sent from the Drools: User forum mailing list archive at
Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users