Package org.uengine.kernel

Examples of org.uengine.kernel.ProcessVariableValue


          if (value instanceof String) {
            instance.set("", key, (String) value);

          } else if (value instanceof ArrayList) {
            ArrayList items = (ArrayList) value;
            ProcessVariableValue pvv = new ProcessVariableValue();
            for (int i = 0; i < items.size(); i++) {
              Object item = (Object) items.get(i);
              if (item instanceof String) {
                pvv.setValue(item);
                if (i != items.size() - 1)
                  pvv.moveToAdd();
              }
            }
            instance.set("", key, (ProcessVariableValue) pvv);
          }
        }
View Full Code Here


       
        roleMapping.setCursor(index);
       
        multiValue = new Object[]{roleMapping.getCurrentRoleMapping()};
      } else if (multiValue[0] instanceof ProcessVariableValue) {
        ProcessVariableValue processVariableValue = (ProcessVariableValue)multiValue[0];
        if(processVariableValue.size() <= index)
          index = processVariableValue.size()-1;
       
        processVariableValue.setCursor(index);
       
        multiValue = new Object[] {processVariableValue.getValue()};
       
      } else { //case of indexed by array
        if(multiValue.length <= index) index = multiValue.length -1;
          multiValue = new Object[]{multiValue[index]};
      }
View Full Code Here

        ProcessDefinition definition = instance.getProcessDefinition();
        ProcessVariable variable = definition.getProcessVariable(varKey);
       
        if(variable == null) throw new UEngineException("Undeclared process variable reference : " + varKey);
       
        ProcessVariableValue theValue = definition.getProcessVariable(varKey).getMultiple(instance, scope);
       
        //ProcessVariableValue theValue = instance.getMultiple(scope, varKey);
        theValue.beforeFirst();
        if(theValue.size()==1)
          return theValue.getValue();
        else
          return theValue;
      }else{
        return instance.get(scope, varKey);
      }
View Full Code Here

    if(valueMap==null){
      loadValueMap();
    }
    //if there is XML value for this entry, use it first.   
    ProcessVariableValue pvv = new ProcessVariableValue();
    int arrayLv = 0;
    for(int i=0 ; i < valueMap.size();i++){
      String arrTag = (i==0 ? "":"["+(i-1)+"]");
      if(fieldName.indexOf('[')>-1) {
        fieldName = fieldName.substring(0,fieldName.indexOf('['));
      }
      ifi > 0 &&
        (
            valueMap.containsKey(fieldName+XML_VALUE_TAG+"[]")
          || valueMap.containsKey(fieldName+"[]"+XML_VALUE_TAG)
          || valueMap.containsKey(fieldName+"[]")
        )
      )  arrayLv=1;
      ifi > 0 &&
          (
              valueMap.containsKey(fieldName+XML_VALUE_TAG+"[][]")
            || valueMap.containsKey(fieldName+"[][]"+XML_VALUE_TAG)
            || valueMap.containsKey(fieldName+"[][]")
          )
      )  arrayLv=2;
     
      //if(arrayLv == 0) continue;
     
      if(arrayLv > 1){
        ProcessVariableValue innerPvv = new ProcessVariableValue();
       
        for(int j=0 ; j < valueMap.size() ; j++){
            String addArrTag = "";
          if(j > 0){
            addArrTag = arrTag +"["+(j-1)+"]";
          }else{
            addArrTag = arrTag;
          }

          value = getFindFieldValue(fieldName , addArrTag);
         
          if(value!=null){
            innerPvv.setValue(value);
            innerPvv.moveToAdd();
            value=null;
          }
        }
        innerPvv.beforeFirst();
        if(innerPvv!=null && innerPvv.getValue() !=null){
          pvv.setValue(innerPvv);
          pvv.moveToAdd();
          innerPvv=null;
        }
      }else {
View Full Code Here

      if (variable == null)
        throw new UEngineException(
            "Undeclared process variable reference : " + key);

      ProcessVariableValue theValue = pdRemote.getProcessVariable(key)
          .getMultiple(piRemote, "");

      theValue.beforeFirst();
      if (theValue.size() == 1)
        retObj = theValue.getValue();
      else
        retObj = theValue;
    }

    return retObj;
View Full Code Here

    ProcessVariableDAO processVariable = createDAOImpl(getValue_SQL);
    processVariable.setInstId(new Long(instanceId));
    processVariable.setKeyString(scopeByTracingTag + ":" + key);
    processVariable.select();
       
    ProcessVariableValue pvv = new ProcessVariableValue();
    pvv.setName(key);
   
    while(processVariable.next()){
      Serializable value = getDeserializedValue(processVariable, key, TYPE_AUTODETECT);
      pvv.setValue(value);
      pvv.moveToAdd();
    }

    pvv.beforeFirst();
   
    return pvv;
  }
View Full Code Here

        }else
        if(argumentSource instanceof String){
          Object parameter = instance.getBeanProperty((String)argumentSource);
         
          if(parameter instanceof ProcessVariableValue){
            ProcessVariableValue pvv = ((ProcessVariableValue)parameter);
            if(maxNumberOfParameterValues < pvv.size()) maxNumberOfParameterValues = pvv.size();
          }else
 
          if(parameter instanceof RoleMapping){
            RoleMapping rm = ((RoleMapping)parameter);
            if(maxNumberOfParameterValues < rm.size()) maxNumberOfParameterValues = rm.size();
          }
         
          parameters.put(inputArguments[i], parameter);
        }
      }
    }

    /**
     * if the in-parameter has value more than one, it should let transformers run with each values.
     */
    if(maxNumberOfParameterValues>1){
      ProcessVariableValue result = new ProcessVariableValue();
      for(int i=0; i<maxNumberOfParameterValues; i++){
        HashMap unitParameters = new HashMap();

        for(int j=0; j<inputArguments.length; j++){
          Object parameter = parameters.get(inputArguments[j]);
          if(parameter instanceof ProcessVariableValue){
            int valuePos = i;
           
            ProcessVariableValue pvv = ((ProcessVariableValue)parameter);
            if(valuePos >= pvv.size()) valuePos = pvv.size()-1;
            pvv.setCursor(valuePos);
           
            parameter = pvv.getValue();
          }else

          if(parameter instanceof RoleMapping){
            int valuePos = i;
           
View Full Code Here

        return (Serializable)dao.get(getFieldName());
    }catch(Exception e){
      return (Serializable)dao.get(getFieldName());
    }

    ProcessVariableValue pvv = new ProcessVariableValue();
    do{
      pvv.setValue((Serializable)dao.get(getFieldName()));
      pvv.moveToAdd();
    }while(dao.next());
        pvv.beforeFirst();

        return pvv;
  }
View Full Code Here

      Serializable val = null;
     
      if (values.size() == 1) {
        val = values.get(0);
      } else {
        ProcessVariableValue pvv = new ProcessVariableValue();
        for (String value : values) {
          pvv.setValue(value);
          pvv.moveToAdd();
        }
        pvv.beforeFirst();
        val = pvv;
      }
     
      instance.set("", pv.getName(), val);
    }
View Full Code Here

TOP

Related Classes of org.uengine.kernel.ProcessVariableValue

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.