Package com.dtrules.session

Examples of com.dtrules.session.RuleSet


    /**
     * Create a new Decision Table
     */
  public RDecisionTable createDecisionTable(String rulesetname, String decisiontablename)
            throws RulesException{
    RuleSet rs     = getRuleset(rulesetname);
        return rs.getEntityFactory(session).newDecisionTable(decisiontablename,session);
  }
View Full Code Here


   * @see com.dtrules.admin.IRulesAdminService#getAttributes(java.lang.String, java.lang.String)
   */
  public List getAttributes(String rulesetname, String entityName) {
        if(rulesDirectory==null)return null;
        try {
            RuleSet rs = rulesDirectory.getRuleSet(RName.getRName(rulesetname));
            Iterator it = rs.getEntityFactory(session)
                          .findRefEntity(RName.getRName(entityName)).getAttributeIterator();
            return getList(it);
        } catch (RulesException e) {
            return null;
        }
View Full Code Here

  /* (non-Javadoc)
   * @see com.dtrules.admin.IRulesAdminService#getDecisionTable(java.lang.String, java.lang.String)
   */
  public RDecisionTable getDecisionTable(String rulesetname, String DecisionTableName) {
        try {
            RuleSet rs = rulesDirectory.getRuleSet(RName.getRName(rulesetname));
            return rs.getEntityFactory(session)
                   .findTable(RName.getRName(DecisionTableName));
        } catch (RulesException e) {
            return null;
        }
  }
View Full Code Here

   * @see com.dtrules.admin.IRulesAdminService#getDecisionTables(java.lang.String)
   */
  public List getDecisionTables(String rulesetname) {
    if(rulesDirectory==null)return null;
        try {
            RuleSet rs = rulesDirectory.getRuleSet(RName.getRName(rulesetname));
            Iterator it = rs.getEntityFactory(session).getDecisionTableRNameIterator();
            return getList(it);
        } catch (RulesException e) {
            return null;
        }
  }
View Full Code Here

    /**
     * Updates the Decision Table XML specified in the RuleSet with the Decision Tables as
     * currently held in memory. 
     */
    public void saveDecisionTables(RSession session, String rulesetname) throws RulesException {
        RuleSet       rs       = rulesDirectory.getRuleSet(RName.getRName(rulesetname));
        String        filepath = rs.getFilepath();
        String        filename = rs.getDT_XMLName();
       
        OutputStream out;
        try {
            out = new FileOutputStream(filepath+filename);
        } catch (FileNotFoundException e) {
View Full Code Here

     * @param session The session which gives us the outputstreams for debug statements and trace statements
     * @param rulesetname The Rule Set to be written out to the output stream
     * @throws RulesException
     */
  public void saveDecisionTables(OutputStream out, RSession session, String rulesetname) throws RulesException {
      RuleSet       rs       = rulesDirectory.getRuleSet(RName.getRName(rulesetname));
        EntityFactory ef       = rs.getEntityFactory(session);
       
        PrintStream  ps  = new PrintStream(out);
        Iterator<RName> tables = ef.getDecisionTableRNameIterator();
        ps.println("<decision_tables>");
        while(tables.hasNext()){
View Full Code Here

    public static void main(String args[]){
        String path = "C:\\eclipse\\workspace\\EB_POC\\new_york_EB\\xml\\";
        String file = path + "DTRules.xml";   
   
        RulesDirectory    rd      = new RulesDirectory("",file);
        RuleSet           rs      = rd.getRuleSet(RName.getRName("ebdemo"));
        RSession          session;
        try {
            OutputStream  out     = new FileOutputStream("c:\\temp\\dt.xml");
                          session = new RSession(rs);
            RulesAdminService admin   = new RulesAdminService(session, rd);
View Full Code Here

            System.out.println(e1.toString());
        }
    }

    public void saveEDD(RSession session, String rulesetname) throws RulesException {
        RuleSet       rs       = rulesDirectory.getRuleSet(RName.getRName(rulesetname));
        EntityFactory ef       = rs.getEntityFactory(session);
        String        filepath = rs.getFilepath();
        String        filename = rs.getEDD_XMLName();
       
        OutputStream out;
        try {
            out = new FileOutputStream(filepath+filename);
        } catch (FileNotFoundException e) {
View Full Code Here

   
    public static void main(String arg[]) throws Exception {
        String         path     = "C:\\maximus\\eb_dev2\\rulesDevelopment\\eb-newyork\\";
        RulesDirectory rd       = new RulesDirectory(path,"DTRules.xml");
        RName          rsName   = RName.getRName("autoassign");
        RuleSet        rs       = rd.getRuleSet(rsName);
       
        try {
            Coverage c = new Coverage(rs,path+"ny-autoassign\\testfiles\\output\\");
            c.compute();
            c.printReport(System.out);
View Full Code Here

    }
   
    public void writeDecisionTables(String tables, String fields[], boolean ascending, int limit){
        try {
            RulesDirectory    rd    = new RulesDirectory(getPath(),getRulesDirectoryFile());
            RuleSet           rs    = rd.getRuleSet(getRuleSetName());
            IRSession         s     = rs.newSession();
            RulesAdminService admin = new RulesAdminService(s);
           
            Rules2Excel r2e = new Rules2Excel();
           
            r2e.writeExcel(admin, rs, tables, fields, ascending, limit);
View Full Code Here

TOP

Related Classes of com.dtrules.session.RuleSet

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.