<div dir="ltr">Just curious here, why do you have this -&gt; <span style="font-family:arial,sans-serif;font-size:13px">signal : Signal( id == &quot;1234&quot; ) over window:length(1)?</span></div><div class="gmail_extra"><br>

<br><div class="gmail_quote">On Tue, Oct 22, 2013 at 9:40 PM, Davide Sottara <span dir="ltr">&lt;<a href="mailto:dsotty@gmail.com" target="_blank">dsotty@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Am I wrong or do you have two PriceChange events - 392 and 394 ?<br>
If so, you can expect two activations.. when you fire al rules, one of<br>
the two<br>
will insert the OrderCreated, which in turn will cancel the other<br>
<div class="HOEnZb"><div class="h5"><br>
On 10/22/2013 01:34 PM, calcacuervo wrote:<br>
&gt; Hi Guys. I have one quesiton on how could I implement my rule.<br>
&gt; I have this rule:<br>
&gt; when<br>
&gt;               t : PriceChange() over window:length(1)<br>
&gt;               signal : Signal( id == &quot;1234&quot; ) over window:length(1)<br>
&gt;               not OrderCreated( id == &quot;1234&quot; ) over window:time (1m)<br>
&gt;       then<br>
&gt;                 insert(new OrderCreated(&quot;1234));<br>
&gt;<br>
&gt; Basically, when there is some signal and some price change, create a new<br>
&gt; order if  there has no been any other order in the last minute.<br>
&gt; But this sometimes is being fired twice:<br>
&gt; 12:31:01,121 INFO  [org.drools.audit.WorkingMemoryConsoleLogger] (Camel<br>
&gt; (camel-1) thread #4 - JmsConsumer[marketDataTopic]) ACTIVATION CREATED<br>
&gt; rule:ertetr activationId:ertetr [393, 392, 0] declarations: t=PriceChange<br>
&gt; [](392); signal=Signal@1413ddef(393)<br>
&gt; 12:31:01,160 INFO  [org.drools.audit.WorkingMemoryConsoleLogger] (Camel<br>
&gt; (camel-1) thread #4 - JmsConsumer[marketDataTopic]) ACTIVATION CREATED<br>
&gt; rule:ertetr activationId:ertetr [393, 394, 0] declarations: t=PriceChange<br>
&gt; [](394); signal=Signal@1413ddef(393)<br>
&gt;<br>
&gt; I think that, when the 1m window have passed, it creates twice the<br>
&gt; activations, as I have not called fire all rules yet. Does is make sense? Do<br>
&gt; you have some idea on how could I implement this rule? &quot;when there has been<br>
&gt; some price change and some signal, and I did not create a new order in the<br>
&gt; last minute, just create a new order&quot;.<br>
&gt;<br>
&gt; Thanks in advance!<br>
&gt;<br>
&gt; Demian<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context: <a href="http://drools.46999.n3.nabble.com/Help-on-writing-a-rule-tp4026461.html" target="_blank">http://drools.46999.n3.nabble.com/Help-on-writing-a-rule-tp4026461.html</a><br>
&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
<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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>

 - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div></div>
</div>