<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY 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="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=tirelli@post.com href="mailto:tirelli@post.com">Edson Tirelli</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Newsgroups:</B>
gmane.comp.java.drools.user</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=mmquelo@gmail.com
href="mailto:mmquelo@gmail.com">mmquelo@gmail.com</A> ; <A
title=rules-users@lists.jboss.org
href="mailto:rules-users@lists.jboss.org">Rules Users List</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, February 17, 2008 9:55
AM</DIV>
<DIV style="FONT: 10pt arial"><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">mmquelo@gmail.com</A> <<A
href="mailto:mmquelo@gmail.com">mmquelo@gmail.com</A>>:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<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>
<P align=left><EM>package com.rules.ConsolidateData;</EM></P>
<P align=left><EM>#generated from Decision Table</EM></P>
<P align=left><EM>import com.engine.wrappers.ContractWrapper;</EM></P>
<P align=left><EM>import com.engine.enums.Pronto;</EM></P>
<P align=left><EM>#From row number: 13</EM></P>
<P align=left><EM>rule "Pronto_13"</EM></P>
<P align=left><EM><STRONG><FONT color=#ff0000>(RULEFLOW GROUP IS
MISSING!!!!!)</FONT></STRONG></EM></P>
<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>System.out.println("PS1"+cw.getMycontract().getId());</EM></P></BLOCKQUOTE>
<P><EM>end</EM></P></FONT></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
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://jira.jboss.com/jira/browse/JBRULES-1077"
target=_blank>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="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Edson Tirelli" <<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:tirelli@post.com" target=_blank>tirelli@post.com</A>> ha
scritto nel messaggio <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="news:e6dd5ba30802161533m1d6e035cq9e12dd1b148fa71@mail.gmail.com"
target=_blank>news:e6dd5ba30802161533m1d6e035cq9e12dd1b148fa71@mail.gmail.com</A>...</DIV>
<DIV><SPAN class=e id=q_11824d36f62e0a91_1><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
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:mmquelo@gmail.com" target=_blank>mmquelo@gmail.com</A> <<A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:mmquelo@gmail.com"
target=_blank>mmquelo@gmail.com</A>>:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<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>
<P align=left></P>
<P align=left></P>
<P align=left></P>
<P align=left></P>
<P>...</P>
<P>}</P></FONT></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
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org"
target=_blank>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
onclick="return top.js.OpenExtLink(window,event,this)"
href="http://www.jboss.com" target=_blank>www.jboss.com</A> </SPAN></DIV>
<P></P>
<HR>
<SPAN class=q>
<P></P>_______________________________________________<BR>rules-users
mailing list<BR><A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org"
target=_blank>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></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>
<P>
<HR>
<P></P>_______________________________________________<BR>rules-users mailing
list<BR>rules-users@lists.jboss.org<BR>https://lists.jboss.org/mailman/listinfo/rules-users<BR></BLOCKQUOTE></BODY></HTML>