DroolsCompilerAntTask double-compile and compile exception with spreadsheets
----------------------------------------------------------------------------
Key: JBRULES-3189
URL:
https://issues.jboss.org/browse/JBRULES-3189
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-ant
Affects Versions: 5.2.0.Final
Environment: Windows Vista, Netbeans
Reporter: Lisa Horton
Assignee: Mark Proctor
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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira