]
Mario Fusco closed DROOLS-1044.
-------------------------------
Fix Version/s: 6.4.0.CR1
Resolution: Done
Fixed by
KieBase 'includes' does not handle the inclusion of KieBases
that use the same package-names correctly.
-------------------------------------------------------------------------------------------------------
Key: DROOLS-1044
URL:
https://issues.jboss.org/browse/DROOLS-1044
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 6.4.0.Beta1
Environment: Mac OS X 10.11.3, Oracle Hotspot 1.8.0_45
Reporter: Duncan Doyle
Assignee: Mario Fusco
Fix For: 6.4.0.CR1
KieBase 'includes' does not handle the inclusion of KieBases that use the same
package-names correctly.
I define 2 KJARs, each with a kmodule.xml that defines a KieBase. KJAR1 has a dependency
on KJAR2 in its pom.xml.
The KieBase defined in KJAR1 includes the KieBase defined in KJAR2.
If the KieBases get their Drools Resources (e.g. .drl) from different packages (e.g.
'rules' and 'rules2', everything works fine, e.g.:
KJAR1 kmodule.xml:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<kmodule
xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="kbase1" equalsBehavior="equality"
default="true" packages="rules" includes="kbase2">
<ksession name="ksession1" default="true"
type="stateful"/>
</kbase>
</kmodule>
{code}
KAJR2 kmodule.xml:
{code:xml}
<kmodule
xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="kbase2" equalsBehavior="equality"
default="false" packages="rules2">
<ksession name="ksession2" default="false"
type="stateful"/>
</kbase>
</kmodule>
{code}
However, when both KieBases use the same "packages" name (e.g.
'rules'), only one of the resources gets included in the final KieBase.
KJAR1 kmodule.xml:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<kmodule
xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="kbase1" equalsBehavior="equality"
default="true" packages="rules" includes="kbase2">
<ksession name="ksession1" default="true"
type="stateful"/>
</kbase>
</kmodule>
{code}
KAJR2 kmodule.xml:
{code:xml}
<kmodule
xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="kbase2" equalsBehavior="equality"
default="false" packages="rules">
<ksession name="ksession2" default="false"
type="stateful"/>
</kbase>
</kmodule>
{code}
Unit tests with reproducer can be found here:
https://github.com/DuncanDoyle/drools-kiebase-include-issue