From 4d97d5fac309ce0d66938e5ccd0349e2660d4e23 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sat, 17 Jun 2017 22:40:44 +0300 Subject: [sdc] update code of sdc Change-Id: If9f37c80b659cb67b34d18e6c019defecca58b9a Signed-off-by: Michael Lando --- .../convertors/VspInformationConvertor.java | 37 +++++++++++++++++----- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'openecomp-be/tools/migration') diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspInformationConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspInformationConvertor.java index b7a1d42386..59fba5f066 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspInformationConvertor.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspInformationConvertor.java @@ -55,13 +55,21 @@ public class VspInformationConvertor { public static CollaborationElement[] convertVspToElement(VspInformation vspInformation) { - CollaborationElement[] vspElements = new CollaborationElement[4]; + CollaborationElement[] vspElements; + if(vspInformation.getQuestionnaireData() == null){ + vspElements = new CollaborationElement[4]; + }else{ + vspElements = new CollaborationElement[5]; + } + + int index=0; + List vspNamespace = getVspNamespace(vspInformation); String vspEntityId = StructureElement.General.name(); - vspElements[0] = ElementHandler.getElementEntity( + vspElements[index] = ElementHandler.getElementEntity( vspInformation.getId(), vspInformation.getVersion().toString(), vspEntityId, vspNamespace, @@ -70,8 +78,9 @@ public class VspInformationConvertor { null, null); + index++; String vspOrchestrationTemplateEntityId = StructureElement.OrchestrationTemplate.name(); - vspElements[1] = ElementHandler.getElementEntity( + vspElements[index] = ElementHandler.getElementEntity( vspInformation.getId(), vspInformation.getVersion().toString(), vspOrchestrationTemplateEntityId, vspNamespace, @@ -80,11 +89,23 @@ public class VspInformationConvertor { null, null); - + if(vspInformation.getQuestionnaireData()!= null) { + index++; + String vspQuestionnaireEntityId = StructureElement.Questionnaire.name(); + vspElements[index] = ElementHandler.getElementEntity( + vspInformation.getId(), vspInformation.getVersion().toString(), + vspQuestionnaireEntityId, + vspNamespace, + ElementHandler.getStructuralElementInfo(vspQuestionnaireEntityId), + null, + null, + vspInformation.getQuestionnaireData().getBytes() != null ? vspInformation + .getQuestionnaireData().getBytes() : null); + } vspNamespace.add(vspOrchestrationTemplateEntityId); - + index++; String vspOrchestrationTemplateValidationDataEntityId = StructureElement.OrchestrationTemplateValidationData.name(); - vspElements[2] = ElementHandler.getElementEntity( + vspElements[index] = ElementHandler.getElementEntity( vspInformation.getId(), vspInformation.getVersion().toString(), vspOrchestrationTemplateValidationDataEntityId, vspNamespace, @@ -93,9 +114,9 @@ public class VspInformationConvertor { null, vspInformation.getValidationData()!= null?vspInformation.getValidationData().getBytes() :null); - + index++; String vspOrchestrationTemplateContentEntityId = StructureElement.OrchestrationTemplateContent.name(); - vspElements[3] = ElementHandler.getElementEntity( + vspElements[index] = ElementHandler.getElementEntity( vspInformation.getId(), vspInformation.getVersion().toString(), vspOrchestrationTemplateContentEntityId, vspNamespace, -- cgit 1.2.3-korg