logger.trace("mapItem: " + mapItem);
// split item into key/value
String[] kv = mapItem.split(":", 2);
if(kv.length != 2) {
alertService.addAlert(new Alert(Alert.Type.WARN, getName() + ": " + od.getStringValue(), Messages
.getString("calculators.object.map.calculation_error.map_error.text")
+ ": " + mapItem));
continue;
}
try {
valueMap.put(kv[0].trim(), kv[1].trim());
}
catch(Exception e) {
logger.warn("Exception caught while processing map for calculation: " + e.getLocalizedMessage());
alertService.addAlert(new Alert(Alert.Type.WARN, getName() + ": " + od.getStringValue(), Messages
.getString("calculators.object.map.calculation_error.map_key_value_error.text")
+ ": " + mapItem));
continue;
}
}
if(inputValues.isEmpty()) {
alertService.addAlert(new Alert(Alert.Type.WARN, getName() + ": " + od.getStringValue(), Messages
.getString("calculators.object.map.calculation_error.no_input_values.text")
+ ": " + op.getName()));
return;
}
String inputName = inputValues.get(0);
logger.trace("inputName: " + inputName);
String value = valueMap.get(inputName);
logger.trace("value: " + value);
if(StringUtils.stripToNull(value) == null) {
alertService.addAlert(new Alert(Alert.Type.WARN, getName() + ": " + od.getStringValue(), Messages
.getString("calculators.object.map.calculation_error.map_key_not_found.text")
+ ": " + value));
return;
}