aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java')
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java
index d5a87ad668..185316dad7 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/UnifiedCompositionService.java
@@ -2642,12 +2642,17 @@ public class UnifiedCompositionService {
String newNestedNodeTypeId,
ServiceTemplate globalSubstitutionServiceTemplate,
TranslationContext context) {
- Map<String, NodeType> nodeTypes = globalSubstitutionServiceTemplate.getNode_types();
- NodeType nested = DataModelUtil.getNodeType(globalSubstitutionServiceTemplate,
- origNestedNodeTypeId);
- setNewValuesForNestedNodeType(origNestedNodeTypeId, newNestedNodeTypeId, nested, nodeTypes);
- context.addUnifiedNestedNodeTypeId(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME,
- origNestedNodeTypeId, newNestedNodeTypeId);
+ Set<String> relatedNestedNodeTypeIds =
+ context.getAllRelatedNestedNodeTypeIds();
+
+ if(!relatedNestedNodeTypeIds.contains(origNestedNodeTypeId)) {
+ Map<String, NodeType> nodeTypes = globalSubstitutionServiceTemplate.getNode_types();
+ NodeType nested = DataModelUtil.getNodeType(globalSubstitutionServiceTemplate,
+ origNestedNodeTypeId);
+ setNewValuesForNestedNodeType(origNestedNodeTypeId, newNestedNodeTypeId, nested, nodeTypes);
+ context.addUnifiedNestedNodeTypeId(Constants.GLOBAL_SUBSTITUTION_TYPES_TEMPLATE_NAME,
+ origNestedNodeTypeId, newNestedNodeTypeId);
+ }
}
private void setNewValuesForNestedNodeType(String origNestedNodeType,