]
Geoffrey De Smet updated JBRULES-2415:
--------------------------------------
Fix Version/s: 5.3.0.Final
(was: 5.3.0.CR1)
Provide recursive file scan for files under change-set.xml
----------------------------------------------------------
Key: JBRULES-2415
URL:
https://issues.jboss.org/browse/JBRULES-2415
Project: Drools
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: drools-core
Affects Versions: 5.0.1.FINAL
Environment: windows
Reporter: Priya M
Assignee: Mark Proctor
Priority: Minor
Fix For: 5.3.0.Final
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() ) {
continue; // ignore second level sub directories
}
((InternalResource) childResource).setResourceType(
iNestedResourceResource.getResourceType() );
addKnowledgeResource( childResource,
iNestedResourceResource.getResourceType(),
iNestedResourceResource.getConfiguration() );
}
}
else {
((InternalResource) childResource).setResourceType(
iNestedResourceResource.getResourceType() );
addKnowledgeResource( childResource,
iNestedResourceResource.getResourceType(),
iNestedResourceResource.getConfiguration() );
}
}
} else {
addKnowledgeResource( iNestedResourceResource,
iNestedResourceResource.getResourceType(),
iNestedResourceResource.getConfiguration() );
}
}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: