* @param value
* the measured value
* @return a measurement
*/
private Measurement createMeasurement(String measureId, Object value) {
Measurement measurement = null;
String measureUri = T2FlowExecutablePlanGenerator.guessMeasureUrl(measureId);
if (measureUri != null) {
Measure measure = cm.getMeasure(measureUri);
if (measure != null) {
Value v = measure.getScale().createValue();
try {
v.parse(value.toString());
// The measurement value does not need a scale
v.setScale(null);
measurement = new Measurement();
measurement.setMeasureId(measureUri);
measurement.setValue(v);
} catch (Exception e) {
// Catch parsing exceptions
log.debug("Error parsing measure value", e);
}
}