[rules-users] ERR 101 & 102 When parsing Decision Table xls
Wolfgang Laun
wolfgang.laun at gmail.com
Fri Jun 10 11:51:49 EDT 2011
Looks as if this is only a warning.
Does the DRL compile without error? Also, your code uses the old API. Try
KnowledgeBuilder kBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
DecisionTableConfiguration dtConf =
KnowledgeBuilderFactory.newDecisionTableConfiguration();
dtConf.setInputType( DecisionTableInputType.XLS );
Resource resource = ResourceFactory.newClassPathResource( xlsPath,
getClass() );
kBuilder.add( resource, ResourceType.DTABLE, dtConf );
if( kBuilder.hasErrors() ){
KnowledgeBuilderErrors errors = kBuilder.getErrors();
for( KnowledgeBuilderError err: errors ){
System.err.println( err.toString() );
}
throw new IllegalStateException( "build errors" );
}
Or, if you want to see the generated DRL, use the above (slightly modified)
for the DRL, but do check for errors!
-W
On 10 June 2011 15:13, Sleepyhead <dorlandroy at gmail.com> wrote:
> Thx man!
> Was getting pretty pissed ... :P
>
> Only now I have a different problem when actually using the decision table:
>
> public RuleBase readDecisionTable() throws Exception
> {
> SpreadsheetCompiler converter = new SpreadsheetCompiler();
> String drl = converter.compile("CheckAccepted.xls",
> InputType.XLS );
> System.out.println(drl);
> PackageBuilder builder = new PackageBuilder();
> builder.addPackageFromDrl( new StringReader( drl ) );
> Package pkg = builder.getPackage();
> RuleBase ruleBase = RuleBaseFactory.newRuleBase();
> ruleBase.addPackage( pkg );
> return ruleBase;
> }
>
> I get this error:
>
>
> http://drools.46999.n3.nabble.com/file/n3048581/Java_-_DroolzBeslissrcmainjavacomsampleTester.java_-_Eclipse_2011-06-10_15-09-27.png
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/ERR-101-102-When-parsing-Decision-Table-xls-tp3048185p3048581.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110610/6a4f887c/attachment.html
More information about the rules-users
mailing list