Package org.uengine.util

Examples of org.uengine.util.ForLoop


                try {

                  final Type deployOrNot = new Type("Select forms to deploy");
                  final Instance deployInstance = deployOrNot.createInstance();

                  new ForLoop(){

                    public void logic(Object target) {
                      OpenedForm openedForm = (OpenedForm) target;
                     
                      File file = new File(openedForm.localFilePath);
View Full Code Here


  public void createInsertSql() throws Exception{
    final StringBuffer sql_KeyNames = new StringBuffer();
    final StringBuffer sql_ValuePlaceHolders = new StringBuffer();
   
    if(rowSet==null){  // fetch ���� sql��: cache���� �Էµ� ���� ���뿡 ��� ������.
      ForLoop loopForCacheKeys = new ForLoop(){
        String sep = "";

        public void logic(Object target) {
          String propertyName = (String)target;
         
          sql_KeyNames.append(sep + propertyName);
          sql_ValuePlaceHolders.append(sep + "?" + propertyName);
         
          sep =", ";
        }
       
      };
     
      loopForCacheKeys.run(cache.keySet());
      sqlStmt = "insert into " + getTableName() + "("+ sql_KeyNames +") values (" + sql_ValuePlaceHolders + ")";

    }else{        // fetch ���� ��Ȱ��� dao�� insert�� ��Ÿ�����Ϳ��� ã�ƿͼ� ������
      String sep = "";
      ResultSetMetaData rsMetaData = rowSet.getMetaData();
View Full Code Here

    if(getTableName()==null || getKeyField()==null)
      throw new UEngineException("Although Update query is set to be build automatically, the table name or key field is not set.");
   
    if(rowSet==null){
     
      ForLoop loopForCacheKeys = new ForLoop(){
        String sep = "";

        public void logic(Object target) {
          String propertyName = (String)target;
         
          if(modifiedFieldMap!=null && !modifiedFieldMap.containsKey(propertyName)) return;

          sql_SetPairs.append(sep + propertyName + "=?" + propertyName);
         
          sep =", ";
        }
       
      };
     
      loopForCacheKeys.run(cache.keySet());
      sqlStmt = "update " + getTableName() + " set "+ sql_SetPairs +" where " + getKeyField() + "=?" + getKeyField();

    }else{        // fetch ���� ��Ȱ��� dao�� insert�� ��Ÿ�����Ϳ��� ã�ƿͼ� ������
      String sep = "";
      ResultSetMetaData rsMetaData = rowSet.getMetaData();
View Full Code Here

//      tl.beforeCommit(this);
//    }
   
    final TransactionContext tx = this;
   
    ForLoop beforeCommitLoop = new ForLoop(){

      public void logic(Object target) {
       
        TransactionListener tl = (TransactionListener)target;
        try {
          tl.beforeCommit(tx);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }       
      }     
    };
   
    beforeCommitLoop.run((ArrayList)transactionListeners);
  }
View Full Code Here

//      TransactionListener tl = (TransactionListener)iter.next();
//      tl.afterCommit(this);
//    }
    final TransactionContext tx = this;

    ForLoop afterCommitLoop = new ForLoop(){

      public void logic(Object target) {

        TransactionListener tl = (TransactionListener)target;
        try {
          tl.afterCommit(tx);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }       
      }     
    };
   
    afterCommitLoop.run((ArrayList)transactionListeners);
  }
View Full Code Here

//      tl.afterRollback(this);
//    }
   
    final TransactionContext tx = this;

    ForLoop afterRollBackLoop = new ForLoop(){

      public void logic(Object target) {

        TransactionListener tl = (TransactionListener)target;
        try {
          tl.afterRollback(tx);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }       
      }     
    };
   
    afterRollBackLoop.run((ArrayList)transactionListeners);
  }
View Full Code Here

//      tl.beforeRollback(this);
//    }
   
    final TransactionContext tx = this;

    ForLoop beforeRollBackLoop = new ForLoop(){

      public void logic(Object target) {

        TransactionListener tl = (TransactionListener)target;
        try {
          tl.beforeRollback(tx);
        } catch (Exception e) {
          throw new RuntimeException(e);
        }       
      }     
    };
   
    beforeRollBackLoop.run((ArrayList)transactionListeners);
   
  }
View Full Code Here

  transient Map processVariableChangesMap = new HashMap();
 
  public KeyedParameter[] getExtendedValues() {
   
    final ArrayList keyedParameters = new ArrayList();
    ForLoop forLoop = new ForLoop(){

      public void logic(Object target) {
        String key = (String)target;
        KeyedParameter kp = (KeyedParameter)extendedValuesMap.get(key);
        keyedParameters.add(kp);
      }
     
    };
   
    forLoop.run(extendedValuesMap.keySet());
   
    KeyedParameter[] keyedParametersArray = new KeyedParameter[keyedParameters.size()];
    keyedParameters.toArray(keyedParametersArray);
   
    return keyedParametersArray;
View Full Code Here

    return keyedParametersArray;
  }

  public KeyedParameter[] getProcessVariableChanges() {
    final ArrayList keyedParameters = new ArrayList();
    ForLoop forLoop = new ForLoop(){

      public void logic(Object target) {
        String key = (String)target;
        KeyedParameter kp = (KeyedParameter)processVariableChangesMap.get(key);
        keyedParameters.add(kp);
      }
     
    };
   
    forLoop.run(processVariableChangesMap.keySet());
   
    KeyedParameter[] keyedParametersArray = new KeyedParameter[keyedParameters.size()];
    keyedParameters.toArray(keyedParametersArray);
   
    return keyedParametersArray; 
View Full Code Here

        Method theSetter = getMethod(theClass,"set" + memberName);
        theSetter.invoke(objInstance, new Object[] { theMappingValue });       
      }
    }

    ForLoop assertingLoop = new ForLoop() {

      public void logic(Object target) {
        workingMemory.assertObject(target);
      }

    };

    assertingLoop.run(objects);

    // go!
    workingMemory.fireAllRules();

    // get the results
View Full Code Here

TOP

Related Classes of org.uengine.util.ForLoop

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.