<br> The loop problem is not related to the rule format. I.e., if you have a loop in the decision table, you will have it on drl rules too, etc.<br> There are mechanisms to avoid undesired loops, like no-loop and lock-on-active rule attributes, but usually it is just a matter of refining your rule declarations.<br>
<br> Regarding the update() call, once you understand how it works, you may decide not to use it in some cases, but the original description for your problem clearly states what happens when update is not used properly.<br>
<br> []s<br> Edson<br><br><div><span class="gmail_quote">2008/2/17, Massi Gmail <<a href="mailto:mmquelo@gmail.com">mmquelo@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Morning Edson!</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Thank You for your reply!</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I have already added the "Update()".</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I added it in the ACTION column following the
column</font></div>
<div><font face="Arial" size="2">where i set the "upronto" field.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">But then it produces an infinite Loop!</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">It updates the upronto and the rule fires
again....</font></div>
<div><font face="Arial" size="2">so the infinite loop starts!</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Should I avoid using decision tables?</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Should I use a sequential algorithm instead of
rete??</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Should I clear the agenda?</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">So far I have never seen any .xls decision table
</font></div>
<div><font face="Arial" size="2">using the update()! </font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Every time I use the update in a decision
table</font></div>
<div><font face="Arial" size="2">I get back a loop.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Bye bye</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Massi</font></div>
<div><font face="Arial" size="2"></font> </div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"><div><span class="e" id="q_11826c24f8504ac8_1">
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
<div style="background: rgb(228, 228, 228) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b>
<a title="tirelli@post.com" href="mailto:tirelli@post.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Edson Tirelli</a>
</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Newsgroups:</b>
gmane.comp.java.drools.user</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a title="mmquelo@gmail.com" href="mailto:mmquelo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mmquelo@gmail.com</a> ; <a title="rules-users@lists.jboss.org" href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Rules Users List</a> </div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Sunday, February 17, 2008 9:55
AM</div>
<div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> Re: Re: You must see
this,guys...new bug? defining rules saturday night made me mad?</div>
<div><br></div><br> I don't know about your ruleflow
question, but you seems to be missing an update() call that will cause exactly
the behavior you are describing:<br><br><font size="2">
<p align="left"><em></em></p>
<p align="left"><em>when</em></p>
<blockquote dir="ltr" style="margin-right: 0px;">
<p align="left"><em>cw: ContractWrapper(mycontract.serviceDetail.pronto ==
"Y", mycontract.serviceDetail.pronto == "Y")</em></p></blockquote>
<p align="left"><em>then</em></p>
<blockquote dir="ltr" style="margin-right: 0px;">
<p align="left"><em>cw.setUpronto(Pronto.Y);</em></p>
<p align="left"><em><span style="font-style: italic;">update( cw ); //
<---------</span><br></em></p>
<p align="left"><em>System.out.println("PS1"+cw.getMycontract().getId());</em></p></blockquote>
<p><em>end</em></p></font><br> Without the update call, the
LHS of the rules will never see the attribute change. This is expected
behavior.<br> The RHS of the rules always see the actual
attribute values though, since shadow proxies are only used in
LHS.<br><br> []s<br> Edson<br><br>
<div><span class="gmail_quote">2008/2/16, <a href="mailto:mmquelo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mmquelo@gmail.com</a> <<a href="mailto:mmquelo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mmquelo@gmail.com</a>>:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I think I got the point....</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">This is the rule (table generated) which sets
the "upronto" field.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"><strong>(It should have been fired in
a previous ruleflow-node)</strong></font></div>
<div><font face="Arial" size="2"></font> </div>
<blockquote dir="ltr" style="margin-right: 0px;">
<div><font size="2">
</font><p align="left"><font size="2"><em>package com.rules.ConsolidateData;</em></font></p>
<font size="2"> </font><p align="left"><font size="2"><em>#generated from Decision Table</em></font></p>
<font size="2"> </font><p align="left"><font size="2"><em>import com.engine.wrappers.ContractWrapper;</em></font></p>
<font size="2"> </font><p align="left"><font size="2"><em>import com.engine.enums.Pronto;</em></font></p>
<font size="2"> </font><p align="left"><font size="2"><em>#From row number: 13</em></font></p>
<font size="2"> </font><p align="left"><font size="2"><em>rule "Pronto_13"</em></font></p>
<font size="2"> </font><p align="left"><font size="2"><em><strong><font color="#ff0000">(RULEFLOW GROUP IS
MISSING!!!!!)</font></strong></em></font></p>
<font size="2"> </font><p align="left"><font size="2"><em></em></font></p>
<font size="2"> </font><p align="left"><font size="2"><em>when</em></font></p>
<font size="2"> </font><blockquote dir="ltr" style="margin-right: 0px;">
<font size="2"> </font><p align="left"><font size="2"><em>cw: ContractWrapper(mycontract.serviceDetail.pronto ==
"Y", mycontract.serviceDetail.pronto == "Y")</em></font></p></blockquote>
<font size="2"> </font><p align="left"><font size="2"><em>then</em></font></p>
<font size="2"> </font><blockquote dir="ltr" style="margin-right: 0px;"><font size="2">
</font><p align="left"><font size="2"><em>cw.setUpronto(Pronto.Y);</em></font></p>
<font size="2"> </font><p align="left"><font size="2"><em>System.out.println("PS1"+cw.getMycontract().getId());</em></font></p></blockquote>
<font size="2"> </font><p><font size="2"><em>end</em></font></p></div></blockquote>
<div><font face="Arial" size="2">I think I DEFINED "THE RULEFLOW-GROUP" IN THE
WRONG WAY in the .xls table!!!</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"><strong>So, I think... the </strong><em><font face="Times New Roman">Pronto_13 </font></em><strong>rule has been fired
after the <em>ScorePronto </em>rule.</strong></font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I tell you how I defined it....</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">In the same column where I have "Ruleset",
"Import" and "Variables" I put "RULEFLOW-GROUP" as well...it is as
follows:</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">|Ruleset
|
...
|</font></div>
<div><font face="Arial" size="2">|Import
| ...import ...
ContractWrapper...|</font></div>
<div><font face="Arial" size="2">|Variables
| ...
|</font></div>
<div><font face="Arial" size="2">|RULEFLOW-GROUP | Scoring
| <---
HERE!</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Is it correct?</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I thought this is what was meant in <a href="http://jira.jboss.com/jira/browse/JBRULES-1077" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://jira.jboss.com/jira/browse/JBRULES-1077</a></font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">In case this were not the problem I really
would not know what to do.... now I go to sleep... here in rome is quite
late!</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I hope tomorrow to work it out.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Thank You for your Help Edson!</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Buona notte.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Massi</font></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Edson Tirelli" <<a href="mailto:tirelli@post.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">tirelli@post.com</a>> ha
scritto nel messaggio <a href="news:e6dd5ba30802161533m1d6e035cq9e12dd1b148fa71@mail.gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">news:e6dd5ba30802161533m1d6e035cq9e12dd1b148fa71@mail.gmail.com</a>...</div>
<div><span><br> Need to see
the full test case to be able to understand if it is a bug or not, because
the expression in the LHS is using the ShadowProxy, while the one in the
RHS is not... so, it may be a bug or it may not... depends when and how
you are setting the upronto field.<br><br> []s<br>
Edson<br><br><br>
<div><span class="gmail_quote">2008/2/16, <a href="mailto:mmquelo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mmquelo@gmail.com</a> <<a href="mailto:mmquelo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mmquelo@gmail.com</a>>:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Look at this....</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I have got a "ContractWrapper" fact
inserted into WM.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">It wraps a "Contract" object and some
"enums" fields.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">One of these fields is
"upronto":</font></div>
<div><font face="Arial" size="2"></font> </div>
<blockquote dir="ltr" style="margin-right: 0px;">
<div><font face="Arial" size="2"><b><font color="#7f0055" size="2">
<p align="left">public</p></font></b></font><font size="2"></font><b><font color="#7f0055" size="2">class</font></b><font size="2"> ContractWrapper
</font><b><font color="#7f0055" size="2">extends</font></b><font size="2">
BaseOmPersistentWithAssignedId{
<p align="left">Contract </p></font><font color="#0000c0" size="2">mycontract</font><font size="2">=</font><b><font color="#7f0055" size="2">null</font></b><font size="2">; </font>
<p align="left"></p><font size="2"></font>
<p align="left"><font size="2">...</font></p><font size="2"></font>
<p align="left"></p><font size="2">Pronto </font><font color="#0000c0" size="2">upronto</font><font size="2"> = </font><b><font color="#7f0055" size="2">null</font></b><font size="2">;
<p align="left"><strong><font color="#7f0055">...</font></strong></p></font><font size="2">
<p align="left"></p>
<p align="left"><em><getters and setters....></em></p></font><font size="2"></font><font size="2">
</font><p align="left"></p>
<font size="2"> </font><p align="left"></p>
<font size="2"> </font><p align="left"></p>
<font size="2"> </font><p align="left"></p><font size="2">
</font><p><font size="2">...</font></p>
<font size="2"> </font><p><font size="2">}</font></p></div></blockquote>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">"upronto" is an insance of a "Pronto" java
enum:</font></div>
<div><font face="Arial" size="2"></font> </div>
<blockquote dir="ltr" style="margin-right: 0px;">
<div><b><font color="#7f0055" size="2">
<p align="left">public</p></font></b><font size="2"></font><b><font color="#7f0055" size="2">enum</font></b><font size="2"> Pronto
{</font><i><font color="#0000c0" size="2">
<p align="left">N</p></font></i><font size="2">,</font><i><font color="#0000c0" size="2">
<p align="left">UNKNOWN</p></font></i><font size="2">,</font><i><font color="#0000c0" size="2">
<p align="left">Y</p></font></i><font size="2">;
<p align="left">}</p></font></div></blockquote>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">"Pronto" can be : (Y, N,
UNKNOWN)</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Here is the rule which reasons over this
enum:</font></div>
<div><font face="Arial" size="2">(ofcourse I have got a Request into WM as
well)</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"><em>rule "ScorePronto"<br>dialect
"mvel"<br>ruleflow-group
"Scoring"<br> when<br> $r:Request(
$mc:mainContract != null )<br>
$cw_p:ContractWrapper($c_w_p:mycontract == $mc, eval(upronto !=
Pronto.Y))</em></font></div>
<div><font face="Arial" size="2"><em> then <br>
System.out.println("Test Result: "+($cw_p.upronto ==
Pronto.Y)) <br>end</em></font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Any guesses for the output???</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Well....</font></div>
<div><font face="Arial" size="2"></font><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"><strong>Test Result:
true</strong></font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">HOW COMES???????????????????</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I mean ... the test "eval(upronto !=
Pronto.Y)" returned "true".... It means that the rule</font></div>
<div><font face="Arial" size="2">engine sees upronto <> Pronto.Y!,
doesn't it??!!!!</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"><strong>So... why do I get "upronto ==
Pronto.Y" in the RHS????</strong></font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">What
the.........&$%%&()%%$/%�....sorry....but having
these</font></div>
<div><font face="Arial" size="2">kind of problems during saturday night is
not so pleaseant! </font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">T-T</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I really hope you can help me with a
workaround to this issue.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Bye</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Massi</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div></div><br>_______________________________________________<br>rules-users
mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools
Core Development<br> Office: +55 11
3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a
division of Red Hat @ <a href="http://www.jboss.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.jboss.com</a> </span></div>
<p></p>
<hr>
<span>
<p></p>_______________________________________________<br>rules-users
mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</span>
<p></p></blockquote></div><br>_______________________________________________<br>rules-users
mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools
Core Development<br> Office: +55 11
3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a
division of Red Hat @ <a href="http://www.jboss.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.jboss.com</a>
</span></div><p>
</p><hr><span class="q">
<p></p>_______________________________________________<br>rules-users mailing
list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</span><p></p></blockquote></div>
<br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>