[rules-users] You must see this, guys...new bug? defining rules saturday night made me mad?

mmquelo at gmail.com mmquelo at gmail.com
Sat Feb 16 17:40:17 EST 2008


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080216/22874f5f/attachment.html 


More information about the rules-users mailing list