Skip to content

Commit

Permalink
ConceptDescription: use default name if idShort is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
tbischoff2 committed Feb 14, 2025
1 parent f5ca6f2 commit aa22597
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
*/
public class ConceptDescriptionCreator {

private static final String DEFAULT_NAME = "ConceptDescription";

/**
* Maps AAS references to dictionary entry types
*/
Expand Down Expand Up @@ -72,6 +74,7 @@ public static void addConceptDescriptions(List<ConceptDescription> descriptions,

nodeManager.addNodeAndReference(dictionariesFolder, dictEntriesFolder, Identifiers.Organizes);

int counter = 1;
for (ConceptDescription c: descriptions) {
String name = c.getIdShort();
DictionaryEntryType dictNode;
Expand All @@ -85,6 +88,7 @@ public static void addConceptDescriptions(List<ConceptDescription> descriptions,
}
else {
nid = nodeManager.getDefaultNodeId();
name = String.format("%s %s", DEFAULT_NAME, counter++);
}

AASConceptDescriptionType desriptionNode = nodeManager.createInstance(AASConceptDescriptionType.class, name, nid);
Expand Down

0 comments on commit aa22597

Please sign in to comment.