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.
--
View this message in context:
http://drools.46999.n3.nabble.com/DroolsCompilerAntTask-bugs-tp3279120p32...
Sent from the Drools: User forum mailing list archive at
Nabble.com.