<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE>.hmmessage P {
        PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
BODY.hmmessage {
        FONT-SIZE: 10pt; FONT-FAMILY: Tahoma
}
</STYLE>
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY class=hmmessage>
<DIV dir=ltr align=left><SPAN class=287464408-11042008><FONT face=Arial
color=#0000ff>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=287464408-11042008><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=287464408-11042008><FONT face=Arial
color=#0000ff>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=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<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=_new>Téléchargez Messenger,
c'est gratuit !</A> </BLOCKQUOTE></BODY></HTML>