@Test public void testIntegration() throws Exception { final ExternalSpreadsheetCompiler converter = new ExternalSpreadsheetCompiler(); final String drl = converter.compile("/data/IntegrationExampleTest.xls", "/templates/test_integration.drl", 18, 3); KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add(ResourceFactory.newByteArrayResource(drl.getBytes()), ResourceType.DRL); assertFalse(kbuilder.hasErrors()); InternalKnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addPackages(kbuilder.getKnowledgePackages()); KieSession kSession = kbase.newKieSession(); kSession.insert( new Cheese( "stilton", 42 ) ); kSession.insert( new Person( "michael", "stilton", 42 ) ); List<String> list = new ArrayList<String>(); kSession.setGlobal( "list", list ); kSession.fireAllRules(); assertEquals( 1, list.size() ); }
public String compile(final String xls, final String template, int startRow, int startCol) { return compile( xls, template, InputType.XLS, startRow, startCol ); }
ExternalSpreadsheetCompiler { public String compile(final String xls, final String template, int startRow, int startCol) { return compile( xls, template, InputType.XLS, startRow, startCol ); } }
ExternalSpreadsheetCompiler { public String compile(final String xls, final String template, int startRow, int startCol) { return compile( xls, template, InputType.XLS, startRow, startCol ); }  }
ExternalSpreadsheetCompiler { public String compile(final String xls, final String template, int startRow, int startCol) { return compile( xls, template, InputType.XLS, startRow, startCol ); }  String compile(final String xls,
                          final String template,
                          int startRow,
                          int startCol); String compile(final String xls,
                          final String template,
                          InputType type,
                          int startRow,
                          int startCol); String compile(final String xls,
                          final String worksheetName,
                          final String template,
                          int startRow,
                          int startCol); String compile(final InputStream xlsStream,
                          final InputStream templateStream,
                          int startRow,
                          int startCol); String compile(final InputStream xlsStream,
                          final InputStream templateStream,
                          InputType type,
                          int startRow,
                          int startCol); String compile(final InputStream xlsStream,
                          final String worksheetName,
                          final InputStream templateStream,
                          int startRow,
                          int startCol); void compile(final String xls,
                        InputType type,
                        final List<DataListener> listeners); void compile(final String xls,
                        final Map<String, List<DataListener>> listeners); void compile(final InputStream xlsStream,
                        InputType type,
                        final List<DataListener> listeners); void compile(final InputStream xlsStream,
                        final Map<String, List<DataListener>> listeners); String compile(final InputStream xlsStream,
                          final InputType type,
                          final TemplateDataListener listener); String compile(final InputStream xlsStream,
                          final String worksheetName,
                          final TemplateDataListener listener); }
ExternalSpreadsheetCompiler { public String compile(final String xls, final String template, int startRow, int startCol) { return compile( xls, template, InputType.XLS, startRow, startCol ); }  String compile(final String xls,
                          final String template,
                          int startRow,
                          int startCol); String compile(final String xls,
                          final String template,
                          InputType type,
                          int startRow,
                          int startCol); String compile(final String xls,
                          final String worksheetName,
                          final String template,
                          int startRow,
                          int startCol); String compile(final InputStream xlsStream,
                          final InputStream templateStream,
                          int startRow,
                          int startCol); String compile(final InputStream xlsStream,
                          final InputStream templateStream,
                          InputType type,
                          int startRow,
                          int startCol); String compile(final InputStream xlsStream,
                          final String worksheetName,
                          final InputStream templateStream,
                          int startRow,
                          int startCol); void compile(final String xls,
                        InputType type,
                        final List<DataListener> listeners); void compile(final String xls,
                        final Map<String, List<DataListener>> listeners); void compile(final InputStream xlsStream,
                        InputType type,
                        final List<DataListener> listeners); void compile(final InputStream xlsStream,
                        final Map<String, List<DataListener>> listeners); String compile(final InputStream xlsStream,
                          final InputType type,
                          final TemplateDataListener listener); String compile(final InputStream xlsStream,
                          final String worksheetName,
                          final TemplateDataListener listener);  }