<div dir="ltr">Yes! I receive many price change events.. but, as I am using window length = 1, I would expect to have the activation cancelled for the previous one?<div><br></div><div style>I am not sure how to express this:<br>
"when there is some price change, and some signal, and there has not been any order over the last minute, then place an order"</div><div style><br></div><div style>The price change and signal are like "existence" facts.. "If there is some price change change.." "if there is some signal ..."</div>
<div style><br></div><div style>Would this be another way to achieve what I am trying to do?</div><div style><br></div><div style>Thanks,</div><div style><br></div><div style>Demian</div><div style><br></div><div style>PS: This is a simple rule, but then, the idea is to have more complex rules.. like, if there has been 10 signals in the last time, place an order, etc. </div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Oct 22, 2013 at 5:40 PM, Davide Sottara <span dir="ltr"><<a href="mailto:dsotty@gmail.com" target="_blank">dsotty@gmail.com</a>></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>
> Hi Guys. I have one quesiton on how could I implement my rule.<br>
> I have this rule:<br>
> when<br>
> t : PriceChange() over window:length(1)<br>
> signal : Signal( id == "1234" ) over window:length(1)<br>
> not OrderCreated( id == "1234" ) over window:time (1m)<br>
> then<br>
> insert(new OrderCreated("1234));<br>
><br>
> Basically, when there is some signal and some price change, create a new<br>
> order if there has no been any other order in the last minute.<br>
> But this sometimes is being fired twice:<br>
> 12:31:01,121 INFO [org.drools.audit.WorkingMemoryConsoleLogger] (Camel<br>
> (camel-1) thread #4 - JmsConsumer[marketDataTopic]) ACTIVATION CREATED<br>
> rule:ertetr activationId:ertetr [393, 392, 0] declarations: t=PriceChange<br>
> [](392); signal=Signal@1413ddef(393)<br>
> 12:31:01,160 INFO [org.drools.audit.WorkingMemoryConsoleLogger] (Camel<br>
> (camel-1) thread #4 - JmsConsumer[marketDataTopic]) ACTIVATION CREATED<br>
> rule:ertetr activationId:ertetr [393, 394, 0] declarations: t=PriceChange<br>
> [](394); signal=Signal@1413ddef(393)<br>
><br>
> I think that, when the 1m window have passed, it creates twice the<br>
> activations, as I have not called fire all rules yet. Does is make sense? Do<br>
> you have some idea on how could I implement this rule? "when there has been<br>
> some price change and some signal, and I did not create a new order in the<br>
> last minute, just create a new order".<br>
><br>
> Thanks in advance!<br>
><br>
> Demian<br>
><br>
><br>
><br>
> --<br>
> 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>
> Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
<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></div>