diff options
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/groovy')
39 files changed, 367 insertions, 74 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy index 19fe018e13..d588da38b0 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy @@ -416,7 +416,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor { } catch (Exception ex) { String errorException = " Bpmn error encountered in CreateNetworkInstance flow. FalloutHandlerRequest, buildErrorResponse()" - logger.debug("Exception error in CreateNetworkInstance flow, buildErrorResponse(): " + ex.getMessage()) + logger.debug("Exception error in CreateNetworkInstance flow, buildErrorResponse(): {}", ex.getMessage(), ex) falloutHandlerRequest = """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1" xmlns:ns="http://org.onap/so/request/types/v1" diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy index bb2116acb9..65fa0511ac 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy @@ -441,7 +441,6 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { } String sndcTopologyCreateRequesAsString = utils.formatXml(sdncTopologyCreateRequest) - utils.logAudit(sndcTopologyCreateRequesAsString) execution.setVariable("sdncAdapterWorkflowRequest", sndcTopologyCreateRequesAsString) logger.debug("sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyCreateRequesAsString) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy index 712512fdc9..fa9fe62df4 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy @@ -268,7 +268,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor { */ public void validateWorkflowResponse(DelegateExecution execution, String responseVar, String responseCodeVar, String errorResponseVar) { - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, responseVar, responseCodeVar, errorResponseVar) } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy index c0e8d5a6ba..e941d50155 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateVnfInfra.groovy @@ -349,7 +349,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor { logger.debug("workflowException: " + workflowException) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) logger.debug("SDNCResponse: " + response) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy index ccdb5d77cd..4233147f83 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy @@ -328,7 +328,6 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor } String sdncTopologyDeleteRequesAsString = utils.formatXml(sdncTopologyDeleteRequest) - utils.logAudit(sdncTopologyDeleteRequesAsString) execution.setVariable("sdncAdapterWorkflowRequest", sdncTopologyDeleteRequesAsString) logger.info("sdncAdapterWorkflowRequest - " + "\n" + sdncTopologyDeleteRequesAsString) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy index 0dc86632e2..20134a77a9 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy @@ -354,7 +354,6 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor { } String sdncTopologyDeleteRequesAsString = utils.formatXml(sdncTopologyDeleteRequest) - utils.logAudit(sdncTopologyDeleteRequesAsString) execution.setVariable("sdncAdapterWorkflowRequest", sdncTopologyDeleteRequesAsString) logger.info("sdncAdapterWorkflowRequest - " + "\n" + sdncTopologyDeleteRequesAsString) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy index ccd9f9bd02..cf53aff878 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy @@ -68,6 +68,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor { execution.setVariable('DELVfModVol_vnfType', null) execution.setVariable('DELVfModVol_serviceId', null) execution.setVariable('DELVfModVol_cloudRegion', null) + execution.setVariable('DELVfModVol_cloudOwner', null) execution.setVariable('DELVfModVol_tenantId', null) execution.setVariable('DELVfModVol_volumeParams', null) execution.setVariable('DELVfModVol_volumeGroupHeatStackId', null) @@ -141,6 +142,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor { execution.setVariable('DELVfModVol_volumeOutputs', utils.getNodeXml(request, 'volume-outputs', false)) execution.setVariable('DELVfModVol_volumeParams', utils.getNodeXml(request, 'volume-params')) execution.setVariable('DELVfModVol_cloudRegion', utils.getNodeText(request, 'aic-cloud-region')) + execution.setVariable('DELVfModVol_cloudOwner', utils.getNodeText(request, 'cloud-owner')) setBasicDBAuthHeader(execution, isDebugLogEnabled) @@ -308,6 +310,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor { public void prepareVnfAdapterDeleteRequest(DelegateExecution execution, isDebugLogEnabled) { def cloudRegion = execution.getVariable('DELVfModVol_cloudRegion') + def cloudOwner = execution.getVariable('DELVfModVol_cloudOwner') def tenantId = execution.getVariable('DELVfModVol_tenantId') def volumeGroupId = execution.getVariable('DELVfModVol_volumeGroupId') def volumeGroupHeatStackId = execution.getVariable('DELVfModVol_volumeGroupHeatStackId') @@ -324,6 +327,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor { String vnfAdapterRestRequest = """ <deleteVolumeGroupRequest> <cloudSiteId>${MsoUtils.xmlEscape(cloudRegion)}</cloudSiteId> + <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner> <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId> <volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId> <volumeGroupStackId>${MsoUtils.xmlEscape(volumeGroupHeatStackId)}</volumeGroupStackId> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceData.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceData.groovy new file mode 100644 index 0000000000..a1f68f9b06 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareServiceInstanceData.groovy @@ -0,0 +1,270 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.bpmn.infrastructure.scripts + +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.aai.domain.yang.ServiceInstance +import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.onap.so.bpmn.common.scripts.ExceptionUtil +import org.onap.so.bpmn.core.domain.Resource +import org.onap.so.bpmn.core.domain.ServiceDecomposition +import org.onap.so.bpmn.core.json.JsonUtils +import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory +import org.slf4j.Logger +import org.slf4j.LoggerFactory +/** + * This groovy class supports the <class>DoCompareServiceInstanceData.bpmn</class> process. + * + * Inputs: + * @param - serviceInstanceData-original + * @param - serviceInstanceId + * @param - uuiRequest + * @param - model-invariant-id-original + * @param - model-version-id-original + * @param - msoRequestId + * @param - isDebugLogEnabled + * + * Outputs: + * @param - addResourceList + * @param - delResourceList + * @param - uuiRequest-add + * @param - uuiRequest-del + * + */ +public class DoCompareServiceInstanceData extends AbstractServiceTaskProcessor { + + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + private static final Logger logger = LoggerFactory.getLogger( DoCompareServiceInstanceData.class); + + public void preProcessRequest (DelegateExecution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + logger.info("INFO"," ***** preProcessRequest *****", isDebugEnabled) + try { + checkInput("serviceInstanceData-original", execution, isDebugEnabled) + checkInput("serviceInstanceId", execution, isDebugEnabled) + checkInput("uuiRequest", execution, isDebugEnabled) + checkInput("model-invariant-id-original", execution, isDebugEnabled) + checkInput("model-version-id-original", execution, isDebugEnabled) + checkInput("msoRequestId", execution, isDebugEnabled) + } catch (Exception ex){ + String msg = "Exception in preProcessRequest " + ex.getMessage() + logger.info("INFO", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + logger.info("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled) + } + + private void checkInput(String inputName, DelegateExecution execution, isDebugEnabled) { + String msg + Object inputValue = execution.getVariable(inputName) + if (inputValue == null) { + msg = "Input" + inputName + "is null" + logger.info("INFO", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } + } + + + public void prepareDecomposeService_Original(DelegateExecution execution) { + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + + try { + logger.debug( " ***** Inside prepareDecomposeService_Original of update generic e2e service ***** ") + String modelInvariantUuid = execution.getVariable("model-invariant-id-original") + String modelUuid = execution.getVariable("model-version-id-original") + //here modelVersion is not set, we use modelUuid to decompose the service. + String serviceModelInfo = """{ + "modelInvariantUuid":"${modelInvariantUuid}", + "modelUuid":"${modelUuid}", + "modelVersion":"" + }""" + + execution.setVariable("serviceModelInfo_Original", serviceModelInfo) + + logger.debug( " ***** Completed prepareDecomposeService_Original of update generic e2e service ***** ") + } catch (Exception ex) { + // try error in method block + String exceptionMessage = "Bpmn error encountered in update generic e2e service flow. Unexpected Error from method prepareDecomposeService_Original() - " + ex.getMessage() + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } + } + + public void processDecomposition_Original(DelegateExecution execution) { + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + + logger.debug( " ***** Inside processDecomposition_Original() of update generic e2e service flow ***** ") + try { + ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition") + execution.setVariable("serviceDecomposition_Original", serviceDecomposition) + } catch (Exception ex) { + String exceptionMessage = "Bpmn error encountered in update generic e2e service flow. processDecomposition_Original() - " + ex.getMessage() + logger.debug( exceptionMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage) + } + } + + public void doCompareUuiRquestInput(DelegateExecution execution) { + + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + logger.info("INFO", "======== Start doCompareUuiRquestInput Process ======== ", isDebugEnabled) + + String uuiRequest_Target = execution.getVariable("uuiRequest") + Map<String, Object> serviceParametersObject_Target = getServiceParametersObject(uuiRequest_Target) + Map<String, Object> serviceRequestInputs_Target = (Map<String, Object>) serviceParametersObject_Target.get("requestInputs") + List<Object> resources_Target = (List<Object>) serviceParametersObject_Target.get("resources") + + String uuiRequest_Original = ((ServiceInstance) execution.getVariable("serviceInstanceData-original")).getInputParameters() + Map<String, Object> serviceParametersObject_Original = getServiceParametersObject(uuiRequest_Original) + Map<String, Object> serviceRequestInputs_Original = (Map<String, Object>) serviceParametersObject_Original.get("requestInputs") + List<Object> resources_Original = (List<Object>) serviceParametersObject_Original.get("resources") + + logger.info("INFO", "uuiRequest is: " + uuiRequest_Target, isDebugEnabled) + + //the resources which are included by resources_Target but resources_Original are the resources going to be added + ArrayList<Object> resourceList_Add = findResourceListIncluded(resources_Target, resources_Original) + HashMap<String, Object> serviceRequestInputs_Add = getServiceRequestInputsIncluded(resourceList_Add, serviceRequestInputs_Target, serviceParametersObject_Target) + String uuiRequest_add = loadUuiRequestJsonString(uuiRequest_Target, resourceList_Add, serviceRequestInputs_Add) + execution.setVariable("uuiRequest", uuiRequest_add) + logger.info("INFO", "uuiRequest will be changed to: " + uuiRequest_add, isDebugEnabled) + + //the resources which are included by resources_Original but resources_Target are the resources going to be deleted + ArrayList<Object> resourceList_Del = findResourceListIncluded(resources_Original, resources_Target) + HashMap<String, Object> serviceRequestInputs_Del = getServiceRequestInputsIncluded(resourceList_Del, serviceRequestInputs_Original, serviceParametersObject_Original) + String uuiRequest_del = loadUuiRequestJsonString(uuiRequest_Original, resourceList_Del, serviceRequestInputs_Del) + execution.setVariable("uuiRequest-del", uuiRequest_del) + logger.info("INFO", "uuiRequest-del: " + uuiRequest_del, isDebugEnabled) + + List<Resource> addResourceList = findResourceList(resourceList_Add, execution) + execution.setVariable("addResourceList", addResourceList) + logger.info("INFO", "addResourceList: " + addResourceList, isDebugEnabled) + + List<Resource> delResourceList = findResourceList(resourceList_Del, execution) + execution.setVariable("delResourceList", delResourceList) + logger.info("INFO", "delResourceList: " + delResourceList, isDebugEnabled) + + logger.info("INFO", "======== COMPLETED doCompareUuiRquestInput Process ======== ", isDebugEnabled) + } + + private List<Resource> findResourceList(ArrayList<Object> uuiResourceList, DelegateExecution execution) { + HashSet<String> addResourceCustomizationUuidSet = getCustomizationUuidSet(uuiResourceList) + Set<Resource> resourceSet = new HashSet<>() + ServiceDecomposition serviceDecomposition_Original = execution.getVariable("serviceDecomposition_Original") + List<Resource> allSR_original = serviceDecomposition_Original.getServiceResources() + for (Resource resource : allSR_original) { + if (addResourceCustomizationUuidSet.contains(resource.getModelInfo().getModelCustomizationUuid())) { + resourceSet.add(resource) + } + } + List<Resource> resourceList = new ArrayList<String>(resourceSet) + resourceList + } + + private HashSet<String> getCustomizationUuidSet(ArrayList<Object> resourceList_Add) { + Set<String> addRsourceCustomizationUuidSet = new HashSet<>() + for (Map<String, Object> resourceAdded : resourceList_Add) { + addRsourceCustomizationUuidSet.add(resourceAdded.get("rsourceCustomizationUuid")) + } + addRsourceCustomizationUuidSet + } + + private String loadUuiRequestJsonString(String uuiRequest_Target, ArrayList<Object> resourceList_Add, HashMap<String, Object> serviceRequestInputs_Add) { + Map<String, Object> uuiObject = ServicePluginFactory.getInstance().getJsonObject(uuiRequest_Target, Map.class) + Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service") + Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters") + serviceParametersObject.put("resources", resourceList_Add) + serviceParametersObject.put("requestInputs", serviceRequestInputs_Add) + String uuiRequest_add = ServicePluginFactory.getInstance().getJsonString(serviceObject) + uuiRequest_add + } + + private HashMap<String, Object> getServiceRequestInputsIncluded(ArrayList<Object> resourceList_Add, Map<String, Object> serviceRequestInputs_Target, Map<String, Object> serviceParametersObject_Target) { + ArrayList<String> newResourceNames = getNewResourceNames(resourceList_Add) + Map<String, Object> serviceRequestInputs_Add = new HashMap<String, Object>() + for (String inputKey : serviceRequestInputs_Target.keySet()) { + String resourceName = (inputKey.split("_"))[0] + if (newResourceNames.contains(resourceName)) { + serviceRequestInputs_Add.put(inputKey, serviceParametersObject_Target.get(inputKey)) + } + } + serviceRequestInputs_Add + } + + private ArrayList<String> getNewResourceNames(ArrayList<Object> addResourceList) { + Set<String> newResourceNames = new ArrayList<String>() + for (Object resourceObject : addResourceList) { + Map<String, Object> resourceAdded = (Map<String, Object>) resourceObject + String resName = new String(resourceAdded.get("resourceName")) + normalizeName(resName) + newResourceNames.add(resName) + } + newResourceNames + } + + private void normalizeName(String resName) { + resName.replaceAll("_", "") + resName.replaceAll(" ", "") + resName.toLowerCase() + } + + private ArrayList<Object> findResourceListIncluded(List<Object> resources_Target, List<Object> resources_Original) { + List<Object> addResourceList = new ArrayList<Object>() + for (Object resource_Target : resources_Target) { + Map<String, Object> resourceObject_Target = (Map<String, Object>) resource_Target + boolean isNewResourceInstance = isNewResourceInstance(resourceObject_Target, resources_Original) + if (isNewResourceInstance) { + addResourceList.add(resource_Target) + } + } + addResourceList + } + + private boolean isNewResourceInstance(Map<String, Object> resourceObject_Target, List<Object> resources_Original) { + String resourceIndex_Target = null + if (resourceObject_Target.keySet().contains("resourceIndex")) { + resourceIndex_Target = resourceObject_Target.get("resourceIndex") + } + String resourceName_Target = resourceObject_Target.get("resourceName") + boolean isNewResourceInstance = true + for (Object resource_Original : resources_Original) { + Map<String, Object> resourceObject_Original = (Map<String, Object>) resource_Original + String resourceIndex_Original = null + if (resourceObject_Original.keySet().contains("resourceIndex")) { + resourceIndex_Original = resourceObject_Original.get("resourceIndex") + } + String resourceName_Original = resourceObject_Original.get("resourceName") + if (resourceName_Target.equals(resourceName_Original)) { + if (resourceIndex_Target != null && resourceIndex_Original != null) { + if (resourceIndex_Target.equals(resourceIndex_Original)) { + isNewResourceInstance = false + } + } else { + isNewResourceInstance = false + } + } + } + isNewResourceInstance + } + + private Map<String, Object> getServiceParametersObject(String uuiRequest_Target) { + Map<String, Object> uuiObject = ServicePluginFactory.getInstance().getJsonObject(uuiRequest_Target, Map.class) + Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service") + Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters") + serviceParametersObject + } + +} diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy index ce9df87799..a12c2f4b85 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy @@ -156,7 +156,7 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce logger.debug("SDNCResponse: " + response) logger.debug("workflowException: " + workflowException) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy index 41bae326a5..22c8a11fae 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy @@ -1081,7 +1081,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor { boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") WorkflowException workflowException = execution.getVariable("WorkflowException") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) // reset variable String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "assignSDNCResponse") @@ -1109,7 +1109,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor { boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") WorkflowException workflowException = execution.getVariable("WorkflowException") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) // reset variable String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "activateSDNCResponse") diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy index c144dc0f46..41a302f5f1 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy @@ -244,7 +244,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso rollbackSDNCReturnCode = execution.getVariable(Prefix + "rollbackSDNCReturnCode") String rollbackSDNCResponse = execution.getVariable(Prefix + "rollbackSDNCResponse") String rollbackSDNCReturnInnerCode = "" - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() rollbackSDNCResponse = rollbackSDNCResponse rollbackSDNCResponse = rollbackSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "") if (rollbackSDNCReturnCode == "200") { 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 163bd0f583..bf52b11de2 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 @@ -491,7 +491,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor { String response = execution.getVariable("sdncAdapterResponse") logger.debug("SDNCResponse: " + response) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy index a337087105..1eeba493f4 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy @@ -149,7 +149,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso logger.debug("SDNCResponse: " + response) logger.debug("workflowException: " + workflowException) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy index c03f9f9c95..6b4fc840f7 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModule.groovy @@ -84,7 +84,7 @@ public class DoCreateVfModule extends VfModuleBase { String Prefix="DCVFM_" ExceptionUtil exceptionUtil = new ExceptionUtil() JsonUtils jsonUtil = new JsonUtils() - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() OofInfraUtils oofInfraUtils = new OofInfraUtils() CatalogDbUtils catalogDbUtils = new CatalogDbUtilsFactory().create() DecomposeJsonUtil decomposeJsonUtils = new DecomposeJsonUtil() @@ -598,7 +598,7 @@ public class DoCreateVfModule extends VfModuleBase { */ public void validateWorkflowResponse(DelegateExecution execution, String responseVar, String responseCodeVar, String errorResponseVar) { - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, responseVar, responseCodeVar, errorResponseVar) } @@ -668,8 +668,7 @@ public class DoCreateVfModule extends VfModuleBase { rollbackData.put("VFMODULE", "rollbackPrepareUpdateVfModule", "true") execution.setVariable("rollbackData", rollbackData) } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while postProcessing CreateAAIVfModule request:' + ex.getMessage()) + logger.debug('Exception occurred while postProcessing CreateAAIVfModule request: {}', ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Bad response from CreateAAIVfModule' + ex.getMessage()) } logger.trace('Exited ' + method) @@ -741,8 +740,7 @@ public class DoCreateVfModule extends VfModuleBase { } } } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage()) } logger.trace('Exited ' + method) @@ -822,17 +820,16 @@ public class DoCreateVfModule extends VfModuleBase { } } } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage()) } logger.trace('Exited ' + method) } catch (BpmnError e) { throw e; } catch (Exception e) { - logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), + logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", - ErrorCode.UnknownError.getValue(), "Exception is:\n" + e); + ErrorCode.UnknownError.getValue(), "Exception is:\n" + e, e); exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModuleForStatus(): ' + e.getMessage()) } } @@ -982,6 +979,8 @@ public class DoCreateVfModule extends VfModuleBase { //Get variables //cloudSiteId def cloudSiteId = execution.getVariable("DCVFM_cloudSiteId") + //cloudOwner + def cloudOwner = execution.getVariable("DCVFM_cloudOwner") //tenantId def tenantId = execution.getVariable("DCVFM_tenantId") //vnfType @@ -1070,6 +1069,7 @@ public class DoCreateVfModule extends VfModuleBase { String createVnfARequest = """ <createVfModuleRequest> <cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId> + <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner> <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId> <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId> <vnfName>${MsoUtils.xmlEscape(vnfName)}</vnfName> @@ -1233,6 +1233,7 @@ public class DoCreateVfModule extends VfModuleBase { def vfModuleModelName = execution.getVariable("DCVFM_vfModuleModelName") def vnfId = execution.getVariable("DCVFM_vnfId") def cloudSiteId = execution.getVariable("DCVFM_cloudSiteId") + def cloudOwner = execution.getVariable("DCVFM_cloudOwner") def sdncVersion = execution.getVariable("DCVFM_sdncVersion") def serviceModelInfo = execution.getVariable("serviceModelInfo") def vnfModelInfo = execution.getVariable("vnfModelInfo") @@ -1634,7 +1635,7 @@ public class DoCreateVfModule extends VfModuleBase { logger.debug("workflowException: " + workflowException) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) String sdncResponse = response diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy index a6040ac290..65f6f76a21 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy @@ -92,6 +92,8 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{ execution.setVariable("DCVFMR_vfModuleModelName", vfModuleModelName) String cloudSiteId = rollbackData.get("VFMODULE", "aiccloudregion") execution.setVariable("DCVFMR_cloudSiteId", cloudSiteId) + String cloudOwner = rollbackData.get("VFMODULE", "cloudowner") + execution.setVariable("DCVFMR_cloudOwner", cloudOwner) String heatStackId = rollbackData.get("VFMODULE", "heatstackid") execution.setVariable("DCVFMR_heatStackId", heatStackId) String requestId = rollbackData.get("VFMODULE", "msorequestid") @@ -358,6 +360,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{ String origRequestId = execution.getVariable("DCVFMR_requestId") String srvInstId = execution.getVariable("DCVFMR_serviceInstanceId") String aicCloudRegion = execution.getVariable("DCVFMR_cloudSiteId") + String cloudOwner = execution.getVariable("DCVFMR_cloudOwner") String vnfId = execution.getVariable("DCVFMR_vnfId") String vfModuleId = execution.getVariable("DCVFMR_vfModuleId") String vfModuleStackId = execution.getVariable("DCVFMR_heatStackId") @@ -373,6 +376,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{ String request = """ <deleteVfModuleRequest> <cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId> + <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner> <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId> <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId> <vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId> @@ -459,7 +463,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{ WorkflowException workflowException = execution.getVariable("WorkflowException") boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy index 5f160bb068..fb5c0fa0aa 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnf.groovy @@ -61,7 +61,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor { ExceptionUtil exceptionUtil = new ExceptionUtil() JsonUtils jsonUtil = new JsonUtils() VidUtils vidUtils = new VidUtils(this) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() OofInfraUtils oofInfraUtils = new OofInfraUtils() /** @@ -362,7 +362,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor { resourceClient.connect(uri, siUri) }catch(Exception ex) { - logger.debug("Error Occured in DoCreateVnf CreateGenericVnf Process ", ex) + logger.debug("Error Occured in DoCreateVnf CreateGenericVnf Process: {}", ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DoCreateVnf CreateGenericVnf Process") } logger.trace("COMPLETED DoCreateVnf CreateGenericVnf Process") @@ -530,7 +530,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor { logger.debug("workflowException: " + workflowException) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) logger.debug("SDNCResponse: " + response) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy index 3209f52fef..7ea32d2a60 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy @@ -315,7 +315,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor { logger.debug("workflowException: " + workflowException) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) String sdncResponse = response diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy index a54d90b2bf..2558f7eff5 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy @@ -691,7 +691,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor { boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") WorkflowException workflowException = execution.getVariable("WorkflowException") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) // reset variable String deleteSDNCResponseDecodeXml = execution.getVariable(Prefix + "deleteSDNCResponse") @@ -719,7 +719,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor { boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") WorkflowException workflowException = execution.getVariable("WorkflowException") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) // reset variable String assignSDNCResponseDecodeXml = execution.getVariable(Prefix + "deactivateSDNCResponse") diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy index d09fb03445..36c145b0e0 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy @@ -220,7 +220,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso rollbackSDNCReturnCode = execution.getVariable(Prefix + "rollbackSDNCReturnCode") String rollbackSDNCResponse = execution.getVariable(Prefix + "rollbackSDNCResponse") String rollbackSDNCReturnInnerCode = "" - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() rollbackSDNCResponse = rollbackSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "") if (rollbackSDNCReturnCode == "200") { if (utils.nodeExists(rollbackSDNCResponse, "response-code")) { diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy index 2e1cca54a6..0c676b5589 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy @@ -258,7 +258,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor { logger.debug("SDNCResponse: " + response) logger.debug("workflowException: " + workflowException) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy index bedf5e0948..b21dcf3433 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy @@ -111,6 +111,8 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{ execution.setVariable("tenantId", tenantId) String cloudSiteId = jsonUtil.getJsonValue(cloudConfiguration, "lcpCloudRegionId") execution.setVariable("cloudSiteId", cloudSiteId) + String cloudOwner = jsonUtil.getJsonValue(cloudConfiguration, "cloudOwner") + execution.setVariable("cloudOwner", cloudOwner) // Source is HARDCODED String source = "VID" execution.setVariable("source", source) @@ -176,6 +178,8 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{ execution.setVariable("vfModuleModelName", vfModuleModelName) String cloudSiteId = utils.getNodeText(xml, "aic-cloud-region") execution.setVariable("cloudSiteId", cloudSiteId) + String cloudOwner = utils.getNodeText(xml, "cloud-owner") + execution.setVariable("cloudOwner", cloudOwner) } // formulate the request for PrepareUpdateAAIVfModule @@ -281,6 +285,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{ def origRequestId = execution.getVariable('requestId') def srvInstId = execution.getVariable("serviceInstanceId") def aicCloudRegion = execution.getVariable("cloudSiteId") + def cloudOwner = execution.getVariable("cloudOwner") def vnfId = execution.getVariable("vnfId") def vfModuleId = execution.getVariable("vfModuleId") def vfModuleStackId = execution.getVariable('DoDVfMod_heatStackId') @@ -296,6 +301,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{ String request = """ <deleteVfModuleRequest> <cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId> + <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner> <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId> <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId> <vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId> @@ -369,7 +375,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{ WorkflowException workflowException = execution.getVariable("WorkflowException") boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ @@ -615,8 +621,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{ logger.debug("Received orchestration status from A&AI: " + orchestrationStatus) } } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage()) } logger.trace('Exited ' + method) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy index 3be52f50f7..e5306c40de 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy @@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory public class DoDeleteVfModuleFromVnf extends VfModuleBase { private static final Logger logger = LoggerFactory.getLogger( DoDeleteVfModuleFromVnf.class); - + def Prefix="DDVFMV_" ExceptionUtil exceptionUtil = new ExceptionUtil() JsonUtils jsonUtil = new JsonUtils() @@ -66,7 +66,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase { initProcessVariables(execution) try { - + // Building Block-type request // Set mso-request-id to request-id for VNF Adapter interface @@ -75,10 +75,13 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase { execution.setVariable("requestId", requestId) logger.debug("msoRequestId: " + requestId) String tenantId = execution.getVariable("tenantId") - logger.debug("tenantId: " + tenantId) + logger.debug("tenantId: " + tenantId) String cloudSiteId = execution.getVariable("lcpCloudRegionId") execution.setVariable("cloudSiteId", cloudSiteId) logger.debug("cloudSiteId: " + cloudSiteId) + String cloudOwner = execution.getVariable("cloudOwner") + execution.setVariable("cloudOwner", cloudOwner) + logger.debug("cloudOwner: " + cloudOwner) // Source is HARDCODED String source = "VID" execution.setVariable("source", source) @@ -99,15 +102,15 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase { } else { execution.setVariable(Prefix + "serviceInstanceIdToSdnc", serviceInstanceId) - } + } String sdncVersion = execution.getVariable("sdncVersion") if (sdncVersion == null) { sdncVersion = "1707" } execution.setVariable(Prefix + "sdncVersion", sdncVersion) - logger.debug("Incoming Sdnc Version is: " + sdncVersion) - + logger.debug("Incoming Sdnc Version is: " + sdncVersion) + String sdncCallbackUrl = (String) UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution) if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) { def msg = 'Required variable \'mso.workflow.sdncadapter.callback\' is missing' @@ -119,8 +122,6 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase { logger.debug("SDNC Callback URL: " + sdncCallbackUrl) logger.debug("SDNC Callback URL is: " + sdncCallbackUrl) - - }catch(BpmnError b){ throw b }catch(Exception e){ @@ -128,7 +129,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase { exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error encountered in PreProcess method!") } } - + public void queryAAIForVfModule(DelegateExecution execution) { def method = getClass().getSimpleName() + '.queryAAIForVfModule(' + 'execution=' + execution.getId() + @@ -151,8 +152,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase { execution.setVariable('DDVMFV_getVnfResponse', "Generic Vnf not found!") } } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex) execution.setVariable('DDVMFV_getVnfResponseCode', 500) execution.setVariable('DDVFMV_getVnfResponse', 'AAI GET Failed:' + ex.getMessage()) } @@ -166,7 +166,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase { exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIForVfModule(): ' + e.getMessage()) } } - + /** * Validate the VF Module. That is, confirm that a VF Module with the input VF Module ID * exists in the retrieved Generic VNF. Then, check to make sure that if that VF Module @@ -339,7 +339,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase { logger.debug("workflowException: " + workflowException) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) logger.debug("SDNCResponse: " + response) @@ -363,6 +363,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase { def origRequestId = execution.getVariable('requestId') def srvInstId = execution.getVariable("serviceInstanceId") def aicCloudRegion = execution.getVariable("cloudSiteId") + def cloudOwner = execution.getVariable("cloudOwner") def vnfId = execution.getVariable("vnfId") def vfModuleId = execution.getVariable("vfModuleId") def vfModuleStackId = execution.getVariable('DDVMFV_heatStackId') @@ -378,6 +379,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase { String request = """ <deleteVfModuleRequest> <cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId> + <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner> <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId> <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId> <vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy index 787b582808..c419f0dc7d 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy @@ -170,7 +170,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{ execution.setVariable(prefix+'volumeGroupHeatStackId', heatStackId) logger.debug('Heat stack id from AAI response: ' + heatStackId) - AAIResultWrapper wrapper = getAAIClient().get(uri); + AAIResultWrapper wrapper = getAAIClient().get(resourceUri); Optional<Relationships> relationships = wrapper.getRelationships() String volumeGroupTenantId = null @@ -217,6 +217,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{ */ public void prepareVnfAdapterDeleteRequest(DelegateExecution execution, isDebugLogEnabled) { def cloudRegion = execution.getVariable(prefix+'aicCloudRegion') + def cloudOwner = execution.getVariable(prefix+'cloudOwner') def tenantId = execution.getVariable('tenantId') // input parameter (optional) - see preProcessRequest def volumeGroupId = execution.getVariable('volumeGroupId') // input parameter (required) def volumeGroupHeatStackId = execution.getVariable(prefix+'volumeGroupHeatStackId') // from AAI query volume group @@ -233,6 +234,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor{ String vnfAdapterRestRequest = """ <deleteVolumeGroupRequest> <cloudSiteId>${MsoUtils.xmlEscape(cloudRegion)}</cloudSiteId> + <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner> <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId> <volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId> <volumeGroupStackId>${MsoUtils.xmlEscape(volumeGroupHeatStackId)}</volumeGroupStackId> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy index fb62babae9..9bd3388b79 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy @@ -60,7 +60,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor { ExceptionUtil exceptionUtil = new ExceptionUtil() JsonUtils jsonUtil = new JsonUtils() VidUtils vidUtils = new VidUtils(this) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() /** * This method gets and validates the incoming @@ -322,7 +322,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor { } if (vfModuleBaseEntry != null) { vfModulesList.add(vfModuleBaseEntry) - } + } } }else{ execution.setVariable('DCVFM_queryAAIVfModuleResponseCode', 404) @@ -331,8 +331,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor { } execution.setVariable("DDVAM_vfModules", vfModulesList) } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage()) } logger.trace('Exited ' + method) @@ -501,7 +500,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor { logger.debug("workflowException: " + workflowException) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) logger.debug("SDNCResponse: " + response) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy index 4fe30803c4..508131279a 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy @@ -195,7 +195,6 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { payload = utils.formatXml(payload) execution.setVariable("CVFMI_initResOperStatusRequest", payload) logger.info( "Outgoing initResourceOperationStatus: \n" + payload) - utils.logAudit("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload) }catch(Exception e){ logger.info( "Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy index ce61595680..6162780b27 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstance.groovy @@ -782,7 +782,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { String source = execution.getVariable(Prefix + "source") String requestInput = execution.getVariable(Prefix + "networkRequest") - String queryIdResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") + L3Network queryIdResponse = execution.getVariable(Prefix + "requeryIdAAIResponse") String cloudRegionId = execution.getVariable(Prefix + "cloudRegionPo") String backoutOnFailure = execution.getVariable(Prefix + "rollbackEnabled") @@ -946,7 +946,7 @@ public class DoUpdateNetworkInstance extends AbstractServiceTaskProcessor { boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) // reset variable String changeAssignSDNCResponseDecodeXml = execution.getVariable(Prefix + "changeAssignSDNCResponse") diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy index 1b98451fbe..371e54ca75 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateNetworkInstanceRollback.groovy @@ -204,7 +204,7 @@ public class DoUpdateNetworkInstanceRollback extends AbstractServiceTaskProcesso rollbackSDNCReturnCode = execution.getVariable(Prefix + "rollbackSDNCReturnCode") String rollbackSDNCResponse = execution.getVariable(Prefix + "rollbackSDNCResponse") String rollbackSDNCReturnInnerCode = "" - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() rollbackSDNCResponse = rollbackSDNCResponse.replace('$', '').replace('<?xml version="1.0" encoding="UTF-8"?>', "") if (rollbackSDNCReturnCode == "200") { if (utils.nodeExists(rollbackSDNCResponse, "response-code")) { diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy index a17dc9d7fe..abbcf66323 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVfModule.groovy @@ -143,6 +143,12 @@ public class DoUpdateVfModule extends VfModuleBase { execution.setVariable("DOUPVfMod_aicCloudRegion", cloudSiteId) logger.debug("cloudSiteId: " + cloudSiteId) + + //cloudOwner + def cloudOwner = execution.getVariable("cloudOwner") + execution.setVariable("DOUPVfMod_cloudOwner", cloudOwner) + logger.debug("cloudOwner: " + cloudOwner) + //vnfType def vnfType = execution.getVariable("vnfType") execution.setVariable("DOUPVfMod_vnfType", vnfType) @@ -304,6 +310,7 @@ public class DoUpdateVfModule extends VfModuleBase { execution.setVariable('DOUPVfMod_modelCustomizationUuid', getNodeTextForce(vnfInputs, 'model-customization-id')) execution.setVariable('DOUPVfMod_serviceId', getRequiredNodeText(execution, vnfInputs, 'service-id')) execution.setVariable('DOUPVfMod_aicCloudRegion', getRequiredNodeText(execution, vnfInputs, 'aic-cloud-region')) + execution.setVariable('DOUPVfMod_cloudOwner', getRequiredNodeText(execution, vnfInputs, 'cloud-owner')) execution.setVariable('DOUPVfMod_tenantId', getRequiredNodeText(execution, vnfInputs, 'tenant-id')) //isBaseVfModule def isBaseVfModule = "false" @@ -640,6 +647,7 @@ public class DoUpdateVfModule extends VfModuleBase { heatStackId = vfModule.getHeatStackId() } def cloudId = execution.getVariable('DOUPVfMod_aicCloudRegion') + def cloudOwner = execution.getVariable('DOUPVfMod_cloudOwner') def vnfType = execution.getVariable('DOUPVfMod_vnfType') def vnfName = execution.getVariable('DOUPVfMod_vnfName') def vfModuleModelName = execution.getVariable('DOUPVfMod_vfModuleModelName') @@ -672,6 +680,7 @@ public class DoUpdateVfModule extends VfModuleBase { String vnfAdapterRestRequest = """ <updateVfModuleRequest> <cloudSiteId>${MsoUtils.xmlEscape(cloudId)}</cloudSiteId> + <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner> <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId> <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId> <vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId> @@ -979,7 +988,7 @@ public class DoUpdateVfModule extends VfModuleBase { logger.debug("workflowException: " + workflowException) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) logger.debug("SDNCResponse: " + response) @@ -1032,8 +1041,7 @@ public class DoUpdateVfModule extends VfModuleBase { } } } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage()) } logger.trace('Exited ' + method) @@ -1042,7 +1050,7 @@ public class DoUpdateVfModule extends VfModuleBase { } catch (Exception e) { logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), 'Caught exception in ' + method, "BPMN", - ErrorCode.UnknownError.getValue(), "Exception is:\n" + e); + ErrorCode.UnknownError.getValue(), "Exception is:\n" + e, e); exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage()) } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy index 3dd5e61246..eb788a85b7 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoUpdateVnfAndModules.groovy @@ -265,8 +265,7 @@ class DoUpdateVnfAndModules extends AbstractServiceTaskProcessor { } execution.setVariable("DUVAM_vfModules", vfModulesList) } catch (Exception ex) { - ex.printStackTrace() - logger.debug('Exception occurred while executing AAI GET:' + ex.getMessage()) + logger.debug('Exception occurred while executing AAI GET: {}', ex.getMessage(), ex) exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage()) } logger.trace('Exited ' + method) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy index 4e3517e5b5..8e554e286d 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy @@ -72,7 +72,6 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor try { String siRequest = execution.getVariable("bpmnRequest") - utils.logAudit(siRequest) String requestId = execution.getVariable("mso-request-id") execution.setVariable("msoRequestId", requestId) @@ -190,6 +189,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor JSONObject ob = new JSONObject(wrapper.getJson()) JSONArray ar = ob.getJSONObject("relationship-list").getJSONArray("relationship") + execution.setVariable("serviceInstanceData-original", si.get()) execution.setVariable("serviceRelationShip", ar.toString()) @@ -277,7 +277,6 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor payload = utils.formatXml(payload) execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload) logger.error( "Outgoing updateServiceOperStatusRequest: \n" + payload) - utils.logAudit("CreateVfModuleInfra Outgoing updateServiceOperStatusRequest Request: " + payload) }catch(Exception e){ logger.debug( "Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e) @@ -398,7 +397,6 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor <aetgt:ErrorCode>${MsoUtils.xmlEscape(errorCode)}</aetgt:ErrorCode> </aetgt:WorkflowException>""" - utils.logAudit(buildworkflowException) sendWorkflowResponse(execution, 500, buildworkflowException) } catch (Exception ex) { diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy index 0b46a5a849..b12da9f959 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateNetworkInstance.groovy @@ -362,7 +362,7 @@ public class UpdateNetworkInstance extends AbstractServiceTaskProcessor { } catch (Exception ex) { String errorException = " Bpmn error encountered in UpdateNetworkInstance flow. FalloutHandlerRequest, buildErrorResponse() - " - logger.debug("Exception error in UpdateNetworkInstance flow, buildErrorResponse(): " + ex.getMessage()) + logger.debug("Exception error in UpdateNetworkInstance flow, buildErrorResponse(): {}", ex.getMessage(), ex) falloutHandlerRequest = """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1" xmlns:ns="http://org.onap/so/request/types/v1" diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy index 0c3294778a..3e9b934a2e 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolume.groovy @@ -100,6 +100,7 @@ class UpdateVfModuleVolume extends VfModuleBase { execution.setVariable('UPDVfModVol_vnfType', getRequiredNodeText(execution, volumeInputs, 'vnf-type')) execution.setVariable('UPDVfModVol_serviceId', getRequiredNodeText(execution, volumeInputs, 'service-id')) execution.setVariable('UPDVfModVol_aicCloudRegion', getRequiredNodeText(execution, volumeInputs, 'aic-cloud-region')) + execution.setVariable('UPDVfModVol_cloudOwner', getRequiredNodeText(execution, volumeInputs, 'cloud-owner')) execution.setVariable('UPDVfModVol_tenantId', getRequiredNodeText(execution, volumeInputs, 'tenant-id')) def volumeParams = utils.getNodeXml(request, 'volume-params') @@ -255,6 +256,7 @@ class UpdateVfModuleVolume extends VfModuleBase { String vnfAdapterRestRequest = """ <updateVolumeGroupRequest> <cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId> + <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner> <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId> <volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId> <volumeGroupStackId>${MsoUtils.xmlEscape(volumeGroupHeatStackId)}</volumeGroupStackId> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy index 361d6a2173..0344206145 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVfModuleVolumeInfraV1.groovy @@ -135,6 +135,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase { execution.setVariable('UPDVfModVol_vnfVersion', getRequiredNodeText(execution, volumeInputs, 'asdc-service-model-version')) execution.setVariable('UPDVfModVol_serviceId', utils.getNodeText(volumeInputs, 'service-id')) execution.setVariable('UPDVfModVol_aicCloudRegion', getRequiredNodeText(execution, volumeInputs, 'aic-cloud-region')) + execution.setVariable('UPDVfModVol_cloudRegion', getRequiredNodeText(execution, volumeInputs, 'cloud-owner')) execution.setVariable('UPDVfModVol_tenantId', getRequiredNodeText(execution, volumeInputs, 'tenant-id')) //execution.setVariable('UPDVfModVol_modelCustomizationId', getRequiredNodeText(execution, volumeInputs, 'model-customization-id')) @@ -296,6 +297,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase { public void prepVnfAdapterRest(DelegateExecution execution, isDebugLogEnabled) { def aicCloudRegion = execution.getVariable('UPDVfModVol_aicCloudRegion') + def cloudOwner = execution.getVariable("UPDVfModVol_cloudRegion") def tenantId = execution.getVariable('UPDVfModVol_tenantId') def volumeGroupId = execution.getVariable('UPDVfModVol_volumeGroupId') @@ -328,6 +330,7 @@ class UpdateVfModuleVolumeInfraV1 extends VfModuleBase { String vnfAdapterRestRequest = """ <updateVolumeGroupRequest> <cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId> + <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner> <tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId> <vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId> <vnfName>${MsoUtils.xmlEscape(vnfName)}</vnfName> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy index 24589a0893..2c5b6430e6 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy @@ -511,7 +511,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") logger.debug("SDNCResponse: " + response) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy index f27b3d94b1..58c0ef2dcf 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy @@ -167,7 +167,7 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") logger.debug("SDNCResponse: " + response) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy index b6e7470834..61dd13b4e2 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy @@ -446,7 +446,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") logger.debug("SDNCResponse: " + response) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy index ad2c9e155d..44e27d99cf 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy @@ -168,7 +168,7 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") logger.debug("SDNCResponse: " + response) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy index ca1b2ded2a..9dcee3dfb2 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy @@ -302,7 +302,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") logger.debug("SDNCResponse: " + response) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy index 0da6fd26f4..43e095859e 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy @@ -306,7 +306,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") logger.debug("SDNCResponse: " + response) - SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this) + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){ |