<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi,<br><br>I have two rules :<br><br>rule "rule 1 - 1"<br> <br> salience 90<br> ruleflow-group "rfg1"<br> when<br> a : A(<br> eComputed == "false",<br> c < 15,<br> d >= 75) <br> then<br> c.setE(0);<br>end<br><br><br><br>rule "rule 1 - 2"<br><br> salience 10<br> ruleflow-group "rfg1"<br>
when<br>
a : A(<br>
eComputed == "false",<br>
c >= 15,<br>
d >= 75) <br>
then<br>
c.setE(1);<br>end<br><br><br><br>and part of the corresponding business code :<br><br>public class A {<br><br> ...<br><br> public String getEComputed(){<br> if(eComputed)<br> return "true";<br> else<br> return "false";<br> }<br><br> ...<br><br> public void setE(int e){<br> this.e = e;<br> eComputed = true;<br> }<br><br> ...<br><br>}<br><br><br><br>so, I expected that if the first rule is activated, the second won't be. But according to my tests, the two rule can be fired on the same object A.<br>While debugging, I noticed the getEComputed method was only called once. I suppose that I should write this :<br><br><br>
rule "rule 1 - 1"<br>
<br>
salience 90<br>
ruleflow-group "rfg1"<br>
when<br>
a : A(<br>
eComputed == "false",<br>
c < 15,<br>
d >= 75) <br>
then<br>
c.setE(0);<br> c.setEComputed("true);<br>
end<br><br>
<br>
<br>
rule "rule 1 - 2"<br>
<br>
salience 10<br>
ruleflow-group "rfg1"<br>
when<br>
a : A(<br>
eComputed == "false",<br>
c >= 15,<br>
d >= 75) <br>
then<br>
c.setE(1);<br> c.setEComputed("true);<br>
end<br><br>But I would prefer another solution. Thanks for help.<br><br /><hr />Plus de 15 millions de français utilisent Windows Live Messenger ! <a href='http://www.windowslive.fr/messenger/' target='_new'>Téléchargez Messenger, c'est gratuit !</a></body>
</html>