[rules-users] Not looping the rule when more then 1 valid match is found

Maxim Veksler maxim.veksler at gmail.com
Mon Jan 26 07:22:19 EST 2009


Hello group,

Assuming I have the rule:

rule "try not to loop"
    when
        $a : A($code : code)
        $b : B(parentCode == $code)
    then
        addResult($a, $b);
end


and the classes:

public class A {
int code;
}

public class B {
int parentCode;
}



I insert into the WM 4 objects :
A(code = 1), A(code = 2);
B(parentCode=1), B(parentCode = 2);

I would like that after calling fireAllRules() only 1 match will be
returned. I have no preference regarding which one, in the current situation
2 matches are returned.

Anyone could suggest a method to enforce this ?


Thank you,
Maxim.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090126/ba866a3b/attachment.html 


More information about the rules-users mailing list