Object oldValue = null;
if (targetName != null) {
setterTarget = TriggerBase.getElementByName(element, targetName);
}
IMetaclass metaclass = XWT.getMetaclass(setterTarget);
IProperty prop = metaclass.findProperty(propName);
if (prop != null && propValue != null) {
Object toValue = XWT.convertFrom(prop.getType(), propValue);
try {
oldValue = prop.getValue(setterTarget);
if (update) {
prop.setValue(setterTarget, toValue);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}