[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
Sat Feb 16 19:22:35 EST 2008


I think I got the point....

This is the rule (table generated) which sets the "upronto" field.

(It should have been fired in a previous ruleflow-node)

  package com.rules.ConsolidateData;

  #generated from Decision Table

  import com.engine.wrappers.ContractWrapper;

  import com.engine.enums.Pronto;

  #From row number: 13

  rule "Pronto_13"

  (RULEFLOW GROUP IS MISSING!!!!!)


  when

    cw: ContractWrapper(mycontract.serviceDetail.pronto == "Y", mycontract.serviceDetail.pronto == "Y")

  then

    cw.setUpronto(Pronto.Y);

    System.out.println("PS1"+cw.getMycontract().getId());

  end

I think I DEFINED "THE RULEFLOW-GROUP" IN THE WRONG WAY  in the .xls table!!!

So, I think... the Pronto_13 rule has been fired after the ScorePronto rule.

I tell you how I defined it....

In the same column where I have "Ruleset", "Import" and "Variables" I put "RULEFLOW-GROUP" as well...it is as follows:

|Ruleset                       | ...                                          |
|Import                         | ...import ... ContractWrapper...|
|Variables                     | ...                                         |
|RULEFLOW-GROUP   | Scoring                                  |           <--- HERE!


Is it correct?

I thought this is what was meant in http://jira.jboss.com/jira/browse/JBRULES-1077

In case this were not the problem I really would not know what to do.... now I go to sleep... here in rome is quite late!

I hope tomorrow to work it out.

Thank You for your Help Edson!

Buona notte.

Massi
  "Edson Tirelli" <tirelli at post.com> ha scritto nel messaggio news:e6dd5ba30802161533m1d6e035cq9e12dd1b148fa71 at mail.gmail.com...

     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 at gmail.com <mmquelo at 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 at 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 


------------------------------------------------------------------------------


  _______________________________________________
  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/33128cd7/attachment.html 


More information about the rules-users mailing list