Re: [rules-users] Another solution for: Detecting more than 3 occurrences within 1 hour

2010-08-06 Thread Wolfgang Laun
2010/8/5 Tina Vießmann > Thank you for this approach, Wolfgang. That sounds great. :) > I just have some further question about your solution. > > #1 > I'm thinking about an approach without the need modifying things outside > the drl file. Is something like that doable? > Because I have to cre

Re: [rules-users] Another solution for: Detecting more than 3 occurrences within 1 hour

2010-08-05 Thread Tina Vießmann
Thank you for this approach, Wolfgang. That sounds great. :) I just have some further question about your solution. #1 I'm thinking about an approach without the need modifying things outside the drl file. Is something like that doable? Because I have to create the watcher class? (I don't expec

Re: [rules-users] Another solution for: Detecting more than 3 occurrences within 1 hour

2010-08-05 Thread Wolfgang Laun
Basic idea: associate a Watcher with each event. class Watcher { Value what; int count = 1; Set valueSet = new HashSet(); Watcher( Value first ){ valueSet.add( what = first ); } //... } And now the rules: rule attachWatcher when $event : Value( eval(parameterValueExceed

[rules-users] Another solution for: Detecting more than 3 occurrences within 1 hour

2010-08-05 Thread Tina Vießmann
Hi, I'm working on thinking in Drools rules. Right now I'm trying to solve this: The rule shall fire if _a special event occurs more than 3 times within 1 hour_. My _first thought of a solution_ was to count the count the detected events using a counter. But the counter has to be a global v