for (Entry<String, Object> attr : entity.getAttributes().entrySet()) {
String attrName = attr.getKey();
Object attrValue = attr.getValue();
// resolve aliases
InitPropertyMetaData prop = null;
if (entity.metadata != null) {
prop = entity.metadata.getProperty(attrName);
if (prop != null) {
attrName = prop.getName();
}
}
ProcessProperty property = new ProcessProperty(entity, prop, attrName, attrValue, null);
property.value = getAttributeValue(property);
entity.properties.put(attrName, property);
}
// check for unset defaults
if (entity.metadata != null) {
for (InitPropertyMetaData prop : entity.metadata.getProperties()) {
String attrName = prop.getName();
if (!entity.properties.containsKey(attrName) && prop.getDefaultValue() != null) {
ProcessProperty property = new ProcessProperty(entity, prop, attrName, prop.getDefaultValue(), null);
property.value = getAttributeValue(property);
entity.properties.put(attrName, property);
}
}
}