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

DroolsCompilerAntTask double-compile and compile exception with spreadsheets

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 5.2.0.Final
    • drools-ant
    • None

    Description

      I think I have found a couple of bugs in DroolsCompilerAntTask. I am using it to compile xls decision tables. My config for the compiler is:

      <compiler srcdir="${build.web.dir}/packages/venue" tofile="${build.web.dir}/packages/venue/venue.pkg"
      binformat="package" bintype="knowledge" classpathref="model.classpath">
      <include name="*.xls" />
      </compiler>

      I copied the source and added debug log entries. I found two problems:

      (1) in the method compileAndAddFiles(KnowledgeBuilder kbuilder), there is a call to getDroolsPackageFileList(). The call is supposed to return any package file names in the srcdir, but it is instead it is returning the xls spreadsheet file names. Then again within compileAndAddFiles, there is a call to getFileList(), which also returns the xls file names. As a result, each file gets added to the rule base twice.

      (2) in method compileAndAddFile(KnowledgeBuilder kbuilder, String fileName), the code to compile a spreadsheet (file extension XLSFILEEXTENSION) throws exception with message "Property storage size inconsistent with block chain." I changed the source to use a file resource instead of a reader resource:

      kbuilder.add(ResourceFactory.newFileResource(new File(this.srcdir, fileName)), ResourceType.DTABLE,
      dtableconfiguration);

      and then the compile works OK.

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            lhorton_jira Lisa Horton (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Archived:

              PagerDuty