<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 17/01/2012 08:27, Weiss, Wolfgang wrote:
<blockquote
cite="mid:6547E177D45A2C47A5E29F0F733EC3C5014DD95C8A86@RZJC1EX.jr1.local"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered
medium)">
<style><!--
/* Font Definitions */
@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;}
@font-face
        {font-family:Inconsolata;
        panose-1:2 11 6 9 3 0 3 0 0 0;}
/* 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.hoenzb
        {mso-style-name:hoenzb;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></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]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-GB">Thank you for the quick answer! This makes
absolutely sense and the rules work now as expected.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-GB">Unfortunately, I was not able to find this
somewhere in the documentation. It would be nice to see it
in the documentation of drools fusion. <o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-GB"><o:p> </o:p></span></p>
</div>
</blockquote>
Documentation is something anyone can do with a spare 10 minutes:<br>
1) install git<br>
2) install xmlmind<br>
3) "fork" drools on github, <a class="moz-txt-link-freetext" href="https://github.com/droolsjbpm/drools">https://github.com/droolsjbpm/drools</a><br>
4) clone your fork locally<br>
5) make changes to files with xmlmind, or xml editor of choice<br>
<a class="moz-txt-link-freetext" href="https://github.com/droolsjbpm/drools/tree/master/drools-docs/drools-fusion-docs/src/main/docbook/en-US">https://github.com/droolsjbpm/drools/tree/master/drools-docs/drools-fusion-docs/src/main/docbook/en-US</a><br>
6) commit changes, push changes back to github<br>
7) use github gui to submit a pull request for your changes.<br>
<br>
It'll be more obvious to users what documentation is missing, and
they'll be able to word it better in a way that makes more sense to
other users.<br>
<br>
Mark<br>
<blockquote
cite="mid:6547E177D45A2C47A5E29F0F733EC3C5014DD95C8A86@RZJC1EX.jr1.local"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-GB">Best,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-GB">Wolfgang<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"
lang="EN-GB"><o:p> </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
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""
lang="EN-GB">Von:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""
lang="EN-GB"> <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] <b>Im
Auftrag von </b>Wolfgang La</span><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif""
lang="DE">un<br>
<b>Gesendet:</b> Montag, 16. Jänner 2012 15:58<br>
<b>An:</b> Rules Users List<br>
<b>Betreff:</b> Re: [rules-users] Problem with Negative
Patterns and Temporal Constraints<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">I don't see
that the "not" CE excludes the AnalysisCue bound to $cue from
being<br>
matched by the pattern inside the "not". 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
style="color:#960000">this</span> after[0ms,2500ms] $cue)
<span style="color:#960000">from</span></span><br>
<br>
since "[0ms,..." does not inhibit the same event being matched
by both patterns,<br>
which precludes the rule from firing.<br>
<br>
-W<br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">2012/1/16 Weiss, Wolfgang <<a
moz-do-not-send="true"
href="mailto:Wolfgang.Weiss@joanneum.at">Wolfgang.Weiss@joanneum.at</a>><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB">Hi all!</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB">We have the problem that the following
rule never fires:</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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 style="color:green">"test-rule"</span></span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> <b><span style="color:#960000">agenda-group</span></b>
<span style="color:green">"evaluation"</span></span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> <b><span style="color:#960000">salience</span></b>
100</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> <b><span style="color:#960000">when</span></b></span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> $cue : AnalysisCue() <b><span
style="color:#960000">from</span></b> entry-point
<span style="color:green">"LowLevelCueStream"</span></span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> <b><span
style="color:#960000">not</span></b>(AnalysisCue(<b><span
style="color:#960000">this</span></b>
after[0ms,2500ms] $cue) <b><span
style="color:#960000">from</span></b> entry-point
<span style="color:green">"LowLevelCueStream"</span>)</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> <b><span style="color:#960000">then</span></b></span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> logger.debug(<span
style="color:green">"... some message .."</span>);</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span
style="font-size:10.0pt;font-family:Inconsolata;color:#960000"
lang="EN-GB">end</span></b><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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.</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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:</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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 style="color:green">"test-rule"</span></span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> <b><span style="color:#960000">agenda-group</span></b>
<span style="color:green">"evaluation"</span></span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> <b><span style="color:#960000">salience</span></b>
100</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> <b><span style="color:#960000">when</span></b></span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> $cue : AnalysisCue() <b><span
style="color:#960000">from</span></b> entry-point
<span style="color:green">"LowLevelCueStream"</span></span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> <b><span
style="color:#960000">not</span></b>(AnalysisCue(cueType
== 1, <b><span style="color:#960000">this</span></b>
after[0ms,2500ms] $cue) <b><span
style="color:#960000">from</span></b> entry-point
<span style="color:green">"LowLevelCueStream"</span>)</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> <b><span style="color:#960000">then</span></b></span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none"><span
style="font-size:10.0pt;font-family:Inconsolata"
lang="EN-GB"> logger.debug(<span
style="color:green">"... some message .."</span>);</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span
style="font-size:10.0pt;font-family:Inconsolata;color:#960000"
lang="EN-GB">end</span></b><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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.</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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.</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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. </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB">Can anybody confirm if this is a bug in
Drools, or did I overlook here something?</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
lang="EN-GB">Best regards,</span><o:p></o:p></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="color:#888888" lang="EN-GB">Wolfgang Weiss</span><span
style="color:#888888"><o:p></o:p></span></p>
<p class="MsoNormal"
style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span
style="color:#888888" lang="EN-GB"> </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 moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
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> </o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>