From 5aaf7f76c6632dcd4bea56b227648482ddde3a50 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Tue, 23 Oct 2018 12:02:27 -0400 Subject: Bug fixes October 23rd fixed the db status not being updated on delete SI added a default sequence flow to isAsync_Gateway Removed @Before and organized imports Added check to prevent db query with only requestStatus correct AAIObjectPlurals enum value name Correct rollbackData setting and protect against null Change-Id: Ic7c47dc968a29987c3d576da9aa50c7ddc8f28ee Issue-ID: SO-1162 Signed-off-by: Benjamin, Max (mb388a) --- .../DeleteGenericALaCarteServiceInstance.groovy | 6 +++-- .../scripts/DoCreateServiceInstance.groovy | 27 ++++++++++++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/groovy/org') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy index b43a96bdb0..ec2fed50c3 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy @@ -200,6 +200,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro try { String requestId = execution.getVariable("msoRequestId") + String serviceInstanceId = execution.getVariable("serviceInstanceId") String source = execution.getVariable("source") String msoCompletionRequest = """DELETE ${MsoUtils.xmlEscape(source)} - Service Instance was deleted successfully. - DeleteGenericALaCarteServiceInstance + Service Instance was deleted successfully. + ${MsoUtils.xmlEscape(serviceInstanceId)} + DeleteGenericALaCarteServiceInstance """ // Format Response diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy index 38836c3650..6d41923bdf 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy @@ -94,6 +94,12 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor { try { String requestId = execution.getVariable("msoRequestId") execution.setVariable("prefix", Prefix) + + def rollbackData = execution.getVariable("rollbackData") + if (rollbackData == null) { + rollbackData = new RollbackData() + } + execution.setVariable("rollbackData", rollbackData) setBasicDBAuthHeader(execution, isDebugEnabled) //Inputs @@ -409,7 +415,10 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor { throw e; } catch (Exception ex) { //start rollback set up - RollbackData rollbackData = new RollbackData() + def rollbackData = execution.getVariable("rollbackData") + if (rollbackData == null) { + rollbackData = new RollbackData() + } def disableRollback = execution.getVariable("disableRollback") rollbackData.put("SERVICEINSTANCE", "disableRollback", disableRollback.toString()) rollbackData.put("SERVICEINSTANCE", "rollbackAAI", "true") @@ -506,11 +515,13 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor { def sdncRequestId3 = UUID.randomUUID().toString() String sdncDeactivate = sdncDelete.replace(">delete<", ">deactivate<").replace(">${sdncRequestId2}<", ">${sdncRequestId3}<") def rollbackData = execution.getVariable("rollbackData") - rollbackData.put("SERVICEINSTANCE", "sdncDeactivate", sdncDeactivate) - rollbackData.put("SERVICEINSTANCE", "sdncDelete", sdncDelete) - execution.setVariable("rollbackData", rollbackData) + if (rollbackData != null) { + rollbackData.put("SERVICEINSTANCE", "sdncDeactivate", sdncDeactivate) + rollbackData.put("SERVICEINSTANCE", "sdncDelete", sdncDelete) + execution.setVariable("rollbackData", rollbackData) - msoLogger.debug("rollbackData:\n" + rollbackData.toString()) + msoLogger.debug("rollbackData:\n" + rollbackData.toString()) + } } catch (BpmnError e) { throw e; @@ -541,8 +552,10 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor { msoLogger.debug("Good response from SDNC Adapter for service-instance topology assign: \n" + response) def rollbackData = execution.getVariable("rollbackData") - rollbackData.put("SERVICEINSTANCE", "rollbackSDNC", "true") - execution.setVariable("rollbackData", rollbackData) + if (rollbackData != null) { + rollbackData.put("SERVICEINSTANCE", "rollbackSDNC", "true") + execution.setVariable("rollbackData", rollbackData) + } }else{ msoLogger.debug("Bad Response from SDNC Adapter for service-instance assign") -- cgit 1.2.3-korg