DecisionTableConfiguration dtableconfiguration = KnowledgeBuilderFactory.newDecisionTableConfiguration();
dtableconfiguration.setInputType( DecisionTableInputType.
XLS );KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newClassPathResource(
"RFC36877ScenarioDT.xls",getClass() ),
ResourceType.
DTABLE,dtableconfiguration );
if ( kbuilder.hasErrors() ) {System.
err.print( kbuilder.getErrors() ); return -1;}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
// typical decision tables are used statelesslyStatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
//now create some test dataInput input =
new Input();System.
out.println("creating the event...");BusinessEvent event =
new BusinessEvent();ksession.execute( Arrays.asList(
new Object[]{input, event} ) );System.
out.println( "Business events " + event.getEvents()); return 0;