I don&#39;t see that the &quot;not&quot; CE excludes the AnalysisCue bound to $cue from being<br>matched by the pattern inside the &quot;not&quot;. I recommend using<br><br><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">   not</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">(AnalysisCue(<b>this != $cue</b>, </span><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">this</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> after[0ms,2500ms] $cue) </span><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">from</span><br>
<br>since &quot;[0ms,...&quot; does not inhibit the same event being matched by both patterns,<br>which precludes the rule from firing.<br><br>-W<br><br><br><div class="gmail_quote">2012/1/16 Weiss, Wolfgang <span dir="ltr">&lt;<a href="mailto:Wolfgang.Weiss@joanneum.at">Wolfgang.Weiss@joanneum.at</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="DE-AT"><div><p class="MsoNormal"><span lang="EN-GB">Hi all!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-GB">We have the problem that the following rule never fires:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">rule</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> </span><span style="font-size:10.0pt;font-family:Inconsolata;color:green" lang="EN-GB">&quot;test-rule&quot;</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">       </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">agenda-group</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> </span><span style="font-size:10.0pt;font-family:Inconsolata;color:green" lang="EN-GB">&quot;evaluation&quot;</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">       </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">salience</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> 100</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">       </span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">       </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">when</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">             $cue : AnalysisCue() </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">from</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> entry-point </span><span style="font-size:10.0pt;font-family:Inconsolata;color:green" lang="EN-GB">&quot;LowLevelCueStream&quot;</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">             </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">not</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">(AnalysisCue(</span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">this</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> after[0ms,2500ms] $cue) </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">from</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> entry-point </span><span style="font-size:10.0pt;font-family:Inconsolata;color:green" lang="EN-GB">&quot;LowLevelCueStream&quot;</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">)</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">       </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">then</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">             logger.debug(</span><span style="font-size:10.0pt;font-family:Inconsolata;color:green" lang="EN-GB">&quot;... some message ..&quot;</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">);</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">end</span></b><span lang="EN-GB"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">We found out that the problem is the combination of the negation with the conditional element “not” and the temporal constraint “[0ms,2500ms]”. Using the temporal operator “this after $cue” without a temporal constraint works correct in its semantics.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Interestingly, when adding a constraint (cueType == 1) to the type in the negative pattern the rule begins to work. The rule would look like as follows:<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-GB"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">rule</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> </span><span style="font-size:10.0pt;font-family:Inconsolata;color:green" lang="EN-GB">&quot;test-rule&quot;</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">       </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">agenda-group</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> </span><span style="font-size:10.0pt;font-family:Inconsolata;color:green" lang="EN-GB">&quot;evaluation&quot;</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">       </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">salience</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> 100</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">       </span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">       </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">when</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">             $cue : AnalysisCue() </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">from</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> entry-point </span><span style="font-size:10.0pt;font-family:Inconsolata;color:green" lang="EN-GB">&quot;LowLevelCueStream&quot;</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">             </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">not</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">(AnalysisCue(cueType == 1, </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">this</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> after[0ms,2500ms] $cue) </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">from</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"> entry-point </span><span style="font-size:10.0pt;font-family:Inconsolata;color:green" lang="EN-GB">&quot;LowLevelCueStream&quot;</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">)</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">       </span><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">then</span></b><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">             logger.debug(</span><span style="font-size:10.0pt;font-family:Inconsolata;color:green" lang="EN-GB">&quot;... some message ..&quot;</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB">);</span><span style="font-size:10.0pt;font-family:Inconsolata" lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:Inconsolata;color:#960000" lang="EN-GB">end</span></b><span lang="EN-GB"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">unfortunately the rule then fires with a delay of 4 to 5 seconds. The second parameter of the temporal constraint influences the delay.<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-GB">When changing the first parameter of the temporal constraint to a value greater than 0 the rule works as expected! The constraint would then look like as follows: “[1ms, 2500ms]”. Whereas in our case, we want to evaluate the time window from 0 – 2500ms.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-GB">Our system works in the stream mode and we could reproduce this behaviour with the versions 5.3.1 and 5.4.0 Beta 1. <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Can anybody confirm if this is a bug in Drools, or did I overlook here something?<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p><p class="MsoNormal">
<span lang="EN-GB"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-GB">Best regards,<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></span></p><span class="HOEnZb"><font color="#888888"><p class="MsoNormal">
<span lang="EN-GB">Wolfgang Weiss<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p></font></span></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>