Drools 6.x Expert – “no RuleTable cells in spreadsheet” Error when working with Templates and Template Data in .xls files
This has been reported a few times as a bug to JBoss and they have always come back and said that it cannot be replicated.
There is a very good reason why this cannot be replicated. It is not a bug in Drools – although better error reporting might help
Imagine your kmodule.xml looking like this
<?xml version="1.0" encoding="UTF-8"?> <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"> <kbase name="rr_kbase" default="false" packages="example.rules"> <ruleTemplate dtable="example/rules/Emails.xls" template="example/rules/ContactDetails.drt" row="3" col="2"/> <ksession name="rr_session"/> </kbase> </kmodule>
kmodule.xml
This basically says that your DRT file is in example/rules
and your data file – Emails.xls is also in example/rules
However, if in your IDE you were to call your resources folder “example.rules” and not “example/rules”
Then, Drools will find your DRLs ok, will find your Decision Tables ok, will find your DRT file ok
BUT IT WILL NOT FIND your template data (Emails.) xls file
And just to rub it in
Intellij and STS will both display example/rules and example.rules as…
wait for it…
example.rules
In fact you can even get two lines one under the other in your src/main/resources folder that say:
example.rules (when the IDE means example.rules)
example.rules (when the IDE means example/rules)
Go figure…
In summary
if you get “no RuleTable cells in spreadsheet” error when working with Templates and template data in xls files
Check your actual system directory structure underneath src/main/resources to check that you haven’t got a folder called aaa.bbb instead of aaa/bbb when your template data is somewhere down that directory tree…