[jboss-svn-commits] JBL Code SVN: r30312 - labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Nov 23 08:55:43 EST 2009


Author: Rikkola
Date: 2009-11-23 08:55:42 -0500 (Mon, 23 Nov 2009)
New Revision: 30312

Modified:
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Decision_Tables.xml
Log:
Fix for the misleading decision table documentation

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Decision_Tables.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Decision_Tables.xml	2009-11-23 13:08:55 UTC (rev 30311)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Decision_Tables.xml	2009-11-23 13:55:42 UTC (rev 30312)
@@ -801,15 +801,11 @@
 
         <para>The code to run this is simple:</para>
 
-        <programlisting>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
-DecisionTableConfiguration dtconf = KnowledgeBuilderFactory.newDecisionTableConfiguration();
-dtconf.setInputType( DecisionTableInputType.XLS );
-dtconf.setWorksheetName( "Tables_2" );
-kbuilder.add( ResourceFactory.newInputStreamResource( getSpreadsheetStream() ),
-              ResourceType.DTABLE,
-              dtconf );
-
-Collection&lt;KnowlegePackage&gt; kpkg = kbuilder.getKnowlegePackages();
+        <programlisting>//first we compile the spreadsheet with the template
+//to create a whole lot of rules.
+final ExternalSpreadsheetCompiler converter = new ExternalSpreadsheetCompiler();
+//the data we are interested in starts at row 2, column 2 (e.g. B2)
+final String drl = converter.compile(getSpreadsheetStream(), getRulesStream(), 2, 2);
 </programlisting>
 
         <para>We create an ExternalSpreadsheetCompiler object and use it to



More information about the jboss-svn-commits mailing list