Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-4386

Wrong matched rules set were fired when one of the condition having empty cell in drools 6.5.0 using Jdk 1.8

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Explained
    • Affects Version/s: 6.5.0.Final
    • Fix Version/s: None
    • Component/s: decision tables
    • Labels:
      None
    • Sprint:
      2020 Week 01-03 (from Dec 30)
    • Steps to Reproduce:
      Hide

      Simple application with customer pojo class with type, years and discount attribute
      use decision table as above in description with one empty cell.

      Show
      Simple application with customer pojo class with type, years and discount attribute use decision table as above in description with one empty cell.
    • Affects:
      Migration
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      In JDK 1.7 we were using Drools 5.3.0.Final version and we are migrating to jdk 1.8 so drools 5.3.0.Final was not supported in which we were using Package Builder.
      We migrated JDK 1.8 with drools 6.5.0.Final which uses Kie API to implement rules

      Below is the decision table I am using:

      Customer Rule:

      Condition Condition Action
      ---------------------------------------------------
      Rule NO. Type Years Discount
      ---------------------------------------------------
      1 "Individual" 5 15
      2 "Individual" 3 10
      3 "Individual" 20

      if I insert customer object as "Type" = Individual and "Years" = 5
      after fireAllRules
      It fires two rules i.e Rule no. 1 and 3 and gives the 3rd Rule number as result instead of Rule number 1, inturn gives Discount as 20 instead of 15 which is wrong result.
      if I insert customer object as "Type" = Individual and "Years" = 3
      after fireAllRules
      It fires two rules i.e Rule no. 2 and 3 and gives the 3rd rule number as result instead of Rule number 2, inturn gives Discount as 20 instead of 10 which is wrong result.

      Exact rule match is not happening and providing wrong results.

      Could you please give the solution for this it is breaking so many rules in the application.

        Attachments

          Activity

            People

            Assignee:
            mfusco@redhat.com Mario Fusco
            Reporter:
            rahulrx135 Rahul Ramachar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: