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

Inclusion of kbases containing rule templates results in duplicate rule names and kbase build failure.

    Details

    • Sprint:
      2017 Week 38-39
    • Steps to Reproduce:
      Hide

      I have created a reproducer project https://github.com/alistairblack/DROOLS-1744 to demonstrate this issue. In this project there is a single rule module (ruleModuleOne) containing template based rules. This module is included in a master rule packaging module (rules) for repository deployment purposes. If you maven install the root project you will see a unit test failure as a result of the reported kbase inclusion issue.

      Show
      I have created a reproducer project https://github.com/alistairblack/DROOLS-1744 to demonstrate this issue. In this project there is a single rule module (ruleModuleOne) containing template based rules. This module is included in a master rule packaging module (rules) for repository deployment purposes. If you maven install the root project you will see a unit test failure as a result of the reported kbase inclusion issue.
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      I am working on a multi-module BRMS project, with each module encapsulating a set of rules forming a single knowledge base. There is an empty "packaging" module which inherits each of these modules in order to generate a single KJAR for deployment purposes. The application then utilises this KJAR via the KieScanner/ReleaseId approach to facilitate dynamic rule loading at runtime and decoupling of application/rules.
      Having taken the above approach I have encountered an issue when including knowledge bases that contain rule templates. Drools is unable to build these knowledge bases, reporting duplicate rule names; it appears to believe that the rules exist in both the inheriting and inherited knowledge bases. This behaviour is not seen when including knowledge bases containing standard rules or decision tables - just rule templates.

      An example of the error reported is:

      {{4528 [main] INFO org.drools.compiler.kie.builder.impl.KieRepositoryImpl - KieModule was added: ZipKieModule[releaseId=my.drools.templates:ruleModuleOne:1.0-SNAPSHOT,file=C:\Users\black\.m2\repository\my\drools\templates\ruleModuleOne\1.0-SNAPSHOT\ruleModuleOne-1.0-SNAPSHOT.jar]
      5145 [main] ERROR org.drools.compiler.kie.builder.impl.KieProject - Unable to build KieBaseModel:ruleModule_1_kbase
      [7,4]: Duplicate rule name: Rule One :: CCC_4
      [15,4]: Duplicate rule name: Rule One :: BBB_3
      [23,4]: Duplicate rule name: Rule One :: AAA_2
      [7,4]: Duplicate rule name: Rule Two :: EEE_3
      [16,4]: Duplicate rule name: Rule Two :: DDD_2

      5329 [main] ERROR org.drools.compiler.kie.builder.impl.KieProject - Unable to build KieBaseModel:inheritedTemplateModules-ruleModule_1_kbase
      [7,4]: Duplicate rule name: Rule One :: CCC_4
      [15,4]: Duplicate rule name: Rule One :: BBB_3
      [23,4]: Duplicate rule name: Rule One :: AAA_2
      [7,4]: Duplicate rule name: Rule Two :: EEE_3
      [16,4]: Duplicate rule name: Rule Two :: DDD_2
      }}

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mfusco Mario Fusco
                Reporter:
                alistairblack Alistair Black
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: