[MSO-8] Update the maven dependency
[so.git] / bpmn / MSOCommonBPMN / src / main / groovy / org / openecomp / mso / bpmn / common / scripts / GenericGetService.groovy
  * ============LICENSE_END=========================================================
  */
 
-package com.att.bpm.scripts
+package org.openecomp.mso.bpmn.common.scripts
 
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.*
 
-import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution;
-import org.apache.commons.codec.binary.Base64
 import org.apache.commons.lang3.*
-
-import org.openecomp.mso.bpmn.core.WorkflowException
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.runtime.Execution
 import org.openecomp.mso.rest.APIResponse
-import org.openecomp.mso.rest.RESTClient
-import org.openecomp.mso.rest.RESTConfig
-
 import org.springframework.web.util.UriUtils
 
 
@@ -178,6 +172,8 @@ class GenericGetService extends AbstractServiceTaskProcessor{
                        AaiUtil aaiUriUtil = new AaiUtil(this)
                        String aai_uri = aaiUriUtil.getSearchNodesQueryEndpoint(execution)
                        String aai_endpoint = execution.getVariable("URN_aai_endpoint")
+                       
+                       utils.logAudit("GenericGetService AAI Endpoint: " + aai_endpoint)
                        String path = "${aai_uri}?search-node-type=service-instance&filter=service-instance-id:EQUALS:${serviceInstanceId}"
 
                        //String url = "${aai_endpoint}${path}"  host name needs to be removed from property
@@ -187,12 +183,13 @@ class GenericGetService extends AbstractServiceTaskProcessor{
                        APIResponse response = aaiUriUtil.executeAAIGetCall(execution, url)
                        int responseCode = response.getStatusCode()
                        execution.setVariable("GENGS_obtainSIUrlResponseCode", responseCode)
-                       utils.log("DEBUG", "  DELETE Service Instance response code is: " + responseCode, isDebugEnabled)
+                       utils.log("DEBUG", "  GET Service Instance response code is: " + responseCode, isDebugEnabled)
+                       utils.logAudit("GenericGetService AAI GET Response Code: " + responseCode)
 
                        String aaiResponse = response.getResponseBodyAsString()
                        aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
                        execution.setVariable("GENGS_obtainSIUrlResponse", aaiResponse)
-
+                       utils.logAudit("GenericGetService AAI Response: " + aaiResponse)
                        //Process Response
                        if(responseCode == 200){
                                utils.log("DEBUG", "  Query for Service Instance Url Received a Good Response Code", isDebugEnabled)
@@ -248,15 +245,17 @@ class GenericGetService extends AbstractServiceTaskProcessor{
                        String url = "${path}"
                        execution.setVariable("GENGS_obtainSIUrlPath", url)
 
+                       utils.logAudit("GenericGetService AAI Endpoint: " + aai_endpoint)
                        APIResponse response = aaiUriUtil.executeAAIGetCall(execution, url)
                        int responseCode = response.getStatusCode()
                        execution.setVariable("GENGS_obtainSIUrlResponseCode", responseCode)
-                       utils.log("DEBUG", "  DELETE Service Instance response code is: " + responseCode, isDebugEnabled)
-
+                       utils.log("DEBUG", "  GET Service Instance response code is: " + responseCode, isDebugEnabled)
+                       utils.logAudit("GenericGetService AAI Response Code: " + responseCode)
+                       
                        String aaiResponse = response.getResponseBodyAsString()
                        aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
                        execution.setVariable("GENGS_obtainSIUrlResponse", aaiResponse)
-
+                       utils.logAudit("GenericGetService AAI Response: " + aaiResponse) 
                        //Process Response
                        if(responseCode == 200){
                                utils.log("DEBUG", "  Query for Service Instance Url Received a Good Response Code", isDebugEnabled)
@@ -305,7 +304,8 @@ class GenericGetService extends AbstractServiceTaskProcessor{
                        AaiUtil aaiUriUtil = new AaiUtil(this)
                        String aai_endpoint = execution.getVariable("URN_aai_endpoint")
                        String serviceEndpoint = ""
-
+                       
+                       utils.logAudit("GenericGetService getServiceObject AAI Endpoint: " + aai_endpoint)
                        if(type.equalsIgnoreCase("service-instance")){
                                String siResourceLink = execution.getVariable("GENGS_siResourceLink")
                                if(isBlank(siResourceLink)){
@@ -340,11 +340,13 @@ class GenericGetService extends AbstractServiceTaskProcessor{
                        int responseCode = response.getStatusCode()
                        execution.setVariable("GENGS_getServiceResponseCode", responseCode)
                        utils.log("DEBUG", "  GET Service response code is: " + responseCode, isDebugEnabled)
-
+                       utils.logAudit("GenericGetService AAI Response Code: " + responseCode)
+                       
                        String aaiResponse = response.getResponseBodyAsString()
                        aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
                        execution.setVariable("GENGS_getServiceResponse", aaiResponse)
-
+                       utils.logAudit("GenericGetService AAI Response: " + aaiResponse)
+                       
                        //Process Response
                        if(responseCode == 200 || responseCode == 202){
                                utils.log("DEBUG", "GET Service Received a Good Response Code", isDebugEnabled)