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

rules in spreadsheet does not behave same way with drl.

XMLWordPrintable

    • 2019 Week 17-19
    • 3
    • Hide

      1. create Drools sample project with JBDS as maven project and set the following version in pom.xml

        <properties>
          <runtime.version>7.18.0.Final-redhat-00002</runtime.version>
        </properties>
      

      Here is kmodule.xml.

      <?xml version="1.0" encoding="UTF-8"?>
      <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule">
          <kbase name="rules" packages="rules">
              <ksession name="ksession-rules"/>
          </kbase>
          <kbase name="dtables" packages="dtables">
              <ksession name="ksession-dtables"/>
          </kbase>
          <kbase name="process" packages="process">
              <ksession name="ksession-process"/>
          </kbase>
      </kmodule>
      

      2. run DroolsTest.java
      -> rules in src/resources/rules/Sample.drl do not get fired as expected

      3. run DecisionTableTest.java
      -> rules in src/resources/dtables/Sample.xls still get fired.

      4. modify kmodule.xml like the following.

          <kbase name="rules" packages="com.sample">
              <ksession name="ksession-rules"/>
          </kbase>
          <kbase name="dtables" packages="com.sample">
              <ksession name="ksession-dtables"/>
          </kbase>
      

      5. run DroolsTest.java
      -> rules in src/resources/rules/Sample.drl get fired as expected.

      6. run DecisionTableTest.java
      -> rules in src/resources/dtables/Sample.xls do NOT get fired.

      Show
      1. create Drools sample project with JBDS as maven project and set the following version in pom.xml <properties> <runtime.version>7.18.0.Final-redhat-00002</runtime.version> </properties> Here is kmodule.xml. <?xml version="1.0" encoding="UTF-8"?> <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"> <kbase name="rules" packages="rules"> <ksession name="ksession-rules"/> </kbase> <kbase name="dtables" packages="dtables"> <ksession name="ksession-dtables"/> </kbase> <kbase name="process" packages="process"> <ksession name="ksession-process"/> </kbase> </kmodule> 2. run DroolsTest.java -> rules in src/resources/rules/Sample.drl do not get fired as expected 3. run DecisionTableTest.java -> rules in src/resources/dtables/Sample.xls still get fired. 4. modify kmodule.xml like the following. <kbase name="rules" packages="com.sample"> <ksession name="ksession-rules"/> </kbase> <kbase name="dtables" packages="com.sample"> <ksession name="ksession-dtables"/> </kbase> 5. run DroolsTest.java -> rules in src/resources/rules/Sample.drl get fired as expected. 6. run DecisionTableTest.java -> rules in src/resources/dtables/Sample.xls do NOT get fired.
    • Workaround Exists
    • Hide

      Set system property "drools.groupDRLsInKieBasesByFolder" to true

      Show
      Set system property "drools.groupDRLsInKieBasesByFolder" to true
    • NEW
    • NEW

      In 7.18.0.Final (RHDM7.3.0), the change introduced by DROOLS-3523 as stated in the following knowledge.

      Rules don't fire after upgrading to RHDM 7.3.0
      https://access.redhat.com/solutions/4014541

      Therefore, DroolsTest.java in JBDS Drools sample project does not fire rules as expected.
      However, DecisionTableTest.java still works even tough 'packages' attribute in kmodule.xml still specify folder instead of package, which is inconsistent behavior with DRL sample.

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

                Created:
                Updated:
                Resolved: