<br>   Chris,<br><br>   Fusion is an extension of Drools Expert. Think about it as all Expert features + some additional features. That is why Drools Fusion docs is just a list of features explained.<br><br>   I assume you looked here already:<br>
<br><a href="http://www.jboss.org/drools/documentation.html">http://www.jboss.org/drools/documentation.html</a><br><br>   For both, expert and fusion docs.<br><br>   So, back to your rule, syntax seems correct to me. Why do you say it is not working? What error or symptoms do you see?<br>
<br>   []s<br>   Edson<br><br><div class="gmail_quote">2009/5/26 Chris Richmond <span dir="ltr">&lt;<a href="mailto:crichmond@referentia.com">crichmond@referentia.com</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="EN-US">

<div>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Hello,</span></font></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">I am trying to write a rule for a moving average over values
over the last minute using fusion.  In general I can’t seem to
locate a detailed resource for authoring syntax for these types of rules or
rules in general, but specifically, I tried to modify something from the fusion
documentation for my purposes using the StockTicker fusion sample.  Here
is the rule entry I aded to the broker.drl:</span></font></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p style=""><b><font color="#960000" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">rule</span></font></b><font color="black" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><font color="green" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;Alert when
moving average goes below 50&quot;</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>

<p style=""><b><font color="#960000" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">when</span></font></b><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p style=""><font color="black" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">    Number( doubleValue &gt; 127 ) </span></font><b><font color="#960000" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">from</span></font></b><font color="black" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><b><font color="#960000" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">accumulate</span></font></b><font color="black" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">(</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p style=""><font color="black" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">        StockTick( symbol == </span></font><font color="green" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;ORCL&quot;</span></font><font color="black" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">, $price: price ) over window:time( 1m ),</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p style=""><font color="black" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">        average( $price ) )</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p style=""><b><font color="#960000" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">then</span></font></b><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p style=""><font color="black" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">    System.out.println(</span></font><font color="green" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: green;">&quot;moving average has gone beyone moving average&quot;</span></font><font color="black" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">);</span></font><font size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></font></p>


<p><b><font color="#960000" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;">End</span></font></b></p>

<p><b><font color="#960000" size="2" face="Courier New"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(150, 0, 0); font-weight: bold;"> </span></font></b></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">I basically want to be alerted any time the moving average
for ORCL moves above 127 (or whatever criteria I set…I picked that based
on the sample data the sample fusion project uses), but it doesn’t seem
to be working.  </span></font></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">I guess if I could locate the definitave samples or guide
for authoring these types of rules I could use that, but it’s very
difficult to piece together how to author rules utilizing fusion features based
on isolated snippets from the fusion guide.</span></font></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Can anyone point me to some reasources for learning rule
authoring, especially for taking advantage of the fusion features.</span></font></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Thanks,</span></font></p>

<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"><br><font color="#888888">
Chris</font></span></font></p>

</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><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>