MeasurementSchedule schedule = obtainSchedule(scheduleId, false, DataType.TRAIT);
List<MeasurementDataTrait> traits = dataManager.findTraits(caller,schedule.getResource().getId(),schedule.getDefinition().getId());
Response.ResponseBuilder builder;
if (traits!=null && traits.size()>0) {
builder = Response.ok();
StringValue value = new StringValue(traits.get(0).getValue());
builder.entity(value);
} else {
builder = Response.status(Response.Status.NOT_FOUND);
}