<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>We have used a “BreadCrumb”
fact to avoid this in the past.  We had a situation where there wasn’t a
direct loop (rule A triggering rule A) but rather a trifecta of facts (Rule A
triggers Rule B which trigger Rule C which triggered Rule A).<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>To solve for this we created a simple “RuleBreadCrumb”
fact that takes a “rule name” as a parameter.  We check for the non-existence
of this fact in our WHEN clause (on rules at risk of a loop) and insert the
RuleBreadCrumb fact in the THEN statements.  <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Mauricio Salatino<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, January 29, 2010
1:21 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Rules Users List<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [rules-users] prevent
infinite loops</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>lock-on-active it's ok
for that kind of situations<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Fri, Jan 29, 2010 at 3:00 PM, Garner, Shawn <<a
href="mailto:Garner.Shawn@principal.com">Garner.Shawn@principal.com</a>>
wrote:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Is there a good way to globally prevent infinite loops.<br>
I had rule A and rule B and they both have FactA on the condition.<br>
They also both modify FactA.<br>
I tried no-loop and it prevents a loop of repeating RuleA over and over.<br>
However it then goes from Rule A back to Rule B back to Rule A.<br>
I fixed it by lock-on-active instead of no-loop.<br>
<br>
However I was wondering if there was either a timeout feature or a maximum
number of times you could set a rule to be executed to error out on infinite
loops.<br>
<br>
Any guidance would be appreciated.<br>
<br>
Thanks,<br>
SDG<br>
<br>
<br>
-----Message Disclaimer-----<br>
<br>
This e-mail message is intended only for the use of the individual or<br>
entity to which it is addressed, and may contain information that is<br>
privileged, confidential and exempt from disclosure under applicable law.<br>
If you are not the intended recipient, any dissemination, distribution or<br>
copying of this communication is strictly prohibited. If you have<br>
received this communication in error, please notify us immediately by<br>
reply email to <a href="mailto:Connect@principal.com">Connect@principal.com</a>
and delete or destroy all copies of<br>
the original message and attachments thereto. Email sent to or from the<br>
Principal Financial Group or any of its member companies may be retained<br>
as required by law or regulation.<br>
<br>
Nothing in this message is intended to constitute an Electronic signature<br>
for purposes of the Uniform Electronic Transactions Act (UETA) or the<br>
Electronic Signatures in Global and National Commerce Act ("E-Sign")<br>
unless a specific statement to the contrary is included in this message.<br>
<br>
While this communication may be used to promote or market a transaction<br>
or an idea that is discussed in the publication, it is intended to provide<br>
general information about the subject matter covered and is provided with<br>
the understanding that The Principal is not rendering legal, accounting,<br>
or tax advice. It is not a marketed opinion and may not be used to avoid<br>
penalties under the Internal Revenue Code. You should consult with<br>
appropriate counsel or other advisors on all matters pertaining to legal,<br>
tax, or accounting obligations and requirements.<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br clear=all>
<br>
-- <br>
- <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br>
- <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br>
- Salatino "Salaboy" Mauricio -<o:p></o:p></span></font></p>
</div>
</body>
</html>