Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-2415

Provide recursive file scan for files under change-set.xml

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Minor Minor
    • 6.0.0.Alpha1
    • 5.0.1.FINAL
    • drools-core
    • 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() )

      { 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() ); }

      }

            mproctor@redhat.com Mark Proctor
            infinity2heaven_jira Priya M (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

              Created:
              Updated:
              Archived: