aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2018-10-23 12:02:27 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2018-10-23 13:15:17 -0400
commit5aaf7f76c6632dcd4bea56b227648482ddde3a50 (patch)
treed96f2aa72c7774d7d87b6d2027cd46f1b44288fa /bpmn/so-bpmn-infrastructure-common/src
parentad99d2f0c59ce54e7283c210418d1f234191718b (diff)
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) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy6
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy27
2 files changed, 24 insertions, 9 deletions
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 =
"""<aetgt:MsoCompletionRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
@@ -209,8 +210,9 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
<action>DELETE</action>
<source>${MsoUtils.xmlEscape(source)}</source>
</request-info>
- <aetgt:status-message>Service Instance was deleted successfully.</aetgt:status-message>
- <aetgt:mso-bpel-name>DeleteGenericALaCarteServiceInstance</aetgt:mso-bpel-name>
+ <status-message>Service Instance was deleted successfully.</status-message>
+ <serviceInstanceId>${MsoUtils.xmlEscape(serviceInstanceId)}</serviceInstanceId>
+ <mso-bpel-name>DeleteGenericALaCarteServiceInstance</mso-bpel-name>
</aetgt:MsoCompletionRequest>"""
// 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")