This fixes problems where subscription item data CSV export used the
wrong data files to read the data related to the subscription item
because it wasn't matching the data file based on both groupItemId
(subscription item GUID name) and variable ID, which can be overlapping
if a new subscription item is created for a variable that has had a
previous subscription.
gitlab #528
Change-Id: If1ddef78e4b152cf6721f82afc21b37ec5fbb074
(cherry picked from commit
b141f43453a9078e2cf77302bc43c646e72c98fe)
for (TrendItem i : t.spec.items) {
if (i.hidden) continue;
- List<Bean> items = im.search("variableId", i.variableId);
+ List<Bean> items = im.search("groupItemId", i.groupItemId, "variableId", i.variableId);
Collections.sort(items, SamplingFormat.INTERVAL_COMPARATOR);
if (items.isEmpty()) continue;
Bean config = items.get(0);
labelBuilder.append(")");
}
- List<Bean> historyItems = im.search("variableId", item.variableReference);
+ List<Bean> historyItems = im.search("groupItemId", item.groupItemId, "variableId", item.variableReference);
Collections.sort(historyItems, SamplingFormat.INTERVAL_COMPARATOR);
if (items.isEmpty()) continue;
Bean config = historyItems.get(0);
// Resource experiment = graph.syncRequest(new PossibleExperiment(subscriptionItem));
// String runIdentifier = ""; // experiment.getIdentifier();
-
+
+ item.groupItemId = graph.getPossibleRelatedValue(subscriptionItem, L0.HasName, Bindings.STRING);
+ if (item.groupItemId == null) continue;
+
item.variableReference = rvi.toPossibleString(graph, configuration);
if (item.variableReference == null) continue;
public static class CSVItem {
public String modelUri;
public String label;
+ public String groupItemId;
public String variableReference;
public String unit;
}
labelBuilder.append(")");
}
- List<Bean> historyItems = im.search("variableId", item.variableReference);
+ List<Bean> historyItems = im.search("groupItemId", item.groupItemId, "variableId", item.variableReference);
Collections.sort(historyItems, SamplingFormat.INTERVAL_COMPARATOR);
if (items.isEmpty()) continue;
Bean config = historyItems.get(0);