Re: [rules-users] Duration attritube and Temporal Operators

2012-03-10 Thread mind
Ok, I guessed that, but how is the precise semantics of temporal operator
then? The docs uses a bizarre startTimestamp and endTimestamp that are not
defined anywhere. Do those relate to timestamp and duration? And how?

Thanks,
Gil

--
View this message in context: 
http://drools.46999.n3.nabble.com/Duration-attritube-and-Temporal-Operators-tp3810201p3815382.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Duration attritube and Temporal Operators

2012-03-10 Thread Wolfgang Laun
Well, in everyday life, a duration is what is between start and end.
Here's the
trivial relation between the notation used in the temporal operators' docs
and
the @nnotated fields in an event:

$x.startTimestamp == @timestamp
$x.endTimestamp == @timestamp + @duration

I think that the operator definitions are clear enough - do you have any
particular problem?

-W

On 10 March 2012 18:16, mind gil.vegli...@gmail.com wrote:

 Ok, I guessed that, but how is the precise semantics of temporal operator
 then? The docs uses a bizarre startTimestamp and endTimestamp that are not
 defined anywhere. Do those relate to timestamp and duration? And how?

 Thanks,
 Gil

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Duration-attritube-and-Temporal-Operators-tp3810201p3815382.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Duration attritube and Temporal Operators

2012-03-09 Thread Benjamin Bennett
Pretty sure I am correct, think the  devs are at a conference this week in
London. http://blog.athico.com/

1)Start time , point time interval.

2)Don't know exactly, I think the documentation is just showing what is
meant.

But it does say you need to set at least the start time and duration.

If you don't set the time stamp , it gets a timestamp of the time it was
inserting into working memory and duration 0.

3)timestamp is the same as start time. if no duration is set

In our rule set , I set a timestamp attribute, duration and also a
endtimestamp.

You can also do items like this , but reading the docs I am double checking

timeEndMs after[-120s,120s] AND0.timeMs ,


More is in the
http://docs.jboss.org/drools/release/5.4.0.Beta2/drools-fusion-docs/html/ch02.html#d0e289


I think the start and endtime time stamp statements in the documentation is
for clarity.


When working with the rules we have , reading the documentation let me know
if the temporal operators is what I needed.



On Mar 8, 2012 11:55 AM, mind gil.vegli...@gmail.com wrote:

 Hello everybody,

 I recently started using Drools (with C#) and I have some problems in
 understanding how temporal operators work with the duration field.
 According
 to the documentation, the temporal operators work with startTimestamp and
 endTimestamp of events, the semantics being defined with inequalities. In
 order to work, temporal operator requires the duration field to be
 declared.
 Now the questions:
 1. What does @timeStamp stay for? The start or the end timestamp?
 2. Does Drools calculate startTimestamp and endTimestamp if I set
 @timeStamp
 and @duration attribute from my C# code? If not how can I set them? (like
 shall I declare like @startTimeStamp(sth) and set from the C# code?)
 3. Do temporal operators work if I do not set explicitly the start and end
 timestamps but just @timeStamp and @duration attributes?


 In particular, I have this drl file (%VAR% are replaced by other code):


 declare IntensionalEvent
@role(event)
@timeStamp(timeStamp)
@duration(duration)
 end

 rule Expression (%EVENTNAME1%, %OPERATOR%, %EVENTNAME2%, %TIMESPAN%,
 %TIMEVAR%)
dialect mvel
when
$eventA : IntensionalEvent( name == '%EVENTNAME2%' )
$eventB : IntensionalEvent( this %OPERATOR% $eventA,
name == '%EVENTNAME1%'
) over window:time( %TIMESPAN% )

then
  blah blah... create an IntensionalEvent and set timestamp
 and duration

 end

 Thanks everybody,
 Gil

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Duration-attritube-and-Temporal-Operators-tp3810201p3810201.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Duration attritube and Temporal Operators

2012-03-09 Thread mind
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-Operators-tp3810201p3813079.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Duration attritube and Temporal Operators

2012-03-09 Thread Matteo Cusmai
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.vegli...@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-Operators-tp3810201p3813079.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Duration attritube and Temporal Operators

2012-03-09 Thread Wolfgang Laun
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 cusmaimat...@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.vegli...@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-Operators-tp3810201p3813079.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Duration attritube and Temporal Operators

2012-03-08 Thread mind
Hello everybody,

I recently started using Drools (with C#) and I have some problems in
understanding how temporal operators work with the duration field. According
to the documentation, the temporal operators work with startTimestamp and
endTimestamp of events, the semantics being defined with inequalities. In
order to work, temporal operator requires the duration field to be declared.
Now the questions:
1. What does @timeStamp stay for? The start or the end timestamp?
2. Does Drools calculate startTimestamp and endTimestamp if I set @timeStamp
and @duration attribute from my C# code? If not how can I set them? (like
shall I declare like @startTimeStamp(sth) and set from the C# code?)
3. Do temporal operators work if I do not set explicitly the start and end
timestamps but just @timeStamp and @duration attributes?


In particular, I have this drl file (%VAR% are replaced by other code):


declare IntensionalEvent
@role(event)
@timeStamp(timeStamp)
@duration(duration)
end

rule Expression (%EVENTNAME1%, %OPERATOR%, %EVENTNAME2%, %TIMESPAN%,
%TIMEVAR%)
dialect mvel
when
$eventA : IntensionalEvent( name == '%EVENTNAME2%' ) 
$eventB : IntensionalEvent( this %OPERATOR% $eventA,
name == '%EVENTNAME1%'
) over window:time( %TIMESPAN% )

then
  blah blah... create an IntensionalEvent and set timestamp
and duration

end

Thanks everybody,
Gil

--
View this message in context: 
http://drools.46999.n3.nabble.com/Duration-attritube-and-Temporal-Operators-tp3810201p3810201.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users