[rules-users] Re: You must see this,	guys...new bug? defining rules saturday night made me mad?
    mmquelo at gmail.com 
    mmquelo at gmail.com
       
    Sun Feb 17 08:49:21 EST 2008
    
    
  
ERGO.....
.....
Defining rules saturday night DOES make me mad!
:D
Next saturdays I will make sure to party, instead of defining Drules... ;-)
Massi
  <mmquelo at gmail.com> ha scritto nel messaggio news:fp7oom$r59$1 at 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 at lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080217/b4952350/attachment.html 
    
    
More information about the rules-users
mailing list