[rules-users] How to iterate over a given rule multiple times

RulesUsers agrawalmanisha26 at gmail.com
Tue Jul 31 08:41:34 EDT 2012


Hi All,

I have a specific requirement where in, i have my rules file as follows


rule "one"
when
     //some condition
then
     //fire a particular query & retrieve the count of records for a filter
condition
    //Then populate it to some fact property using modify()
end

rule "two"
when
     //check if the count of records is, say 100 after, the above modify
statement
then
     //any further action 
end


Now the problem is, I want to execute rule "one" again and again until rule
"two" is satisfied.

Two probable solutions I can think of is: -
   1. Put some condition in rule "one", so that rule"one" is true until rule
"two" condition is satisfied. But that has a problem, rule"one" will still
fire even if rule "two" gets satisfied.
   2. Other is,  have some kind of third rule that will call rule "one",
when rule"two" is not satisfied.


Please provide your valuable inputs.
Thanks in advance.

Regards,
Sam



--
View this message in context: http://drools.46999.n3.nabble.com/How-to-iterate-over-a-given-rule-multiple-times-tp4018974.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list