Yash,
The following approach should work :
DecisionTableConfiguration dtconf =
KnowledgeBuilderFactory.newDecisionTableConfiguration();
                dtconf.setInputType( DecisionTableInputType.XLS );
                dtconf.setWorksheetName( "Tables" ); // Sheet containing the 
decision
table

                kbuilder.add(ResourceFactory.newFileResource(
                "<path to file>\\ExamplePolicyPricing.xls"), 
ResourceType.DTABLE, dtconf);


Vijay


yash kapoor wrote:
> 
> Hi All,           I want to execute the example PricingRuleDTExample.java
> contains in drools-examples-drl-4.0.x
> 
> This file read the the ExamplePolicyPricing.xls file ,when  I am running
> it
> gives the following error
> 
> Exception in thread "main" java.lang.RuntimeException: Script template is
> null - check for missing script definition.
> at org.drools.decisiontable.model.SnippetBuilder.build(Unknown Source)
> at org.drools.decisiontable.parser.ActionType.getSnippet(Unknown Source)
> at
> org.drools.decisiontable.parser.RuleSheetListener.createCondition(Unknown
> Source)
> at org.drools.decisiontable.parser.RuleSheetListener.nextRule(Unknown
> Source)
> at
> org.drools.decisiontable.parser.RuleSheetListener.processRuleCell(Unknown
> Source)
> at org.drools.decisiontable.parser.RuleSheetListener.newCell(Unknown
> Source)
> at org.drools.decisiontable.parser.xls.ExcelParser.handleText(Unknown
> Source)
> at org.drools.decisiontable.parser.xls.ExcelParser.processRecord(Unknown
> Source)
> at
> org.apache.poi.hssf.eventusermodel.HSSFRequest.processRecord(HSSFRequest.java:136)
> at
> org.apache.poi.hssf.eventusermodel.HSSFEventFactory.genericProcessEvents(HSSFEventFactory.java:170)
> at
> org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents(HSSFEventFactory.java:101)
> at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(Unknown
> Source)
> at
> org.drools.decisiontable.SpreadsheetCompiler.getRuleSheetListener(Unknown
> Source)
> at org.drools.decisiontable.SpreadsheetCompiler.compile(Unknown Source)
> at
> org.drools.examples.PricingRuleDTExample.executeExample(PricingRuleDTExample.java:40)
> at
> org.drools.examples.PricingRuleDTExample.main(PricingRuleDTExample.java:29)
> 
> 
> 
> I do not know .....what is wrong in XLS file here I am attaching the code
> in
> zip format .
> 
> 
> Any suggestion/comment will appreciated.
> 
> Regards
> 
> Yash
> 
>  
> _______________________________________________
> rules-users mailing list
> [email protected]
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Need-Help-tp21726378p21765197.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to