Examples of SpreadsheetCompiler


Examples of org.drools.decisiontable.SpreadsheetCompiler

    try {         
     
      ResourceBundle rb = Utility.readPropFile();
      logger.debug("Could not find Resource file");
     
      SpreadsheetCompiler converter = new SpreadsheetCompiler();
      String xlResource =rb.getString("excel.decisiontable.path");
      logger.debug("name of Excel file:"+xlResource);
     
      InputStream is = getClass().getResourceAsStream(xlResource);
      String drl = converter.compile(is, InputType.XLS );     
     
      if (drl != null) { 
        PackageBuilder builder = new PackageBuilder();
        builder.addPackageFromDrl( new StringReader(drl) );
       
View Full Code Here

Examples of org.drools.decisiontable.SpreadsheetCompiler

    }

    private List<DroolsBuildMarker> parseXLSFile(final IFile file) {
      return parseResource(new ResourceParser() {
        public DRLInfo parseResource() throws DroolsParserException, DecisionTableParseException, CoreException {
                SpreadsheetCompiler converter = new SpreadsheetCompiler();
                String drl = converter.compile( file.getContents(), InputType.XLS );
                return DroolsEclipsePlugin.getDefault().parseXLSResource( drl, file );
        }
      });
    }
View Full Code Here

Examples of org.drools.decisiontable.SpreadsheetCompiler

    }

    private List<DroolsBuildMarker> parseCSVFile(final IFile file) {
      return parseResource(new ResourceParser() {
        public DRLInfo parseResource() throws DroolsParserException, CoreException {
                SpreadsheetCompiler converter = new SpreadsheetCompiler();
                String drl = converter.compile( file.getContents(), InputType.CSV );
                return DroolsEclipsePlugin.getDefault().parseXLSResource( drl, file );
        }
      });
    }
View Full Code Here

Examples of org.drools.decisiontable.SpreadsheetCompiler

    private List<DroolsBuildMarker> parseXLSFile(final IFile file) {
        return parseResource( new ResourceParser() {
            public DRLInfo parseResource() throws DroolsParserException,
                                          DecisionTableParseException,
                                          CoreException {
                SpreadsheetCompiler converter = new SpreadsheetCompiler();
                String drl = converter.compile( file.getContents(), InputType.XLS );
                return DroolsEclipsePlugin.getDefault().parseXLSResource( drl, file );
            }
        } );
    }
View Full Code Here

Examples of org.drools.decisiontable.SpreadsheetCompiler

    private List<DroolsBuildMarker> parseCSVFile(final IFile file) {
        return parseResource( new ResourceParser() {
            public DRLInfo parseResource() throws DroolsParserException,
                                          CoreException {
                SpreadsheetCompiler converter = new SpreadsheetCompiler();
                String drl = converter.compile( file.getContents(), InputType.CSV );
                return DroolsEclipsePlugin.getDefault().parseXLSResource( drl, file );
            }
        } );
    }
View Full Code Here

Examples of org.drools.decisiontable.SpreadsheetCompiler

            if ( source == null ) {
                // support legacy name
                source = ( String ) properties.get( "source" );
            }
            if ( source != null && source.equals( Constants.RES_SOURCE_TYPE_DECISION_TABLE ) ) {
                final SpreadsheetCompiler converter = new SpreadsheetCompiler();
                final String drl = converter.compile( ruleExecutionSetStream,
                                                      InputType.XLS );
                return createRuleExecutionSet( new StringReader( drl ), properties );
            } else {
                return createRuleExecutionSet( new InputStreamReader( ruleExecutionSetStream ), properties);
            }
View Full Code Here

Examples of org.drools.decisiontable.SpreadsheetCompiler

        builder.addRuleFlow(instream);
      } else if (fileName.endsWith(DroolsCompilerAntTask.XMLFILEEXTENSION)) {
        builder.addPackageFromXml(instream);
            } else if (fileName.equals(DroolsCompilerAntTask.XLSFILEEXTENSION)) {

                final SpreadsheetCompiler converter = new SpreadsheetCompiler();
                final String drl = converter.compile( new FileInputStream(file),
                                                      InputType.XLS );


                System.out.println(drl);
View Full Code Here

Examples of org.drools.decisiontable.SpreadsheetCompiler

    private List<DroolsBuildMarker> parseXLSFile(final IFile file) {
        return parseResource( new ResourceParser() {
            public DRLInfo parseResource() throws DroolsParserException,
                                          DecisionTableParseException,
                                          CoreException {
                SpreadsheetCompiler converter = new SpreadsheetCompiler();
                String drl = converter.compile( file.getContents(), InputType.XLS );
                return DroolsEclipsePlugin.getDefault().parseXLSResource( drl, file );
            }
        } );
    }
View Full Code Here

Examples of org.drools.decisiontable.SpreadsheetCompiler

    private List<DroolsBuildMarker> parseCSVFile(final IFile file) {
        return parseResource( new ResourceParser() {
            public DRLInfo parseResource() throws DroolsParserException,
                                          CoreException {
                SpreadsheetCompiler converter = new SpreadsheetCompiler();
                String drl = converter.compile( file.getContents(), InputType.CSV );
                return DroolsEclipsePlugin.getDefault().parseXLSResource( drl, file );
            }
        } );
    }
View Full Code Here

Examples of org.drools.decisiontable.SpreadsheetCompiler

     * @param file
     * @return
     * @throws FileNotFoundException
     */
    public static String compileDTabletoDRL(File file, InputType type) throws FileNotFoundException {
        SpreadsheetCompiler compiler = new SpreadsheetCompiler();
        return compiler.compile(new FileInputStream(file), type);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.