<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
yes, i made a mistake. its a.setE(...) and not c.setE(...).<br><br>I don't call update. If I dont call update, properties of an object are just read one time for all rules?<br><br><br><blockquote><hr>Subject: RE: [rules-users] Synch Business Object / Working Memory<br>Date: Fri, 11 Apr 2008 09:47:43 +0100<br>From: manstis1@ford.com<br>To: rules-users@lists.jboss.org<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .EC_hmmessage P
{padding-right:0px;padding-left:0px;padding-bottom:0px;padding-top:0px;}
.ExternalClass BODY.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</style>
<div dir="ltr" align="left"><span class="EC_287464408-11042008"><font color="#0000ff" face="Arial">I guess the example is a simplification as "c" (in RHS) has not
been bound to a fact.</font></span></div>
<div dir="ltr" align="left"><span class="EC_287464408-11042008"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="EC_287464408-11042008"><font color="#0000ff" face="Arial">Anyway, that aside, do you call "update" to ensure WM knows of
changes to facts otherwise properties need to be "time-constant" which in your
example they are not.</font></span></div><br>
<blockquote style="margin-right: 0px;">
<div class="EC_OutlookMessageHeader" dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma"><b>From:</b> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b>On Behalf Of </b>Jonathan
Guéhenneux<br><b>Sent:</b> 11 April 2008 09:34<br><b>To:</b> Rules Users
List<br><b>Subject:</b> [rules-users] Synch Business Object / Working
Memory<br></font><br></div>
<div></div>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="_blank">Téléchargez Messenger,
c'est gratuit !</a> </blockquote>
</blockquote><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>