<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16890" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>Hi
all,</FONT></SPAN></DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>It seems to me that
the no-loop only prevents a rule from triggering itself - and doesn't make the
rule only fire once (which is what I'm after)</FONT></SPAN></DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>e.g. consider the
following two contrived simple rules:</FONT></SPAN></DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>rule
"addPriorityPrefix"<BR> dialect "java"<BR> no-loop
true<BR> when<BR> $work : Work (priority >=
200)<BR> then<BR> modify($work)
{<BR> setTitle("!!! " +
getTitle());<BR> };<BR>end</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>rule "re-assign
low priority tasks"<BR> dialect "java"<BR> no-loop
true<BR> when<BR> $work : Work (priority <
-200)<BR> then<BR> modify($work)
{<BR> setOwner("nobody");<BR> };<BR>end</FONT></SPAN><SPAN
class=911285815-23092009><FONT face=Arial
size=2></FONT></SPAN></DIV></BLOCKQUOTE>
<DIV><SPAN class=911285815-23092009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>What I end up with
is an infinte loop. </FONT></SPAN></DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>Whilst for the
simple case I can re-write them like </FONT></SPAN></DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>
$work : Work (priority >= 200,
!title.startWith("!!!"))<BR></FONT></SPAN></DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>however with the
more complex rules this makes the rules get very complex quickly and less easy
to write. Is there a way to prevent these loops - have I misunderstood or do you
really need to check everything in the rule that you may
set?</FONT></SPAN></DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>How would you do the
banking interest example?</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>rule "interest
calculation"<BR> no-loop<BR> when<BR> $account :
Account( )<BR> then<BR> modify($account)
{<BR> setBalance((long)($account.getBalance() *
1.01) )<BR> };<BR>end</FONT></SPAN></DIV></BLOCKQUOTE>
<DIV><SPAN class=911285815-23092009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>if there was another
rule that if you where a gold customer and payed in > $500 the previous month
then you get $4 bonus?</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>rule "gold
bonus"<BR> no-loop<BR> when<BR> $account :
Account(type="gold", previousMonthDeposit > 500 )<BR>
then<BR> modify($account)
{<BR> setBalance((long)($account.getBalance() +
4) )<BR> };<BR>end</FONT></SPAN></DIV></BLOCKQUOTE>
<DIV><SPAN class=911285815-23092009></SPAN> </DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial
size=2>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=911285815-23092009><FONT face=Arial size=2>
/James</DIV></FONT></SPAN><br>**************************************************************************************<br>This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.<br><br>NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00<br>**************************************************************************************</BODY></HTML>