-
Feature Request
-
Resolution: Unresolved
-
Minor
-
5.0.1.FINAL
-
None
Currently, the following only scans all rule files under rules/ but not any subdirectories. It would be nice to have a parameter like includeSubDirectories=true in resource tag
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set.xsd' >
<add>
<resource source='file:C:/rules/' type='DRL' />
</add>
</change-set>
The following code in PackageBuilder can be changed to add at least one level of subdirectory and I'm sure with a little bit of refactoring and retest, one can add n-levels of subdirectories (though I would agree that we should limit the depth).
Line:530
if ( iNestedResourceResource.isDirectory() ) {
this.resourceDirectories.add( iNestedResourceResource );
for ( Resource childResource : iNestedResourceResource.listResources() ) {
if ( ((InternalResource) childResource).isDirectory() ) { // process one level subdirectory
this.resourceDirectories.add( childResource );
for ( Resource subChildResource : childResource.listResources() ) {
if ( ((InternalResource) subChildResource).isDirectory() )
((InternalResource) childResource).setResourceType( iNestedResourceResource.getResourceType() );
addKnowledgeResource( childResource,
iNestedResourceResource.getResourceType(),
iNestedResourceResource.getConfiguration() );
}
}
else
}
} else
}