Drools rule to filter element with a numeric property below a percentage of the total
Posted
by
Mario
on Stack Overflow
See other posts from Stack Overflow
or by Mario
Published on 2011-01-10T16:27:25Z
Indexed on
2011/01/10
23:53 UTC
Read the original article
Hit count: 187
Hello,
I have just started using Drools on a small project and now I need to write a rule a bit complex and I don't really know what's the best way to do it. I am applying this rule to a list of objects of the same type (this class have a property called numberOfExecutions). I need to check for each element of the list if the numberOfExecutions of that element is bigger than 5% of the total numberOfExecutions (the sum of numberOfExecutions of all the elements in the list).
I could not think of a nice way to implement this in drools so far, do you have a suggestion?
© Stack Overflow or respective owner