<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=DE link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Hi, <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>thanks for the reply. You are right, it&#8217;s just not working the
otherway round, if there would be no &#8220;not&#8221;<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>$that : Thing(..)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>$other : Thing ( this != $that , &#8230;)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>would match always twice. For example, if there were two &#8220;Thing&#8221;&#8217;s
A and B it would match for the combination AB as well as BA&#8230; I know this was
actually not my question, but I guess it was the reason I got confused </span><span
lang=EN-US style='font-size:10.0pt;font-family:Wingdings;color:#1F497D'>J</span><span
lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Thanks again!<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>Von:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b>Im Auftrag von </b>W</span><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>olfgang Laun<br>
<b>Gesendet:</b> Mittwoch, 26. Mai 2010 10:01<br>
<b>An:</b> Rules Users List<br>
<b>Betreff:</b> Re: [rules-users] Detecting two instances of the same event
withFusion Rules<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>But <br>
<br>
&nbsp;&nbsp;&nbsp; $that : Thing(...)<br>
&nbsp;&nbsp;&nbsp; Thing( this != $that,...)<br>
<br>
is the standard way of ensuring that a pattern matches two distinct objects of
the same class, and there is no reason why you shouldn't be able to use it with
not as well:<br>
<br>
&nbsp;&nbsp; $that : Thing(...)<br>
&nbsp;&nbsp; not ( Thing( this != $that,... ) ) <br>
<br>
&quot;Given one Thing (with constraints...) and *not* having any *other* Thing
(with constraints...), then...&quot;<br>
<br>
-W<br>
<br>
<o:p></o:p></p>

<div>

<p class=MsoNormal>2010/5/26 Georg Maier &lt;<a href="mailto:Georg.Maier@cjt.de">Georg.Maier@cjt.de</a>&gt;<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>Hi,</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>I&#8217;m new to Drools and currently trying to implement some examples
using CEP / Fusion. I got stuck on a problem to which I can&#8217;t find any solution
in the online documentation, so I&#8217;m hoping for your help.</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>I&#8217;m trying to write a rule, which is activated whenever a certain
event occurs and no event of the same type occurred in the e.g. last 5 minutes
(or just at the same time). I know how to do it if these are events of
different types, but I can&#8217;t find any way for events of the same type. What I
tried is something like that:</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>$error
: RouterErrorEvent ( $name : routerName ) </span><b><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>from</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
entry-point </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
color:green'>&quot;abc&quot;</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>not
($otherError : RouterErrorEvent ( (</span><b><span lang=EN-US style='font-size:
10.0pt;font-family:"Courier New";color:#960000'>this</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'> coincides
$error) &amp;&amp; (routerName == $name) ) </span><b><span lang=EN-US
style='font-size:10.0pt;font-family:"Courier New";color:#960000'>from</span></b><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:black'>
entry-point </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New";
color:green'>&quot;abc&quot;)</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>First of all there&#8217;s the problem, that $error and $otherError will
be the same instance if a &#8220;RouterEventError&#8221; has been inserted from the &#8220;abc&#8221; entry
point. Adding a (this != $error) to the second, ($otherError) obviously is no
solution to that as well. </span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>If it were two different events something like in example 2.19 would
work:</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>$error1 :
ErrorOneEvent( $id : id ) </span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>not ($error2 :
ErrorTwoEvent( id == $id, this coincides $error1 ))</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>I&#8217;m kinda sure I&#8217;m missing something pretty &#8220;easy&#8221; here&#8230; or is this
approach completely wrong?</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>As I&#8217;m aware of the fact that I couldn&#8217;t be more of a newbie </span><span
lang=EN-US style='font-family:Wingdings'>J</span><span lang=EN-US> I would
appreciate any suggestions for nice tutorials or further reading as well!</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>Thanks in advance!</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US>&nbsp;</span><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US style='color:#888888'>Georg</span><span style='color:#888888'><o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><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><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>