Package com.dtrules.interpreter

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


            ArrayList array  = state.datapop().arrayValue(); // Get the array
            int       length = array.size();                 // get Array length.
            IRObject body = state.datapop();                 // Get the body
            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);
View Full Code Here


            Object object = autoDataMap.getCurrentObject();
            if(object instanceof IREntity){
                IREntity entity = (IREntity) object;
                rname = mapName(autoDataMap, labelMap, node.getLabel());
                IRObject olist = entity.get(rname);
                if(olist != null && olist.type().getId() == IRObject.iArray){
                    list = olist.rArrayValue();
                }
            }
           
            node.setTargetList(list);
View Full Code Here

            Object object = autoDataMap.getCurrentObject();
            if(object instanceof IREntity){
                IREntity entity = (IREntity) object;
                rname = mapName(autoDataMap, labelMap, node.getAttribute().getName() );
                IRObject olist = entity.get(rname);
                if(olist != null && olist.type().getId() == IRObject.iTable){
                    rTable = olist.rTableValue();
                }
            }
            if(rTable == null){
                rTable = RTable.newRTable(autoDataMap.getSession().getEntityFactory(),
View Full Code Here

    public void arrayExecute(DTState state) throws RulesException {

      String pattern = state.datapop().stringValue();
      IRObject obj1 = state.datapop();
      String v = "";
      if (obj1.type().getId() != IRObject.iNull) {
        v = obj1.stringValue().trim();
      }
      String[] results = v.split(pattern);

      RArray r = new RArray(state.getSession().getUniqueID(), false,
View Full Code Here

               RName rname = RName.getRName(
                  (entity==null||entity.length()==0?"":entity+".")+ident);
               try {
                  IRObject o = session.getState().find(rname);
                  if(o==null)return -1;
                  return o.type().getId();
                } catch (RulesException e) {
                  return -1;
                }
           }
          
View Full Code Here

            public void execute(DTState state) throws RulesException {
               
                String   pattern = state.datapop().stringValue();
                IRObject obj1    = state.datapop();
                String   v       = "";
                if(obj1.type() != IRObject.iNull){
                   v = obj1.stringValue().trim();
                }  
                String [] results = v.split(pattern);
               
                RArray r = new RArray(state.getSession().getUniqueID(),false,false);
View Full Code Here

            int            length = array.size();                 // get Array length.
            IRObject       body   = state.datapop();              // Get the body
           
            for(int i=length - 1;i>=0;i--){                  // For each element in array,
                 IRObject o = (IRObject) array.get(i);
                 int      t = o.type().getId();
                 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);
View Full Code Here

        // First add this entity to any list found on the entity stack.
        for(int i=0; i< state.edepth(); i++){
            // Look for all Array Lists on the Entity Stack that look like lists of this Entity
            IREntity entity = state.getes(i);
            IRObject elist = entity.get(listname);
            if(elist!=null && elist.type().getId()==IRObject.iArray){
                // If not a member of this list, then add it.
                if(!((RArray)elist).contains(e)){
                   ((RArray)elist).add(e);
                }
            }
View Full Code Here

               RName rname = RName.getRName(
                  (entity==null||entity.length()==0?"":entity+".")+ident);
               try {
                  IRObject o = session.getState().find(rname);
                  if(o==null)return -1;
                  return o.type().getId();
                } catch (RulesException e) {
                  return -1;
                }
           }
          
View Full Code Here

            IRObject o = state.datapop();
            IREntity e;
            try{
               e = o.rEntityValue();
            }catch(RulesException ex){
               ex.addToMessage("entitypush could not convert a "+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

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.