Package com.dtrules.interpreter

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


        // 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);
                   if (state.testState(DTState.TRACE)) {
                       state.traceInfo("addto", "arrayId", ((RArray)elist).getID() + "", e.postFix());
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

        // 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);

                   if (state.testState(DTState.TRACE)) {
View Full Code Here

     * @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() != 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()!=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()!=IRObject.iDecisiontable){
            return null;
        }
        return (RDecisionTable) dttable;
    }
    /**
 
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
            IRObject elist = state.getes(i).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);
                   if (state.testState(DTState.TRACE)) {
                       state.traceInfo("addto", "arrayId", ((RArray)elist).getID() + "", e.postFix());
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().getId() ==IRObject.iArray){
           ((RArray)rarray).add(newentity);
           if (state.testState(DTState.TRACE)) {
               state.traceInfo("addto", "arrayId", ((RArray)rarray).getID() + "", newentity.postFix());
           }
        }
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

               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

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.