//System.out.println("modifiedKeyMap.size() ===========================> " + modifiedKeyMap.size());
//changed to let the variable/property values persist so that the history of data change can be stored
if(modifiedKeyMap.size() > 0)
getProcessVariableDAOFacade().deleteValue(getInstanceId(), modifiedKeyMap.keySet().iterator());
ProcessVariableDAO pvd = getProcessVariableDAOFacade().createProcessVariableDAOForBatchInsert();
for(Iterator iterator = modifiedKeyMap.keySet().iterator(); iterator.hasNext();){
String fullKey = (String)iterator.next();
String[] scopeAndKey = (String[])modifiedKeyMap.get(fullKey);
String scope = scopeAndKey[0];
String key = scopeAndKey[1];
boolean isProperty = isProperty(fullKey);
Serializable cachedValue = (isProperty ? this.getProperty(scope, key) : this.getSourceValue(scope, key));
if(cachedValue instanceof IndexedProcessVariableMap){
ProcessVariableValue multipleValue = (ProcessVariableValue)getMultiple(scope, key);
multipleValue.beforeFirst();
int i=0;
do{
setImpl(scope, key, multipleValue.getValue(), i, true, false, true, pvd, false);
i++;
}while(multipleValue.next());
}
else
setImpl(scope, key, cachedValue, 0, false, false, true, pvd, isProperty);
}
pvd.updateBatch();
}
mc.printElapsedTime(this);
setCaching(false);