Examples of RDecisionTable


Examples of com.dtrules.decisiontables.RDecisionTable

       
        public void execute(DTState state) throws RulesException {
            String section = state.getCurrentTableSection();
            String description = "";
            if(section.equalsIgnoreCase("action")){
                RDecisionTable table = state.getCurrentTable();
                description = table.getActionsComment()[state.getNumberInSection()];
            }else if(section.equalsIgnoreCase("condition")){
                RDecisionTable table = state.getCurrentTable();
                description = table.getConditionsComment()[state.getNumberInSection()];
            }
            state.datapush( RString.newRString(description));
        }
View Full Code Here

Examples of com.dtrules.decisiontables.RDecisionTable

   */
    public void printBalancedTables(PrintStream out)throws RulesException {
        Iterator<RName> dts = this.getEntityFactory().getDecisionTableRNameIterator();
        while(dts.hasNext()){
            RName dtname = dts.next();
            RDecisionTable dt = this.getEntityFactory().findDecisionTable(dtname);
            String t;
            try{
              t = dt.getBalancedTable().getPrintableTable();
            }catch(RulesException e){
              System.out.flush();
              System.err.println("The Decision Table '"+dt.getName().stringValue()
                  +"' is too complex, and must be split into two tables.");
              t = "Table too Big to Print";
              System.err.flush();
            }
            out.println();
View Full Code Here

Examples of com.dtrules.decisiontables.RDecisionTable

            throw new RulesException("ParsingError","New Decision Table","For some reason, "+name.stringValue()+" isn't a decision table");
        }
        if(table != null){
            session.getState().debug("Overwritting the Decision Table: "+name.stringValue());
        }
        RDecisionTable dtTable = new RDecisionTable(session,name.stringValue());
        decisiontablelist.add(name);
        decisiontables.addAttribute(name, "", dtTable, false, true, IRObject.iDecisiontable,null,"","","");
        decisiontables.put(null, name, dtTable);
        return dtTable;
    }
View Full Code Here

Examples of com.dtrules.decisiontables.RDecisionTable

       
        public void execute(DTState state) throws RulesException {
            String section = state.getCurrentTableSection();
            String description = "";
            if(section.equalsIgnoreCase("action")){
                RDecisionTable table = state.getCurrentTable();
                description = table.getActionsComment()[state.getNumberInSection()];
            }else if(section.equalsIgnoreCase("condition")){
                RDecisionTable table = state.getCurrentTable();
                description = table.getConditionsComment()[state.getNumberInSection()];
            }
            state.datapush( RString.newRString(description));
        }
View Full Code Here

Examples of com.dtrules.decisiontables.RDecisionTable

   */
    public void printBalancedTables(PrintStream out)throws RulesException {
        Iterator<RName> dts = this.getEntityFactory().getDecisionTableRNameIterator();
        while(dts.hasNext()){
            RName dtname = dts.next();
            RDecisionTable dt = this.getEntityFactory().findDecisionTable(dtname);
            String t;
            try{
              t = dt.getBalancedTable().getPrintableTable();
            }catch(RulesException e){
              System.out.flush();
              System.err.println("The Decision Table '"+dt.getName().stringValue()
                  +"' is too complex, and must be split into two tables.");
              t = "Table too Big to Print";
              System.err.flush();
            }
            out.println();
View Full Code Here

Examples of com.dtrules.decisiontables.RDecisionTable

            throw new RulesException("ParsingError","New Decision Table","For some reason, "+name.stringValue()+" isn't a decision table");
        }
        if(table != null){
            session.getState().debug("Overwritting the Decision Table: "+name.stringValue());
        }
        RDecisionTable dtTable = new RDecisionTable(session,name.stringValue());
        decisiontablelist.add(name);
        decisiontables.addAttribute(name, "", dtTable, false, true, RDecisionTable.dttype ,null,"","","");
        decisiontables.put(null, name, dtTable);
        return dtTable;
    }
View Full Code Here

Examples of com.dtrules.decisiontables.RDecisionTable

   */
    public void printBalancedTables(PrintStream out)throws RulesException {
        Iterator<RName> dts = this.getEntityFactory().getDecisionTableRNameIterator();
        while(dts.hasNext()){
            RName dtname = dts.next();
            RDecisionTable dt = this.getEntityFactory().findDecisionTable(dtname);
            String t = dt.getBalancedTable().getPrintableTable();
           
            out.println();
            out.println(dtname.stringValue());
            out.println();
            out.println(t);
View Full Code Here

Examples of com.dtrules.decisiontables.RDecisionTable

            EntityFactory   ef  = rs.newSession().getEntityFactory();
            IREntity        dt  = ef.getDecisiontables();
            Iterator<RName> idt = ef.getDecisionTableRNameIterator();
           
            while(idt.hasNext()){
                RDecisionTable t = (RDecisionTable) dt.get(idt.next());
                t.build(session.getState());
                List<IDecisionTableError> errs = t.compile();
                for (IDecisionTableError error : errs){
                    dtcompiler.logError(
                            t.getName().stringValue(),
                            t.getFilename(),
                            "validity check",
                            error.getMessage(),
                            0,
                            "In the "+error.getErrorType().name()+" row "+error.getIndex()+"\r\n"+error.getSource());
                }
                Coordinate err_RowCol = t.validate();
                if(!t.isCompiled()  || err_RowCol!=null){
                    int column = 0;
                    int row    = 0;
                    if(err_RowCol!=null){
                        row    = err_RowCol.getRow();
                        column = err_RowCol.getCol();
                    }
                    dtcompiler.logError(
                            t.getName().stringValue(),
                            t.getFilename(),
                            "validity check",
                            "Decision Table did not compile",
                            0,
                            "A problem may have been found on row "+row+" and column "+column);
                }
            }
           
            dtcompiler.printErrors(err, NumErrorsToReport);
            err.println("Total Errors Found: "+dtcompiler.getErrors().size());
            if(dtcompiler.getErrors().size() == 0){
                rd  = new RulesDirectory(path, rulesDirectoryXML);
                rs  = rd.getRuleSet(RName.getRName(ruleset));
                PrintStream btables = new PrintStream(rs.getWorkingdirectory()+"balanced.txt");
                rs.newSession().printBalancedTables(btables);
                RulesAdminService admin = new RulesAdminService(rs.newSession(),rd);
                List tables = admin.getDecisionTables(rs.getName());
                for(Object table : tables){
                   RDecisionTable dtable = admin.getDecisionTable(rs.getName(),(String)table);
                   dtable.check(System.out);
                }
            }
        } catch (Exception e) {
            err.print(e);
        }
View Full Code Here

Examples of com.dtrules.decisiontables.RDecisionTable

   */
    public void printBalancedTables(PrintStream out)throws RulesException {
        Iterator<RName> dts = this.getEntityFactory().getDecisionTableRNameIterator();
        while(dts.hasNext()){
            RName dtname = dts.next();
            RDecisionTable dt = this.getEntityFactory().findDecisionTable(dtname);
            String t;
            try{
              t = dt.getBalancedTable().getPrintableTable();
            }catch(RulesException e){
              System.out.flush();
              System.err.println("The Decision Table '"+dt.getName().stringValue()
                  +"' is too complex, and must be split into two tables.");
              t = "Table too Big to Print";
              System.err.flush();
            }
            out.println();
View Full Code Here

Examples of com.dtrules.decisiontables.RDecisionTable

        IRSession session = rs.newSession();
        RulesAdminService admin = new RulesAdminService(session,rs.getRulesDirectory());
        List tables = admin.getDecisionTables(rs.getName());
       
        for(Object table : tables){
            RDecisionTable dt = admin.getDecisionTable(rs.getName(),(String)table);
            int columns     = dt.getConditiontable().length>0 ? dt.getConditiontable()[0].length:0;
            int conditions  = dt.getConditiontable().length;
            int actions     = dt.getActions().length;
            Stats stats = new Stats(dt,columns,conditions,actions);
           
            this.tables.put(dt.getName().stringValue(),stats);
        }
    }
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.