Re: [rules-users] Writing a pattern in which each event constraint depends on the previous event

2011-01-29 Thread radai.rosenblatt
how about numbering your ticks ? as a rough outline, this might look something like: 1st : Tick ($number : num) 2nd : Tick (num == $number+1, {this.value below 1st.value}) 3rd : Tick (num == $number+2, {this.value above 2nd.value}) this should find all "bottoms" -- View this message in context

Re: [rules-users] Sliding window of length (1) equals latest event?!

2011-01-29 Thread radai
I came across a very similar behavior, but as far as i can tell its far worse: https://issues.jboss.org/browse/JBRULES-2862 in my case events just stay in memory forever (until the jvm dies). this means any rule i've tried with 2 windows is a memory leak. On Sat, Jan 29, 2011 at 6:17 PM, OlliSee

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-29 Thread groovenarula
Edson, That worked beautifully ! Drools is looking more and more promising for what we need to do. Thanks for all your help, Gurvinder -Original Message- From: Edson Tirelli-4 [via Drools - Java Rules Engine] [mailto:ml-node+2380361-572428564-9...@n3.nabble.com] Sent: Sat 1/29/2011

Re: [rules-users] Writing a pattern in which each event constraint depends on the previous event

2011-01-29 Thread Wolfgang Laun
Is there a *defined *order in which objects resulting from an "over" clause are presented to the preceding from? Otherwise, an accumulate function requiring a specific order is based on implementation details. -W On 29 January 2011 18:24, Greg Barton wrote: > See the current discussion of accumu

Re: [rules-users] Writing a pattern in which each event constraint depends on the previous event

2011-01-29 Thread Greg Barton
See the current discussion of accumulate functions. That should satisfy your need. GreG On Jan 29, 2011, at 10:18, OlliSee wrote: > > Hello everyone. > > Lets say we have StockTicks... > Is it possible to detect a monotonically decreasing StockTick stream over a > window? > > If I knew

[rules-users] Writing a pattern in which each event constraint depends on the previous event

2011-01-29 Thread OlliSee
Hello everyone. Lets say we have StockTicks... Is it possible to detect a monotonically decreasing StockTick stream over a window? If I knew the number of events I want to check on, I'd do it this way $a : StockTick() over window:time(20s) $b : StockTick(this after $a, price < $a.price) ov

[rules-users] Sliding window of length (1) equals latest event?!

2011-01-29 Thread OlliSee
Hey again everyone, I seem to be having another problem. When I have a rule like that when A() over window:length(1) B() over window:length(1) then ... I imagine now having two windows of length 1. One always keeping the latest A event and one always keeping the

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-29 Thread Edson Tirelli
Up to Drools 5, the accumulate function API supports only a single argument to the function, but that argument can be an array or a list. So what I do on my own implementations is to pass the $param as one element of the array and $o as the other. It is not ideal, but it is how you can do that i

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-29 Thread groovenarula
Edson, I did manage to use the 'CollectSetAccumulateFunction' as a template for the MatchAll and have also successfully 'called' the accumulate function from a rule written in a .drl file. But I'm stuck at one point - how to send the value of $param to the accumulate method ? From what I understa