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))  
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@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