1710 Rebase - Second Attempt
[so.git] / bpmn / MSOInfrastructureBPMN / src / main / groovy / org / openecomp / mso / bpmn / infrastructure / scripts / UpdateNetworkInstance.groovy
index 68b0e58..c1a32c7 100644 (file)
@@ -102,7 +102,6 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
                            utils.log("DEBUG", " 'disableRollback' : " + execution.getVariable("disableRollback") , isDebugEnabled)
                        }
 
-                       // get/set 'msoRequestId' and 'mso-request-id'
                        String requestId = execution.getVariable("msoRequestId")
                        if (requestId != null) {
                                execution.setVariable("mso-request-id", requestId)
@@ -184,15 +183,12 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
 
                try {
 
-                       // "networkModelInfo" is expected to be sent
-                       String networkModelInfo = execution.getVariable("networkModelInfo")
-                       utils.log("DEBUG", " networkModelInfo - " + networkModelInfo, isDebugEnabled)
-
-                       // "serviceModelInfo" is expected to be sent
-                       String serviceModelInfo = execution.getVariable("serviceModelInfo")
-                       utils.log("DEBUG", " serviceModelInfo - " + serviceModelInfo, isDebugEnabled)
-
-
+                       // For Ala-Carte (sdnc = 1610): 
+                       // 1. the Network ModelInfo is expected to be sent 
+                       //     via requestDetails.modelInfo (modelType = network), ex: modelCustomizationId
+                       // 2. the Service ModelInfo is expected to be sent but will be IGNORE 
+                       //     via requestDetails.relatedInstanceList.relatedInstance.modelInfo (modelType = service)
+                       
                } catch (Exception ex) {
                        sendSyncError(execution)
                   String exceptionMessage = "Bpmn error encountered in UpdateNetworkInstance flow. getNetworkModelInfo() - " + ex.getMessage()
@@ -233,6 +229,9 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
                try {
                        utils.log("DEBUG", " ***** Inside prepareDBRequestError() of UpdateNetworkInstance ***** ", isDebugEnabled)
 
+                       // set DB Header Authorization
+                       setBasicDBAuthHeader(execution, isDebugEnabled)
+                               
                        String statusMessage = ""
                        WorkflowException wfe = null
                        if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
@@ -378,12 +377,16 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
                execution.setVariable("prefix", Prefix)
 
+               utils.log("DEBUG", "DB updateInfraRequest ResponseCode: " + execution.getVariable(Prefix + "dbReturnCode"), isDebugEnabled)
+               utils.log("DEBUG", "DB updateInfraRequest Response: " + execution.getVariable(Prefix + "createDBResponse"), isDebugEnabled)
+               
                utils.log("DEBUG", " ***** Prepare for FalloutHandler. FAILURE - prepare request for sub-process FalloutHandler. *****", isDebugEnabled)
-
+               
                String falloutHandlerRequest = ""
                String requestId = execution.getVariable("mso-request-id")
 
                try {
+                       
                        WorkflowException wfe = execution.getVariable("WorkflowException")
                        String errorCode = String.valueOf(wfe.getErrorCode())
                        String errorMessage = wfe.getErrorMessage()
@@ -407,8 +410,8 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor {
                        utils.log("DEBUG", "  Overall Error Response going to FalloutHandler: " + "\n" + falloutHandlerRequest, isDebugEnabled)
 
                } catch (Exception ex) {
-                       String errorException = "  Bpmn error encountered in UpdateNetworkInstance flow. FalloutHandlerRequest,  buildErrorResponse() - " + ex.getMessage()
-                       utils.log("DEBUG", errorException, isDebugEnabled)
+                       String errorException = "  Bpmn error encountered in UpdateNetworkInstance flow. FalloutHandlerRequest,  buildErrorResponse() - "
+                       utils.log("DEBUG", "Exception error in UpdateNetworkInstance flow,  buildErrorResponse(): " +  ex.getMessage(), isDebugEnabled)
                        falloutHandlerRequest =
                        """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
                                                                     xmlns:ns="http://org.openecomp/mso/request/types/v1"