&nbsp;<br>&nbsp;&nbsp;&nbsp; Matthias,<br><br>&nbsp;&nbsp;&nbsp; I agree with you and I say interval-based semantics is a go. I also agree on representing point-in-time events as events with 0 duration.<br><br><span><font color="#0000ff" face="Arial" size="2">
&gt; Another question that bothers me is whether you also intend 
to support <br>&gt; different &quot;consumption modes&quot; like &#39;recent&#39;, &#39;chronicle&#39; or 
&#39;unrestricted&#39; <br>&gt; (see paragraph 4.4. in the paper I sent to you; i.e. page 11 
+ 12 of the pdf). <br>&gt; For our use case, &#39;recent&#39; context is probably best suited - 
however at <br>&gt; least &#39;unrestricted&#39; should be supported too (e.g. in&nbsp;sliding 
windows, <br>&gt; no events can be discarded). What do you think?</font></span><br>&nbsp;&nbsp; My understanding is that the unrestricted mode is the default operation mode of the engine, and as such, we get it for free. My understanding is also that you can constrain the matching patterns to &quot;emulate&quot; recent and chronicle modes. So, my suggestions is we leave a more transparent support to &quot;recent&quot; and &quot;chronicle&quot; modes to a second phase, 
i.e., as soon as we have all the basics working in the engine. <br><br>&nbsp;&nbsp; Regarding the ability of the engine to work with non-javabean facts, it depends on a feature that is in our &quot;to do list&quot;: pluggable extractors. The idea is that you can configure the engine to use different strategies to obtain a value from a fact. Example:
<br><br>Cheese( type == &quot;stilton&quot; )<br><br>&nbsp;&nbsp; The above pattern makes the engine to use an extractor to read the value of &quot;type&quot; from the fact. As it is today, the engine uses a &quot;hardcoded&quot; extractor that knows how to read that attribute value from a javabean. What we need is to implement support in the engine to use a different extractor configured (and eventually provided) by the user. So, if Cheese is a JMS message, an XML element, an Ontology instance, or a CSV record in a file, does not matter for the engine, as long as the extractor can &quot;read&quot; that value and provide it to the engine.
<br>&nbsp;&nbsp;&nbsp; So, not supported yet, but we need that too for our next major release.<br><br>&nbsp; &nbsp; []s<br>&nbsp; &nbsp; Edson&nbsp;  <br><br><div><span class="gmail_quote">2007/11/13, Groch, Matthias &lt;<a href="mailto:matthias.groch@sap.com">
matthias.groch@sap.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><span class="q"></span><span class="q"><div dir="ltr" align="left">
<span>&nbsp;&nbsp;&nbsp; 
Looking at it, it seems quite feasible to implement the operators and 
time-windows necessaries to correlate events using this semantics. The only 
thing I still don&#39;t know is related to a very practical (in the sense that is 
opposed to theory) question: <br><br>* A method call in a programming language 
is an &quot;atomic&quot;, point-in-time, operation. So, inserting an event into the 
engine, is also a point-in-time operation. Interval-based semantics presumes 
that an event has a duration, and a duration is only available &quot;after&quot; an event 
has finished. So, since we need a synchronized clock to allow appropriate 
reasoning and time-window management in the engine, how do we implement support 
for that? Do you understand my question? We can&#39;t allow the engine clock to move 
backwards, and we will not be able to wait eternally for events that may never 
arrive, so how to we map one semantics into the other? 
<br><br>&nbsp;&nbsp;&nbsp;&nbsp; Will need to support point-in-time semantics 
for simple/atomic events, and interval-based semantics only for complex events? 
What are your ideas about this?</span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div></span>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">IMO, the easiest way to unify point- and interval-based 
representation&nbsp;would be&nbsp;to choose interval-based semantics, and 
then&nbsp;represent atomic events by means of an interval of duration 0, i.e. 
start and end&nbsp;time of the interval are equal. This way we would avoid 
having two different semantics, everything could be handled using intervals and 
the 13 relations defined by Allen.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">However,&nbsp;for representing primitive 
events&nbsp;point-based semantics and the three relations (&lt;, &gt;,&nbsp; 
=)&nbsp;are sufficient.&nbsp;Problems&nbsp;start when setting up relations 
between primitive and complex events. One solution would be to introduce another 
5 relations between points and intervals (like it is done in the QA approach). 
However, for reasons of simplicity, I&#39;d prefer to see the point as an interval 
of length 0 just for this relation, so we can use the relations definded on 
interval-based semantics.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">&nbsp;</font></span></div>
<div dir="ltr" align="left"><font face="Arial"><font color="#0000ff"><font size="2"><span>As&nbsp;pointed out&nbsp;by the QA guys, with 
interval-based semantics you can unambigiously definine qualitative 
relations.&nbsp;However, defining quantitative relations (i.e. 
durations)&nbsp;is not straight-forward.&nbsp;For instance,&nbsp;let&#39;s say yo 
wanna check whether one composite event e2&nbsp;occurs within 2 minutes after a 
first one e1&nbsp;occurred.&nbsp;There are several ways to it, to be precise 4 
(plus mixed solutions). You could compare either&nbsp;the start points of both 
composite events, or the end points, or the start point of e1 with the end point 
of e2, or the end point of&nbsp;e1 with the start point of&nbsp;e2 (or&nbsp;some 
mid point inside&nbsp;both of the intervals).&nbsp;All of the options might be 
meaningful (depending on the use case), so probably one should offer support for 
all of it.&nbsp;Nevertheless it probably makes sense to have a default 
implementation, which in our opinion is that you have a look at the end point of 
e1 and the start point of e2.</span></font></font></font></div>
<div dir="ltr" align="left"><font face="Arial"><font color="#0000ff"><font size="2"><span></span></font></font></font>&nbsp;</div>
<div dir="ltr" align="left"><font><font color="#0000ff"><font size="2"><span></span></font></font></font><span></span><font face="Arial"><font color="#0000ff"><font size="2">F<span>or&nbsp;time-window&nbsp;management,&nbsp;in our 
opinion&nbsp;the most suitable interpretation is to only include (composite) 
events which have terminated&nbsp;within the given boundaries.&nbsp;I 
agree&nbsp;that&nbsp;including events already at the&nbsp;time they start is 
error-prone since&nbsp;there&#39;s no guarantee that they&nbsp;eventually terminate 
(and when). Including events only if start and end point are within the 
boundaries of the window bears the risk of &quot;loosing&quot; events&nbsp;starting in one 
window but ending&nbsp;in another one.</span></font></font></font></div>
<div><font face="Arial"><font color="#0000ff"><font size="2"><span></span></font></font></font>&nbsp;</div>
<div><font face="Arial"><font color="#0000ff"><font size="2"><span>Although it&#39;s a nice assumption&nbsp;arriving events to 
be in the&nbsp;right&nbsp;(i.e. chronicle) order, there should be a support for 
delayed events.&nbsp;There should be a short delay (e.g. 1 min)&nbsp;in which 
late events are still accepted and inserted at the right point. That also means 
that rules which have fired already might have to be cancelled and 
reexecuted&nbsp;according to the new arrival order.&nbsp;In other words, 
reacting to incoming events should occur immediately, however, if late events 
arrive, some reevaluation&nbsp;must be done (but only in a certain interval; in 
this example, the&nbsp;system state older than&nbsp;1 minute 
is&nbsp;untouchable).&nbsp;In order not having to wait for events forever (which 
may be delayed), one should define an upper bound after which no more events are 
accepted or old old events can be discarded. ILOG JRules uses two qualifiers for 
that: ARRIVAL_DELAY and MATCHING_HORIZON (see <a href="http://www.ilog.com/products/jrules/documentation/jrules66/rsoptimize/rs_opt_refalgorithms2.html#1030121" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.ilog.com/products/jrules/documentation/jrules66/rsoptimize/rs_opt_refalgorithms2.html#1030121</a>). 
I think we could do it in a similar way.</span></font></font></font></div><font color="#0000ff" face="Arial" size="2"></font>
<div dir="ltr" align="left"><br><span><font color="#0000ff" face="Arial" size="2">Another question that bothers me is whether you also intend 
to support different &quot;consumption modes&quot; like &#39;recent&#39;, &#39;chronicle&#39; or 
&#39;unrestricted&#39;&nbsp;(see paragraph 4.4. in the paper I sent to you; i.e. page 11 
+ 12 of the pdf). For our use case, &#39;recent&#39; context is probably best suited - 
however at least &#39;unrestricted&#39; should be supported too (e.g. in&nbsp;sliding 
windows, no events can be discarded). What do you think?</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">One last question (which is&nbsp;completely unrelated to 
all above): In a listener within&nbsp;my sample application, I receive events as 
JMS messages (API: <a href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Message.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Message.html
</a>) 
containing a name, a parent id, a timestamp and&nbsp;several 
additional&nbsp;(unknown) parameters.&nbsp;As far as&nbsp;know,&nbsp;Drools only 
supports Java classes&nbsp;<font face="Times New Roman" size="3">relying on the 
JavaBean standard of getters and setters without any parameters. I got 2 
problems: First of all, the attributes and the corresponding values are saved in 
a map inside the JMS message. You access&nbsp;a certain field of&nbsp;a JMS 
message by specifying the field name as a parameter, e.g. <font size="2"><font face="Courier New">myMessage</font>.</font><table><tbody><tr><td align="right" valign="top" width="1%"><br></td><td><font color="#0000ff"><font face="Courier New" size="2">
getStringProperty</font><code>(java.lang.String&nbsp;name)<font face="Arial">, something which apparently is not allowed in Drools (or is there a 
workaround?) The second problem is, that there could be different events which, 
besides the standard attributes,&nbsp;have&nbsp;different attributes.&nbsp;In 
other words,&nbsp;at compile time I don&#39;t know which&nbsp;attributes an event 
instance&nbsp;will have, which means I cannot write a simple standard &#39;mapping 
function&#39;.&nbsp;So what I currently&nbsp;do is to &quot;unwrap&quot; the&nbsp;JMS message, 
extract all parameters and create a new myEvent object with well-defined getters 
and setters. This myEvent instance is then added to the working 
meory.&nbsp;When&nbsp;sending a reponse (which is another event)&nbsp;back to my 
publish-subscribe-system, I have to go the opposite way, i.e. wrapping all the 
information from&nbsp;a myEvent instance in a JMS message. What would be nice is 
to directly process JMS messages, without all the (un)wrapping. Is there a way 
to do that in Drools?</font></code></font></td></tr></tbody></table></font></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff"><font><font color="#0000ff"><code></code></font></font></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff"><font><font color="#0000ff" face="Arial"><code>Cheers,</code></font></font></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff"><font><font color="#0000ff" face="Arial"><code></code></font></font></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff"><font><font color="#0000ff" face="Arial"><code>Matthias</code></font></font></font></span></div>
<div dir="ltr" align="left"><span><font face="Arial">&nbsp;</font></span></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left: 5px; margin-right: 0px;">
  <div dir="ltr" align="left" lang="de">
  <hr>
  <font face="Tahoma" size="2"><b>From:</b> <a href="mailto:ed.tirelli@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">ed.tirelli@gmail.com</a> 
  [mailto:<a href="mailto:ed.tirelli@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">ed.tirelli@gmail.com</a>] <b>On Behalf Of </b>Edson 
  Tirelli<br><b>Sent:</b> Tuesday, November 13, 2007 1:21 AM<br><b>To:</b> 
  Groch, Matthias<br><b>Cc:</b> Walzer, Karen; Mark Proctor<br><b>Subject:</b> 
  Re: Interval-based vs. Time-based semantics<br></font><br></div><div><span class="e" id="q_11639a2651271c9e_4">
  <div></div><br>&nbsp;&nbsp;&nbsp; Matthias, <br><br>&nbsp; &nbsp; Interesting 
  paper! I didn&#39;t know it before. I now understand the additional declarative 
  power that the interval-based semantics add to the 
  reasoning!<br>&nbsp;&nbsp;&nbsp; Looking at it, it seems quite feasible to 
  implement the operators and time-windows necessaries to correlate events using 
  this semantics. The only thing I still don&#39;t know is related to a very 
  practical (in the sense that is opposed to theory) question: <br><br>* A 
  method call in a programming language is an &quot;atomic&quot;, point-in-time, 
  operation. So, inserting an event into the engine, is also a point-in-time 
  operation. Interval-based semantics presumes that an event has a duration, and 
  a duration is only available &quot;after&quot; an event has finished. So, since we need 
  a synchronized clock to allow appropriate reasoning and time-window management 
  in the engine, how do we implement support for that? Do you understand my 
  question? We can&#39;t allow the engine clock to move backwards, and we will not 
  be able to wait eternally for events that may never arrive, so how to we map 
  one semantics into the other? <br><br>&nbsp;&nbsp;&nbsp;&nbsp; Will need to 
  support point-in-time semantics for simple/atomic events, and interval-based 
  semantics only for complex events? What are your ideas about 
  this?<br><br>&nbsp;&nbsp;&nbsp;&nbsp; 
  Regards,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br><br>PS: 
  what do you think about moving our conversation to the dev list? is there any 
  problem for you, your thesis or your job if we get a wider audience? <br><br>
  <div><span class="gmail_quote">2007/11/12, Groch, Matthias &lt;<a href="mailto:matthias.groch@sap.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">matthias.groch@sap.com</a>&gt;:</span>
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&lt;&lt;Unified 
    Semantics for Event Correlation Over Time and Space in Hybrid<br>Network 
    Environments.pdf&gt;&gt; Edson,<br><br>I&#39;m still thinking about how to 
    represent time. In the attached paper,<br>there&#39;s a counter-example prooving 
    that point-based semantics aren&#39;t <br>appropriate in all cases. You can find 
    it in paragraph of 4.3, on page<br>11 of the PDF (= page 375 of the original 
    conference proceedings).<br>For this reason, I&#39;m in favor of using 
    interval-based semantics instead <br>of point-based semantics. Meanwhile, I 
    stumpled across another approach<br>combining the aforementioned. It&#39;s 
    called Qualitative Algebra (QA). Have<br>you ever heard of that? Meiri 
    introduced it<br>(<a href="http://citeseer.ist.psu.edu/715273.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> 
    http://citeseer.ist.psu.edu/715273.html</a>), and it was extended by 
    Barber<br>(<a href="http://citeseer.ist.psu.edu/barber00reasoning.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://citeseer.ist.psu.edu/barber00reasoning.html</a>). 
    It&#39;s quite<br>interesting since we then could use point-based semantics for 
    primitive <br>events and interval-based semantics for complex events, and 
    still are<br>able to define relations between them. However, I have the 
    feeling it&#39;s<br>not very well-examined yet; moreover it would introduce 
    additional <br>relations and therefore make things too complex 
    (interval-based<br>semantics already deal with 13 relations; but as pointed 
    out, we<br>probably cannot get around it)...<br>What do you 
    think?<br><br>Matthias<br><br></blockquote></div><br><br clear="all"><br>-- 
  <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules 
  Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: 
  +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.jboss.com</a> </span></div></blockquote>
</blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">
www.jboss.com</a>