Morning Edson!Thank You for your reply!I have already added the "Update()".I added it in the ACTION column following the columnwhere i set the "upronto" field.But then it produces an infinite Loop!It updates the upronto and the rule fires again....so the infinite loop starts!Should I avoid using decision tables?Should I use a sequential algorithm instead of rete??Should I clear the agenda?So far I have never seen any .xls decision tableusing the update()!Every time I use the update in a decision tableI get back a loop.Bye byeMassi----- Original Message -----From: Edson TirelliNewsgroups: gmane.comp.java.drools.userSent: Sunday, February 17, 2008 9:55 AMSubject: Re: Re: You must see this,guys...new bug? defining rules saturday night made me mad?
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:
when
cw: ContractWrapper(mycontract.serviceDetail.pronto == "Y", mycontract.serviceDetail.pronto == "Y")
then
cw.setUpronto(Pronto.Y);
update( cw ); // <---------
System.out.println("PS1"+cw.getMycontract().getId());
end
Without the update call, the LHS of the rules will never see the attribute change. This is expected behavior.
The RHS of the rules always see the actual attribute values though, since shadow proxies are only used in LHS.
[]s
Edson
2008/2/16, mmquelo@gmail.com <mmquelo@gmail.com>:I think I got the point....This is the rule (table generated) which sets the "upronto" field.(It should have been fired in a previous ruleflow-node)package com.rules.ConsolidateData;
#generated from Decision Table
import com.engine.wrappers.ContractWrapper;
import com.engine.enums.Pronto;
#From row number: 13
rule "Pronto_13"
(RULEFLOW GROUP IS MISSING!!!!!)
when
cw: ContractWrapper(mycontract.serviceDetail.pronto == "Y", mycontract.serviceDetail.pronto == "Y")
then
cw.setUpronto(Pronto.Y);
System.out.println("PS1"+cw.getMycontract().getId());
end
I think I DEFINED "THE RULEFLOW-GROUP" IN THE WRONG WAY in the .xls table!!!So, I think... the Pronto_13 rule has been fired after the ScorePronto rule.I tell you how I defined it....In the same column where I have "Ruleset", "Import" and "Variables" I put "RULEFLOW-GROUP" as well...it is as follows:|Ruleset | ... ||Import | ...import ... ContractWrapper...||Variables | ... ||RULEFLOW-GROUP | Scoring | <--- HERE!Is it correct?I thought this is what was meant in http://jira.jboss.com/jira/browse/JBRULES-1077In 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!I hope tomorrow to work it out.Thank You for your Help Edson!Buona notte.Massi"Edson Tirelli" <tirelli@post.com> ha scritto nel messaggio news:e6dd5ba30802161533m1d6e035cq9e12dd1b148fa71@mail.gmail.com...
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.
[]s
Edson
2008/2/16, mmquelo@gmail.com <mmquelo@gmail.com>:Look at this....I have got a "ContractWrapper" fact inserted into WM.It wraps a "Contract" object and some "enums" fields.One of these fields is "upronto":public
class ContractWrapper extends BaseOmPersistentWithAssignedId{Contract
mycontract=null;...
Pronto upronto = null;...
<getters and setters....>
...
}
"upronto" is an insance of a "Pronto" java enum:public
enum Pronto {N
,UNKNOWN
,Y
;}
"Pronto" can be : (Y, N, UNKNOWN)Here is the rule which reasons over this enum:(ofcourse I have got a Request into WM as well)rule "ScorePronto"
dialect "mvel"
ruleflow-group "Scoring"
when
$r:Request( $mc:mainContract != null )
$cw_p:ContractWrapper($c_w_p:mycontract == $mc, eval(upronto != Pronto.Y))then
System.out.println("Test Result: "+($cw_p.upronto == Pronto.Y))
endAny guesses for the output???Well....Test Result: trueHOW COMES???????????????????I mean ... the test "eval(upronto != Pronto.Y)" returned "true".... It means that the ruleengine sees upronto <> Pronto.Y!, doesn't it??!!!!So... why do I get "upronto == Pronto.Y" in the RHS????What the.........&$%%&()%%$/%£....sorry....but having thesekind of problems during saturday night is not so pleaseant!T-TI really hope you can help me with a workaround to this issue.ByeMassi
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users