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

Massi Gmail mmquelo at gmail.com
Sun Feb 17 08:46:11 EST 2008


I worked It out!


It was just a matter of "Decision table" definition....

I did not catch that the "UPPERCASE" attributes are meant to be "column" attributes and the "lowercase" attributes
are meant to be "table" attributes.

So I specified the RULEFLOW-GROUP attribute just once... in the row behind the "Import" attribute.

Now I get an "UNLOOP" and a "RULEFLOW-GROUP" column and everything works!

Thanks again!

Massi
  ----- Original Message ----- 
  From: mmquelo at gmail.com 
  Newsgroups: gmane.comp.java.drools.user
  To: rules-users at lists.jboss.org 
  Sent: Saturday, February 16, 2008 11:40 PM
  Subject: You must see this,guys...new bug? defining rules saturday night made me mad?



  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/41c2bc56/attachment.html 


More information about the rules-users mailing list