diff options
author | katy.rotman <katy.rotman@amdocs.com> | 2017-09-12 11:03:25 +0300 |
---|---|---|
committer | katy.rotman <katy.rotman@amdocs.com> | 2017-09-12 11:23:28 +0300 |
commit | 2804abfedc485ea8f15ff276fe3c8381f9997209 (patch) | |
tree | 93bbdfe7e611743ddf757086e1db5dff3b21b2d4 /openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java | |
parent | 82d454fd3e8c9fdf66517d01a99019a379dbfdb6 (diff) |
Fixed component display name retrieval for nested
Change-Id: I77d9f2755d55a03d969c8f85d2b1a4b0ba9b306f
Issue-ID: SDC-311
Signed-off-by: katy.rotman <katy.rotman@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java')
-rw-r--r-- | openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java index 32df165eb3..a7762e86ca 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/AbstractSubstituteToscaEnricher.java @@ -77,7 +77,7 @@ public class AbstractSubstituteToscaEnricher { if (toscaAnalyzerService.isTypeOf(nodeTemplate, VFC_ABSTRACT_SUBSTITUTE, serviceTemplate, toscaModel)) { - String componentDisplayName = getComponentDisplayName(nodeTemplateId); + String componentDisplayName = getComponentDisplayName(nodeTemplateId, nodeTemplate); setProperty(nodeTemplate, VM_TYPE_TAG, componentDisplayName); @@ -157,7 +157,7 @@ public class AbstractSubstituteToscaEnricher { if (toscaAnalyzerService.isTypeOf(nodeTemplate, VFC_ABSTRACT_SUBSTITUTE, serviceTemplate, toscaModel)) { - String componentDisplayName = getComponentDisplayName(nodeTemplateId); + String componentDisplayName = getComponentDisplayName(nodeTemplateId, nodeTemplate); if (componentDisplayNameToNodeTempalteIds.containsKey(componentDisplayName)) { componentDisplayNameToNodeTempalteIds.get(componentDisplayName).add(nodeTemplateId); @@ -206,12 +206,17 @@ public class AbstractSubstituteToscaEnricher { nodeTemplate.setRequirements(requirements); } - private String getComponentDisplayName(String nodeTemplateId ) { + private String getComponentDisplayName(String nodeTemplateId, NodeTemplate nodeTemplate) { String componentDisplayName = null; if (nodeTemplateId.contains(ABSTRACT_NODE_TEMPLATE_ID_PREFIX)) { String removedPrefix = nodeTemplateId.split(ABSTRACT_NODE_TEMPLATE_ID_PREFIX)[1]; final String[] removedSuffix = removedPrefix.split("_\\d"); componentDisplayName = removedSuffix[0]; + } else { + final String type = nodeTemplate.getType(); + final String[] splitted = type.split("\\."); + componentDisplayName = splitted[splitted.length - 1]; + } return componentDisplayName; } |