]
Mario Fusco commented on DROOLS-1044:
-------------------------------------
The problem is a bit more complex because not only that the 2 KieBases have to declare the
same package names, but also the 2 drl files have exactly the same name. I'm still
investigating on this issue, but one possible workaround is to at least give 2 different
name to the 2 drl files.
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
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