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

rule filtering by folder-type packages attribute does not work after upgrading to 7.11.0.Final

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • 7.11.0.Final, 7.14.0.Final, 7.18.0.Final
    • core engine
    • 2019 Week 23-25
    • Hide

      1. build attached reproducer project by 'mvn clean install'.
      => this works without error.

      2. edit pom.xml and change runtime.version
      You can see the following version is set.

          <runtime.version>7.5.0.Final-redhat-6</runtime.version--> <!--  RHDM 7.0.1 -->
      

      set more later version than this, say 7.11.0.Final-redhat-00003.

      3. build again by 'mvn clean install'.

      => this fails with the following error

      [ERROR] Unable to build KieBaseModel:defaultKieBase
      [5,0]: Duplicate rule name: rule1
      Rule Compilation error : [Rule name='rule1']
      	com/sample/Rule_rule1713162208.java (3:123) : The type Rule_rule1713162208 is already defined
      
      Show
      1. build attached reproducer project by 'mvn clean install'. => this works without error. 2. edit pom.xml and change runtime.version You can see the following version is set. <runtime.version>7.5.0.Final-redhat-6</runtime.version--> <!-- RHDM 7.0.1 --> set more later version than this, say 7.11.0.Final-redhat-00003. 3. build again by 'mvn clean install'. => this fails with the following error [ERROR] Unable to build KieBaseModel:defaultKieBase [5,0]: Duplicate rule name: rule1 Rule Compilation error : [Rule name='rule1'] com/sample/Rule_rule1713162208.java (3:123) : The type Rule_rule1713162208 is already defined
    • NEW
    • NEW

    Description

      In kjar project, there are many rules per folder under resources directory and
      filtered these rules by using packages attribute in kmodule.xml.

      e.g.

      • file structure
        src/main/resources/
        ├── logback-test.xml
        ├── META-INF
        │   ├── kmodule.xml
        │   └── maven
        │       └── pom.properties
        └── rules
            ├── aws
            │   └── Sample1.drl
            ├── test1
            │   └── Sample1.drl
            └── test2
                └── Sample2.drl
        
      • kmodule.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
          <kbase name="rules" packages="rules.aws">
              <ksession name="ksession-rules"/>
          </kbase>
      </kmodule>
      

      This could be built with library version 7.5.0.Final.
      But after upgrading 7.11.0.Final or later, it fails.

      Attachments

        Issue Links

          Activity

            People

              mfusco@redhat.com Mario Fusco
              rhn-support-hmiura Hiroko Miura
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: