Package com.dtrules.infrastructure

Examples of com.dtrules.infrastructure.RulesException


            RName    name  = state.datapop().rNameValue();
            IRObject value = state.datapop();
            boolean f = state.def(name, value, true);
            if(!f)
                if(state.find(name)==null){
                    throw new RulesException("Undefined",
                            "xdef",
                            name+" is undefined");
                }else{
                    throw new RulesException("Write Protection",
                            "xdef",
                            name+" is Input only, and xdef attempted to write to it");
                }
        }
View Full Code Here


            for(int i=length - 1;i>=0;i--){                  // For each element in array,
                 IRObject o = (IRObject) array.get(i);
                 int      t = o.type();
                 if(t== iNull)continue;
                 if(t!=iEntity){
                    throw new RulesException("Type Check", "Forallr", "Encountered a non-Entity entry in array: "+o);
                
                 state.entitypush((IREntity) o);
                 body.execute(state);
                 state.entitypop();
            }
View Full Code Here

           
            for(IRObject o : array){
                 int      t = o.type();
                 if(t== iNull)continue;
                 if(t!=iEntity){
                     throw new RulesException("Type Check", "Forallr", "Encountered a non-Entity entry in array: "+o);
                
                 state.entitypush((IREntity) o);
                 body.execute(state);
                 state.entitypop();
            }
View Full Code Here

            RName    table        = state.datapop().rNameValue();
           
            try{
                state.find(table).execute(state);
            }catch(NullPointerException e){
                throw new RulesException("undefined", "PerformCatchError",
                        "The table '"+table.stringValue()+"' is undefined");
            }catch(RulesException e){
                IRSession     session       = state.getSession();
                EntityFactory ef            = session.getEntityFactory();  
                IREntity      errorEntity   = ef.findRefEntity(error).clone(session).rEntityValue();
View Full Code Here

        public void execute(DTState state) throws RulesException {
            RName name = state.datapop().rNameValue();
            IRObject value = state.find(name);
            if(value == null){
                throw new RulesException(
                        "undefined",
                        "Lookup",
                        "Could not find a value for "+name.stringValue()+" in the current context."
                );
            }
View Full Code Here

       
        OutputStream out;
        try {
            out = new FileOutputStream(filepath+filename);
        } catch (FileNotFoundException e) {
            throw new RulesException(
                    "OutputFileCreationError",
                    "saveDecisionTables",
                    "An error occured openning the file: "+filepath+filename+"\n"+e
                   );
        }
View Full Code Here

      try {
        b = state.datapop().longValue();
        a = state.datapop().longValue();
        result = a/b;
      } catch (ArithmeticException e) {
        throw new RulesException("Math Exception","/","Error in Divide: "+a+"/"+b+"\n"+e);
      }
      state.datapush(RInteger.getRIntegerValue(result));
    }
View Full Code Here

       
        OutputStream out;
        try {
            out = new FileOutputStream(filepath+filename);
        } catch (FileNotFoundException e) {
            throw new RulesException(
                    "OutputFileCreationError",
                    "saveDecisionTables",
                    "An error occured openning the file: "+filepath+filename+"\n"+e
                   );
        }
View Full Code Here

            try {
                b = state.datapop().doubleValue();
                a = state.datapop().doubleValue();
                result = a/b;
            } catch (ArithmeticException e) {
                throw new RulesException("Math Exception","f/","Error in Divide: "+a+"/"+b+"\n"+e);
            }
            state.datapush(RDouble.getRDoubleValue(result));
        }
View Full Code Here

        public void execute(DTState state) throws RulesException {
            String message   = state.datapop().stringValue();
            String exception = state.datapop().stringValue();
            try {
                throw new RulesException(
                        "exception",
                        "User Exception",
                        message);
            } catch (Exception e) {
                throw new RulesException("Type Check",
                        "User Exception",
                        exception+":"+message);
            }
        }
View Full Code Here

TOP

Related Classes of com.dtrules.infrastructure.RulesException

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.