if (resource != null) {
for (MeasurementDefinition definition : dataDefinitions) {
MeasurementSchedule schedule = scheduleManager.getSchedule(subject, resource.getId(), definition
.getId(), false);
RelatedOptionBean rob = new RelatedOptionBean(definition.getName(), String.valueOf(definition.getId()),
getBaselineList(schedule));
baselines.add(rob);
setDisabledName(schedule, definition);
}
for (MeasurementDefinition definition : traitDefinitions) {
MeasurementSchedule schedule = scheduleManager.getSchedule(subject, resource.getId(), definition
.getId(), false);
setDisabledName(schedule, definition);
}
} else {
List<LabelValueBean> defaultBaselineLabels = getBaselineList(null);
for (MeasurementDefinition definition : dataDefinitions) {
RelatedOptionBean rob = new RelatedOptionBean(definition.getName(), String.valueOf(definition.getId()),
defaultBaselineLabels);
baselines.add(rob);
}
}