summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN
diff options
context:
space:
mode:
Diffstat (limited to 'bpmn/MSOCommonBPMN')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy22
1 files changed, 10 insertions, 12 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy
index 6691a82352..354ece9e63 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy
@@ -174,14 +174,12 @@ public class UpdateAAIVfModule extends AbstractServiceTaskProcessor {
personaModelVersionEntry = updateVfModuleNode(origRequest, 'persona-model-version')
}
String contrailServiceInstanceFqdnEntry = updateVfModuleNode(origRequest, 'contrail-service-instance-fqdn')
- def payload = """
- { ${orchestrationStatusEntry}
- ${heatStackIdEntry}
- ${personaModelVersionEntry}
- ${contrailServiceInstanceFqdnEntry}
- "vf-module-id": "${vfModuleId}"
- }
- """
+ org.onap.aai.domain.yang.VfModule payload = new org.onap.aai.domain.yang.VfModule();
+ payload.setVfModuleId(vfModuleId)
+ payload.setOrchestrationStatus(orchestrationStatusEntry)
+ payload.setHeatStackId(heatStackIdEntry)
+ payload.setPersonaModelVersion(personaModelVersionEntry)
+ payload.setContrailServiceInstanceFqdn(contrailServiceInstanceFqdnEntry)
try {
AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId)
@@ -210,16 +208,16 @@ public class UpdateAAIVfModule extends AbstractServiceTaskProcessor {
private String updateVfModuleNode(String origRequest, String elementName) {
if (!utils.nodeExists(origRequest, elementName)) {
- return ""
+ return null
}
def elementValue = utils.getNodeText(origRequest, elementName)
if (elementValue.equals('DELETE')) {
- // Set the element being deleted to null
- return """"${elementName}": null,"""
+ // Set the element being deleted to empty string
+ return ""
}
else {
- return """"${elementName}": "${elementValue}","""
+ return elementValue
}
}