[rules-users] Can I create sub packages in Guvnor

Jervis Liu jliu at redhat.com
Thu Dec 16 02:28:39 EST 2010


On 2010/12/16 4:15, Gerret Hansper wrote:
>
> Hello,
>
> if you have a package com.foo in Guvnor it is possible to create a new
> package com.foo.bar.
> Guvnor will then place the bar package beneath the foo package in the
> KBaseTree.
> But other than that the sub package doesn't have any relation to its parent,
> which I find unfortunate, too.
> I was hoping to be able to "inherit" e.g. the parent's model or functions in
> the sub package.
> My scenario is that we have a couple of KnowledgeBases that share a common
> set of rules, each having further specific ones which I put into sub
> packages.
> Now, whenever there is a change in a library that my common rules depend on,
> I've got to update all of the packages' models which may amount to quite
> some click-work in Guvnor.
> Does anybody have a suggestion for an easier way to achieve this?
>
If the use case here is to reuse some common assets (for example, rules, 
decision tables, fact models, working sets etc) from packages, the 
Global area will be the thing you are looking for. You create your 
common assets in the Global area (think the global area as a special 
package, that's all). Then in your individual packages, you create an 
asset which is linked to the asset from global area (choose "import from 
Global area").

Please note, there was bug report against Global area in Drools 5.1: 
https://issues.jboss.org/browse/GUVNOR-1124. It has been fixed on trunk 
and will be available in Drools 5.2_M1.

Hope this helps,
Jervis





> Regards,
> 	Gerret




More information about the rules-users mailing list