<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Ok, I think I understood well. I modified my business code, now I call if<br><br>(wm != null)<br> wm.update(wm.getFactHandle(this), this);<br><br>each time a properties is modified.<br><br>But it is worse. Rules that sould be activated only once actually loop, even if I add the no-loop clause.<br><br>I understand why they loop, assuming update = (rectact + insert), but I dont get a solution to my problem. I just want to notify an object changement in order to read again the properties, but I dont want to restart the ruleflow.<br><br>Sorry, but I find hard to say it in english because even in french, it's not very clear ;)<br><blockquote><hr>Subject: RE: [rules-users] Synch Business Object / Working Memory<br>Date: Fri, 11 Apr 2008 10:39:41 +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_208223809-11042008"><font color="#0000ff" face="Arial">In essence, yes. Have a look at "update" in the manual (and a read
on Shadow Facts will probably be useful too).</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 10:24<br><b>To:</b> Rules Users
List<br><b>Subject:</b> RE: [rules-users] Synch Business Object / Working
Memory<br></font><br></div>
<div></div>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>
<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_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_EC_287464408-11042008"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="EC_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_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="_blank">Téléchargez Messenger,
c'est gratuit !</a> </blockquote>
</blockquote><br /><hr />Tous vos amis discutent sur Messenger, et vous ? <a href='http://www.windowslive.fr/messenger/' target='_new'>Téléchargez Messenger, c'est gratuit !</a></body>
</html>