Package com.dtrules.interpreter

Examples of com.dtrules.interpreter.IRObject.type()


     * @param name -- The name of the new decision table.
     * @return -- The new decision table
     */
    public RDecisionTable newDecisionTable(RName name, IRSession session)throws RulesException{
        IRObject table = decisiontables.get(name);
        if(table !=null && table.type().getId() != IRObject.iDecisiontable){
            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());
        }
View Full Code Here


     * @return
     * @throws RulesException
     */
    public RDecisionTable getDecisionTable(RName name)throws RulesException{
        IRObject dt = decisiontables.get(name);
        if(dt==null || dt.type().getId()!=IRObject.iDecisiontable){
            return null;
        }
        return (RDecisionTable) dt;
    }
   
View Full Code Here

     * @param dt
     * @return
     */
    public RDecisionTable findDecisionTable(RName dt){
        IRObject dttable = decisiontables.get(dt);
        if(dttable==null || dttable.type().getId()!=IRObject.iDecisiontable){
            return null;
        }
        return (RDecisionTable) dttable;
    }
    /**
 
View Full Code Here

                IRObject     value = e.get(aname);
               
                dtstate.traceTagBegin("attribute", "name",aname.stringValue(),"type",getType(e,aname));
                switch(e.getEntry(aname).type){
                   case IRObject.iEntity: {
                      if(value.type()==IRObject.iNull){
                          dtstate.traceInfo("value","type","null","value","null",null);
                          break;
                      }
                      dtstate.traceTagBegin("entity",
                              "name",   ((REntity)value).getName().stringValue(),
View Full Code Here

                   case IRObject.iArray: {
                      ArrayList values = value.arrayValue();
                      Iterator iv = values.iterator();
                      while(iv.hasNext()){
                          IRObject v = (IRObject) iv.next();
                          if(v.type()==IRObject.iEntity){
                              dump((REntity)v,depth+2);
                          }else{
                              dtstate.traceInfo("value","v",v.stringValue(),null);
                          }
                      }
View Full Code Here

         rpt.opentag(tag,"DTRulesId",e.getID()+"","id",idString);
         Iterator<RName> names = e.getAttributeIterator();
         while(names.hasNext()){
             RName    name = names.next();
             IRObject v    = e.get(name);
             if(v.type()==IRObject.iArray && v.rArrayValue().size()==0) continue;
             String   vstr = v==null?"":v.stringValue();
             rpt.printdata("attribute","name",name.stringValue(), vstr);
         }
   }
View Full Code Here

        if(number.equals("1"))return entity;
        DTState state = s.getState();
        IRObject rarray = state.find(RName.getRName(name+"s"));
       
        IREntity newentity = (IREntity) entity.clone(s);
        if(rarray!=null && rarray.type() ==IRObject.iArray){
           ((RArray)rarray).add(newentity);
        }
        return newentity;
    }
}
View Full Code Here

            IRObject o = state.datapop();
            IREntity e;
            try{
               e = o.rEntityValue();
            }catch(RulesException ex){
               ex.addToMessage("entitypush could not convert a "+RSession.typeInt2Str(o.type())+" to an Entity");
               throw ex;
            }
            state.entitypush(e);           
            if(state.testState(DTState.TRACE)){
               state.traceInfo("entitypush", "value",e.stringValue(),"id",e.getID()+"",null);
View Full Code Here

               
                dtstate.traceTagBegin("attribute", "name",aname.stringValue(),"type",getType(e,aname));
                int type = e.getEntry(aname).type.getId();
               
               if(type == IRObject.iEntity) {
                      if(value.type().getId() == IRObject.iNull){
                          dtstate.traceInfo("value","type","null","value","null",null);
                      }else{
                        dtstate.traceTagBegin("entity",
                                "name",   ((REntity)value).getName().stringValue(),
                                "id",     printIds ? ((REntity)value).getID()+"" : "");
View Full Code Here

         rpt.opentag(tag,"DTRulesId",e.getID()+"","id",printIds ? idString : "");
         Set<RName> names = e.getAttributeSet();
         RName keys[] = sort(names);
         for(RName name : keys){
             IRObject v    = e.get(name);
             if(v.type().getId()==IRObject.iArray && v.rArrayValue().size()==0) continue;
             String   vstr = v==null?"":v.stringValue();
             rpt.printdata("attribute","name",name.stringValue(), vstr);
         }
   }
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.