boolean isInError = entryDelta.getDeltaState() == SystemEntryDelta.DeltaState.ERROR;
Map<String, Object> valueMap = new HashMap<String, Object>();
for(Map.Entry<String, SystemEntryValue> entry : entryDelta.getValues().entrySet())
{
SystemEntryValue sev = entry.getValue();
Object value = sev.getCurrentValue();
if(value == null || isInError)
{
if(sev.getExpectedValue() != null)
value = sev.getExpectedValue();
}
if(value instanceof Externable)
value = ((Externable) value).toExternalRepresentation();
valueMap.put(entry.getKey(), value);
}