ERGO.....
.....
Defining rules saturday night DOES make me mad!
:D
Next saturdays I will make sure to party, instead of defining Drules... ;-)
Massi
<mmquelo(a)gmail.com> ha scritto nel messaggio news:fp7oom$r59$1@ger.gmane.org...
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))
end
Any guesses for the output???
Well....
Test Result: true
HOW COMES???????????????????
I mean ... the test "eval(upronto != Pronto.Y)" returned "true"....
It means that the rule
engine sees upronto <> Pronto.Y!, doesn't it??!!!!
So... why do I get "upronto == Pronto.Y" in the RHS????
What the.........&$%%&()%%$/%£....sorry....but having these
kind of problems during saturday night is not so pleaseant!
T-T
I really hope you can help me with a workaround to this issue.
Bye
Massi
------------------------------------------------------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users