<div><br></div>   Thanks for the feedback Michael, and you are right, it will replace the previous way of dealing with windows, but we will still support the old way for backward compatibility.<div><br></div><div>   The idea is to have this working in the engine for Beta1, so I will let you know as soon as the parser is done in the next couple days for you to implement in guvnor as your schedule allow it. <br>
<div><br></div><div>   Thanks,</div><div>    Edson<br><br><div class="gmail_quote">2011/7/26 Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Personally, I don&#39;t see a problem with option 1.<br><br>For consistency (with entry-points) the named windows and usage thereof should, IMO, be defined thus:-<br><i><b><br></b></i><div style="margin-left:40px;font-family:courier new,monospace">

<i><b></b></i>declare window X<br></div><div><div class="im"><div style="margin-left:40px;font-family:courier new,monospace"><div>    @type( tumbling )</div>
<div>    @keep( last 10 )</div>
<div>    StockTick( symbol == &quot;RHT&quot; ) from entry-point Y</div>
<div>end<br>
</div><br></div></div><div><div style="margin-left:40px;font-family:courier new,monospace">rule Z</div>
<div style="margin-left:40px;font-family:courier new,monospace">when</div>
<div style="margin-left:40px;font-family:courier new,monospace">    StockTick() from window x<br></div>
<div style="margin-left:40px;font-family:courier new,monospace">then</div>
<div style="margin-left:40px;font-family:courier new,monospace">    ...</div>
<div style="margin-left:40px;font-family:courier new,monospace">end<br>
</div><br>I assume the window declaration supersedes &quot;over window:length&quot; and &quot;over window:time&quot;, since the semantics seem to be defined in the declaration.<br><br>Please let me know when this is closer to reality as Guvnor will need to support this.<br>

<br>Cheers,<br><br>Mike<br></div><br></div><div class="gmail_quote"><div><div></div><div class="h5">On 26 July 2011 20:28, Edson Tirelli <span dir="ltr">&lt;<a href="mailto:ed.tirelli@gmail.com" target="_blank">ed.tirelli@gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><div></div><div class="h5">
<div><br></div>   All,<div><br></div><div>BACKGROUND:</div><div>   As Drools moves forward, we need to be able to declare several new structures, as well as make existing structures more robust for compile time analysis, error reporting and tooling support. For instance, as it is today, entry points are implicit declared by simply using them, i.e., if someone writes a pattern:</div>


<div><br></div><div>X() from entry-point Y</div><div><br></div><div>   The engine will create entry-point Y implicitly. This is easy to use, but this makes it impossible for the engine to detect typos and report during compilation time. So, the idea is that we will allow the user to declare all the entry points he wants to use in his application and we will have a configuration option to enforce or not that list of declared entry points. If the configuration is set to enforce and the engine finds a rule that is using an entry point that is not part of the list, the engine can raise a compile time error point out the user&#39;s mistake. E.g., using pseudo code:</div>


<div><br></div><div>declare entry-point X, Y</div><div>declare entry-point Z</div><div><br></div><div>   Drools also needs a way to declare named windows for re-use on multiple rules. For instance, using pseudo code:</div>


<div><br></div><div>declare window X</div><div>    @type( tumbling )</div><div>    @keep( last 10 )</div><div>    StockTick( symbol == &quot;RHT&quot; ) from entry-point Y</div><div>end</div><div><br></div><div>  And in the rule:</div>


<div><br></div><div>rule Z</div><div>when</div><div>    StockTick() from window:named X</div><div>then</div><div>    ...</div><div>end</div><div><br></div><div>QUESTION:</div><div>   As we can see above, we will need several new constructs in order to support features in our roadmap. We have the choice of making them all top level constructs, making the error recovery in the parser a lot more complicated, or we can re-use our declare construct to define these new structures as I presented in the pseudo-code above. Any pros/cons you can see in such approach?</div>


<div><br></div><div>OPTION 1 (more verbose, but simpler and more stable):</div><div>&lt;epDeclaration&gt; ::= declare entry-point &lt;epName&gt; [, &lt;epName]*</div><div>&lt;windowDeclaration&gt; ::= declare window &lt;windowName&gt; &lt;restOfTheWindowDeclaration&gt; end</div>


<div>&lt;typeDeclaration&gt; ::= declare [type] &lt;typeName&gt; &lt;restOfTheTypeDeclaration&gt; end</div><div>    </div><div>OPTION 2 (makes error recovery harder, but it is less verbose):</div><div><div>
&lt;epDeclaration&gt; ::= entry-point &lt;epName&gt; [, &lt;epName]*</div><div>&lt;windowDeclaration&gt; ::= window &lt;windowName&gt; &lt;restOfTheWindowDeclaration&gt; end</div><div>&lt;typeDeclaration&gt; ::= declare &lt;typeName&gt; &lt;restOfTheTypeDeclaration&gt; end</div>


</div><div><br></div><div>OPTION 3:</div><div><div>&lt;epDeclaration&gt; ::= someOtherKeyword entry-point &lt;epName&gt; [, &lt;epName]*</div><div>&lt;windowDeclaration&gt; ::= someOtherKeyword window &lt;windowName&gt; &lt;restOfTheWindowDeclaration&gt; end</div>


<div>&lt;typeDeclaration&gt; ::= declare [type] &lt;typeName&gt; &lt;restOfTheTypeDeclaration&gt; end</div><div><br></div><div><br></div><div>   Edson</div><div><br></div>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>


  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
</div>
<br></div></div>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br>
<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div></div>