Package net.firstpartners.drools.data

Examples of net.firstpartners.drools.data.RuleSource


    IRuleLoader ruleLoader = new FileRuleLoader();
    SpreadSheetRuleRunner ruleRunner = new SpreadSheetRuleRunner(ruleLoader);

    //Start Integrate in new RuleRunner
    //Identify where the rules are stored
    RuleSource ruleSource = new RuleSource();
    ruleSource.setRulesLocation(RULES_FILES);


    //Get the URL
    File excelDataFile = new File(EXCEL_DATA_FILE);
View Full Code Here


    IRuleLoader ruleLoader = new FileRuleLoader();
    SpreadSheetRuleRunner ruleRunner = new SpreadSheetRuleRunner(ruleLoader);

    //Start Integrate in new RuleRunner
    //Identify where the rules are stored
    RuleSource ruleSource = new RuleSource();
    ruleSource.setRulesLocation(RULES_FILES);


    //Get the URL
    File excelDataFile = new File(EXCEL_DATA_FILE);
View Full Code Here

    //Get a handle to the rule loader that we will use
    IRuleLoader ruleLoader = getRuleLoader(ruleLocation);

    //Setup the source
    RuleSource ruleSource = new RuleSource();
    ruleSource.setRulesLocation(ruleLocation);


    KnowledgeBase kb= ruleLoader.loadRules(ruleSource);
    if(outputFile!=null){
      cacheKnowledgeBase(kb,outputFile);
View Full Code Here

    for (Range r : ranges) {
      log.debug(r);
    }

    // Set Paramaters
    RuleSource ruleSource = new RuleSource();
    ruleSource.setDslFileLocation(DSL_FILE);
    ruleSource.setRulesLocation(RULES_FILES);
    ruleSource.setFacts(ranges.getAllRangesAndCells());
    ruleSource.setGlobals(globals);

    // Load and fire our rules files against the data
    new RuleRunner(new FileRuleLoader()).runStatelessRules(ruleSource,excelLogger);

    // Log the cell contents
View Full Code Here

    // Create a new Excel Logging object
    SpreadSheetLogger excelLogger = new SpreadSheetLogger();

    // Set Paramaters
    RuleSource ruleSource = new RuleSource();
    ruleSource.setRulesLocation(RULES_FILES);
    ruleSource.setFacts(ranges.getAllRangesAndCells());
    ruleSource.setGlobals(globals);


    // Load and fire our rules files against the data
    new RuleRunner(new FileRuleLoader()).runStatelessRules(ruleSource,excelLogger);
View Full Code Here

    IRuleLoader ruleLoader = new FileRuleLoader();
    SpreadSheetRuleRunner sheetRuleRunner = new SpreadSheetRuleRunner(ruleLoader);

    //Start Integrate in new RuleRunner
    //Identify where the rules are stored
    RuleSource ruleSource = new RuleSource();
    ruleSource.setRuleFlowFileUrl(RULEFLOW_FILE);
    ruleSource.setRulesLocation(RULES_FILES);

    //Get the URL
    File excelDataFile = new File(EXCEL_DATA_FILE);

    //Call the rule engine passing in the excel data file, the rules we want to use, and name of the spreadsheet that we log rules to
View Full Code Here

    OoompaLoompaDate holiday2= new OoompaLoompaDate(2009,2,10);
    OoompaLoompaDate holiday1= new OoompaLoompaDate(2009,3,17);


    //Set these into a new RuleSource object
    RuleSource ruleSource = new RuleSource();
    ruleSource.setRulesLocation(RULES_FILES);

    //Add the globals
    ruleSource.addGlobal(NEXT_AVAILABLE_SHIPMENT_DATE, new OoompaLoompaDate(2009,02,03));

    //Add the facts
    ruleSource.addFact(candyBarOrder);
    ruleSource.addFact(holiday1);
    ruleSource.addFact(holiday2);

    // A lot of the running rules uses the same code. The RuleRunner (code in this project)
    // keeps this code in one place. It needs to know
    // - the name(s) of the files containing our rules
    // - the fact object(s) containing the information to be passed in and out of our rules
View Full Code Here

    String knowledgeBaseFile = req.getParameter(PARAM_KNOWLEDGE_BASE);
    String excelFile = req.getParameter(PARAM_EXCEL_DATA_FILE);


    //Identify where the rules are stored
    RuleSource ruleSource = new RuleSource();
    ruleSource.setKnowledgeBaseLocation(knowledgeBaseFile);
    log.info("Using knowledgeBaseFile"+knowledgeBaseFile);

    if ((user != null)&&(knowledgeBaseFile!=null)&&!knowledgeBaseFile.equals("")&&(excelFile!=null)&&!excelFile.equals("")) {

      resp.setContentType("application/vnd.ms-excel");
View Full Code Here

    }

    // Get the params
    String excelFile = args[0];
    String outputFileName = args[1];
    RuleSource ruleArgs = convertSourceToRuleArgs(args);

    // Open the inputfile as a stream
    FileInputStream excelInput = new FileInputStream(excelFile);

    // Call the rules using this Excel datafile
View Full Code Here

        ruleFileLocations[a] = commandLineArgs[a + 2];
      }
    }

    //Set this as a RuleSource Object
    RuleSource ruleSource = new RuleSource();
    ruleSource.setRulesLocation(ruleFileLocations);

    return ruleSource;
  }
View Full Code Here

TOP

Related Classes of net.firstpartners.drools.data.RuleSource

Copyright © 2018 www.massapicom. 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.