Commit 1e4380d4 authored by Abdallah Atouani's avatar Abdallah Atouani

added priority for instance tags

parent a8f34881
Pipeline #154413 failed with stages
in 1 minute and 41 seconds
......@@ -345,18 +345,17 @@ public class EMADLGenerator {
protected String getDataPath(TaggingResolver taggingResolver, EMAComponentSymbol component, EMAComponentInstanceSymbol instance){
// instance tags have priority
List<TagSymbol> tags = (List<TagSymbol>) taggingResolver.getTags(instance, DataPathSymbol.KIND);
List<TagSymbol> comps = (List<TagSymbol>) taggingResolver.getTags(component, DataPathSymbol.KIND);
List<TagSymbol> instanceTags = (List<TagSymbol>) taggingResolver.getTags(instance, DataPathSymbol.KIND);
List<TagSymbol> tags = !instanceTags.isEmpty() ? instanceTags :
(List<TagSymbol>) taggingResolver.getTags(component, DataPathSymbol.KIND);
tags.addAll(comps);
String dataPath;
if (tags.isEmpty()) {
DataPathConfigParser newParserConfig = new DataPathConfigParser(getModelsPath() + "data_paths.txt");
dataPath = newParserConfig.getDataPath(component.getFullName());
if (!tags.isEmpty()) {
dataPath = (String) tags.get(0).getValues().get(0);
}
else {
// values for data path tags are not optional, therefore always present if tag is present
dataPath = (String) tags.get(0).getValues().get(0);
DataPathConfigParser newParserConfig = new DataPathConfigParser(getModelsPath() + "data_paths.txt");
dataPath = newParserConfig.getDataPath(component.getFullName());
}
return dataPath;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment