But <br><br>    $that : Thing(...)<br>    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&#39;t be able to use it with not as well:<br>
<br>   $that : Thing(...)<br>   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><br><div class="gmail_quote">
2010/5/26 Georg Maier <span dir="ltr">&lt;<a href="mailto:Georg.Maier@cjt.de">Georg.Maier@cjt.de</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="DE">

<div>

<p class="MsoNormal"><span lang="EN-US">Hi,</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">I’m new to Drools and currently
trying to implement some examples using CEP / Fusion. I got stuck on a problem
to which I can’t find any solution in the online documentation, so
I’m hoping for your help.</span></p>

<p class="MsoNormal"><span lang="EN-US">I’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’t find any way
for events of the same type. What I tried is something like that:</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal" style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-US">$error :
RouterErrorEvent ( $name : routerName ) </span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-US">from</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-US">
entry-point </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;" lang="EN-US">&quot;abc&quot;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US"></span></p>


<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-US">not ($otherError : RouterErrorEvent ( (</span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-US">this</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-US">
coincides $error) &amp;&amp; (routerName == $name) ) </span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0);" lang="EN-US">from</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;" lang="EN-US">
entry-point </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;" lang="EN-US">&quot;abc&quot;)</span><span lang="EN-US"></span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">First of all there’s the problem,
that $error and $otherError will be the same instance if a
“RouterEventError” has been inserted from the “abc”
entry point. Adding a (this != $error) to the second, ($otherError) obviously
is no solution to that as well. </span></p>

<p class="MsoNormal"><span lang="EN-US">If it were two different events something
like in example 2.19 would work:</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">$error1
: ErrorOneEvent( $id : id ) </span></p>

<p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;" lang="EN-US">not
($error2 : ErrorTwoEvent( id == $id, this coincides $error1 ))</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">I’m kinda sure I’m missing
something pretty “easy” here… or is this approach completely
wrong?</span></p>

<p class="MsoNormal"><span lang="EN-US">As I’m aware of the fact that I
couldn’t be more of a newbie </span><span style="font-family: Wingdings;" lang="EN-US">J</span><span lang="EN-US"> I would appreciate any suggestions for
nice tutorials or further reading as well!</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p>

<p class="MsoNormal"><span lang="EN-US">Thanks in advance!</span></p>

<p class="MsoNormal"><span lang="EN-US"> </span></p><font color="#888888">

<p class="MsoNormal"><span lang="EN-US">Georg</span></p>

</font></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>