Examples of RName


Examples of com.dtrules.interpreter.RName

     */
    static class ExecuteTable extends ROperator {
        ExecuteTable(){super("executetable");}

        public void execute(DTState state) throws RulesException {
            RName dtname = state.datapop().rNameValue();
            state.getSession().getEntityFactory().getDecisionTable(dtname).executeTable(state);
        }
View Full Code Here

Examples of com.dtrules.interpreter.RName

        public void execute(DTState state) throws RulesException {
            IREntity entity  = state.datapop().rEntityValue()// Get the entity
            IRObject body = state.datapop();                    // Get the body
            Iterator keys = entity.getAttributeIterator();      // Get the Attribute Iterator
            while(keys.hasNext()){                         // For each attribute
                RName     n = (RName) keys.next();
                IRObject  v = entity.get(n);
                if(v!=null){
                    state.datapush(n);
                    state.datapush(v);
                    body.execute(state);
View Full Code Here

Examples of com.dtrules.interpreter.RName

        private IRObject p(String v) { return RString.newRString(v==null?"":v); }
        private RName    n(String x) { return RName.getRName(x);}
       
        public void execute(DTState state) throws RulesException {
            RName    error        = state.datapop().rNameValue();
            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();
                state.entitypush(errorEntity);
View Full Code Here

Examples of com.dtrules.interpreter.RName

     */
    static class Lookup extends ROperator {
        Lookup(){super("lookup");}

        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."
                );
            }
            state.datapush(value);
        }
View Full Code Here

Examples of com.dtrules.interpreter.RName

     */
    static class InContext extends ROperator {
            InContext(){super("InContext");}

            public void execute(DTState state) throws RulesException {
                RName       entityName  = state.datapop().rNameValue();
                IREntity    entity      = state.findEntity(entityName);
                state.datapush(entity);
            }
View Full Code Here

Examples of com.dtrules.interpreter.RName

     * @param o
     * @param n
     */
    protected static void alias (IRObject o ,String n) {
        try {
            RName rn = RName.getRName(n);
            if(primitives.containsAttribute(rn)){
                System.err.println("Duplicate Operators defined for " + rn.stringValue());
              throw new RuntimeException("Duplicate definitions for " + rn.stringValue());
            }
            primitives.addAttribute(rn, "", o, false, true, o.type(),null,"operator","","");
            primitives.put(null, rn,o);
        } catch (RulesException e) {
            System.err.println("An Error occured in alias building the primitives Entity: "+n);
View Full Code Here

Examples of com.dtrules.interpreter.RName

     * @param o
     * @param n
     */
    public static void override (IRObject o ,String n) {
        try {
            RName rn = RName.getRName(n);
            primitives.addAttribute(rn, "", o, false, true, o.type(),null,"operator","","");
            primitives.put(null, rn,o);
        } catch (RulesException e) {
            System.err.println("An Error occured in alias building the primitives Entity: "+n);
            throw new RuntimeException("An Error occured in alias building the primitives Entity: "+n);
View Full Code Here

Examples of com.dtrules.interpreter.RName

   * @see com.dtrules.admin.IRulesAdminService#createEntity(java.lang.String, java.lang.String)
     * @param rulesetname The name of the RuleSet in which to create this entity
     * @param EntityName  The name of the new Entity
   */
  public IREntity createEntity(String rulesetname, boolean readonly, String entityName) {
        RName    name = RName.getRName(entityName);
    IREntity e    = session.getEntityFactory().findRefEntity(name);
    if(e!=null)return null;
        try {
            return session.getEntityFactory().findcreateRefEntity(readonly, name);
        } catch (RulesException e1) {
View Full Code Here

Examples of com.dtrules.interpreter.RName

   * @see com.dtrules.admin.IRulesAdminService#getRulesets()
   */
  public List<String> getRulesets() {
    List<String> rulesets = new ArrayList<String>();
    for(Iterator it = rd.getRulesets().keySet().iterator(); it.hasNext();){
      RName name = (RName)it.next();
      rulesets.add(name.stringValue());
    }
    return rulesets;
  }
View Full Code Here

Examples of com.dtrules.interpreter.RName

       
        PrintStream  ps  = new PrintStream(out);
        Iterator<RName> tables = ef.getDecisionTableRNameIterator();
        ps.println("<decision_tables>");
        while(tables.hasNext()){
            RName dtname = tables.next();
            ef.getDecisionTable(dtname).writeXML(ps);
        }
        ps.println("\n</decision_tables>");
       
  }
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.