<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.&nbsp;</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 -&nbsp;<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">&nbsp; &nbsp; &nbsp; &nbsp; 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">&nbsp; &nbsp; &nbsp; &nbsp; final String drl = converter.compile( stream,</font></div><div><font face="Monaco" color="#0056d6">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InputType.XLS,</font></div><div><font face="Monaco" color="#0056d6">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new RuleMatrixSheetListener() );</font></div><div><br></div></div></div><div><font face="Arial">But the Spring&nbsp;configuration&nbsp;doesn't seem to support that type.. (i.e.&nbsp;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">&lt;</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">&gt;</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">&lt;</span>drools-spring:resources<span style="color: #009193">&gt;</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">&lt;</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">&gt;</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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>&lt;drools-spring:decisiontable-<span style="text-decoration: underline">conf</span> input-type="XLS"/&gt;</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); ">&lt;/</span><span style="color: rgb(78, 145, 146); ">drools-spring:resource</span><span style="color: rgb(0, 145, 147); ">&gt;</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">&lt;/</span>drools-spring:resources<span style="color: #009193">&gt;</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">&lt;/</span>drools-spring:kbase<span style="color: #009193">&gt;</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&nbsp;</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>&nbsp;to the schema a a new parser - because they are different</div><div>&nbsp; &nbsp;(modify&nbsp;<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; ">&nbsp; &nbsp;(create a new&nbsp;</span>DecisionTableConfiguration for Matrix sheets)</div><div><span style="font-family: Arial; ">&nbsp; &nbsp;</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:&nbsp;</div><div><br></div><div>&nbsp; &nbsp; &nbsp;compile(stream, inputType, listener)</div><div>&nbsp; &nbsp; &nbsp;compile(stream, inputType)&nbsp;</div><div>&nbsp; &nbsp; &nbsp;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>