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<String> vspNamespace = getVspNamespace(vspInformation);
String vspEntityId = StructureElement.General.name();
- vspElements[0] = ElementHandler.getElementEntity(
+ vspElements[index] = ElementHandler.getElementEntity(
vspInformation.getId(), vspInformation.getVersion().toString(),
vspEntityId,
vspNamespace,
null,
null);
+ index++;
String vspOrchestrationTemplateEntityId = StructureElement.OrchestrationTemplate.name();
- vspElements[1] = ElementHandler.getElementEntity(
+ vspElements[index] = ElementHandler.getElementEntity(
vspInformation.getId(), vspInformation.getVersion().toString(),
vspOrchestrationTemplateEntityId,
vspNamespace,
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,
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,