<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi all,<div><br></div><div>I am looking at using the Matrix style decision tables. </div><div>There is not a lot of documentation on these, but I have also found the spring config for them is lacking.</div><div><br></div><div>There is a test case here - <a href="https://github.com/droolsjbpm/drools/blob/master/drools-decisiontables/src/test/java/org/drools/decisiontable/SpreadsheetCompilerUnitTest.java">https://github.com/droolsjbpm/drools/blob/master/drools-decisiontables/src/test/java/org/drools/decisiontable/SpreadsheetCompilerUnitTest.java</a></div><div><br></div><div><span style="font-family: Arial; ">that shows really that it complies to a DRL.</span></div><div><span style="font-family: Arial; "><br></span></div><div><font face="Arial">The method call for building the compiler </font><a href="https://github.com/droolsjbpm/drools/blob/master/drools-decisiontables/src/main/java/org/drools/decisiontable/SpreadsheetCompiler.java">SpreadsheetCompiler.compile</a><span style="font-family: Arial; ">() takes an extra argument .. a spreadsheet listener.</span></div><div><font face="Arial"><br></font></div><div><div style="margin: 0px; "><font face="Monaco" color="#0056d6"> final SpreadsheetCompiler converter = new SpreadsheetCompiler();</font></div><div style="margin: 0px; "><div><font face="Monaco" color="#0056d6"><br></font></div><div><font face="Monaco" color="#0056d6"> final String drl = converter.compile( stream,</font></div><div><font face="Monaco" color="#0056d6"> InputType.XLS,</font></div><div><font face="Monaco" color="#0056d6"> new RuleMatrixSheetListener() );</font></div><div><br></div></div></div><div><font face="Arial">But the Spring configuration doesn't seem to support that type.. (i.e. looking at the code in the UnitTest, a "RuleMatrixSheetListener" is passed to the compile.</font></div><div><font face="Arial"><br></font></div><div><font face="Arial">but the spring config won't support tat extra listener.</font></div><div><font face="Arial"><br></font></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(78, 145, 146); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #009193"><</span>drools-spring:kbase<span style="color: #000000"> </span><span style="color: #932192">id</span><span style="color: #000000">=</span><span style="color: #3933ff">"kbase"</span><span style="color: #009193">></span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(78, 145, 146); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="color: #009193"><</span>drools-spring:resources<span style="color: #009193">></span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(57, 51, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: #009193"><</span><span style="color: #4e9192">drools-spring:resource</span><span style="color: #000000"> </span><span style="color: #932192">type</span><span style="color: #000000">=</span>"DTABLE"<span style="color: #000000"> </span><span style="color: #932192">source</span><span style="color: #000000">=</span>"classpath:myco/matrix_ruletable.xls"<span style="color: #000000"> </span><span style="color: #009193">></span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(79, 118, 203); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span> </span><drools-spring:decisiontable-<span style="text-decoration: underline">conf</span> input-type="XLS"/></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(57, 51, 255); "><span style="color: rgb(0, 0, 0); "><span class="Apple-tab-span" style="white-space:pre">                        </span></span><span style="color: rgb(0, 145, 147); "></</span><span style="color: rgb(78, 145, 146); ">drools-spring:resource</span><span style="color: rgb(0, 145, 147); ">></span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(78, 145, 146); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="color: #009193"></</span>drools-spring:resources<span style="color: #009193">></span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; color: rgb(78, 145, 146); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #009193"></</span>drools-spring:kbase<span style="color: #009193">></span></div></div><div style="margin: 0px; font-size: 11px; font-family: Monaco; "><br></div><div><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div>I am considering making a patch to support a Matrix style spreadsheet.</div><div>Which way would you suggest I head </div><div><br></div><div>(a) add a new "<span style="color: rgb(79, 118, 203); font-family: Monaco; font-size: 11px; ">decisionmatrixtable-</span><span style="color: rgb(79, 118, 203); font-family: Monaco; font-size: 11px; text-decoration: underline; ">conf</span> to the schema a a new parser - because they are different</div><div> (modify <span style="font-family: Arial; ">droolsjbpm-integration//drools-spring/src/main/java/org/drools/container/spring/namespace/ResourceDefinitionParser.java)</span></div><div><span style="font-family: Arial; "> (create a new </span>DecisionTableConfiguration for Matrix sheets)</div><div><span style="font-family: Arial; "> </span></div><!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<div>(b) add a new input type to the DecisionTable .. (XLS_MATRIX)</div><div><br></div><div>(c) add the ability to inject a "SheetLisner" as an optional parameter to "decisiontable-conf"</div><div><br></div><div>(d) other.</div><div><br></div><div><br></div><div>Something else I noted is that, when you do have a "SheetListener" passed to .compile( … ) you also cannot have a worksheetName</div><div>ie: </div><div><br></div><div> compile(stream, inputType, listener)</div><div> compile(stream, inputType) </div><div> compile(stream, string)</div><div><br></div><div>Does that need a little uplift as well ? The assumption that (stream, string) is always an XLS doesn't seem right.</div><div><br></div><div>regards</div><div>Ramon</div><div><div><br></div></div><div><br></div><div>Ramon Buckland</div><div><a href="mailto:ramon@thebuckland.com">ramon@thebuckland.com</a></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>