From 7ff576f74b103e9d93e60bb89ffda3860a47aa28 Mon Sep 17 00:00:00 2001 From: seshukm Date: Wed, 25 Oct 2017 09:47:33 +0530 Subject: update operation status for E2Edelete IssueId: SO-258 Change-Id: I7699b44d5e72fdcec96f86b0c493b969f9c91598 Signed-off-by: seshukm --- .../scripts/DeleteCustomE2EServiceInstance.groovy | 81 +++++++++++++++++- .../DoCustomDeleteE2EServiceInstance.groovy | 79 ----------------- .../process/DeleteCustomE2EServiceInstance.bpmn | 98 +++++++++++++--------- .../DoCustomDeleteE2EServiceInstance.bpmn | 97 +++++---------------- 4 files changed, 160 insertions(+), 195 deletions(-) (limited to 'bpmn/MSOInfrastructureBPMN/src') diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy index 3cd2b282e0..7ab651c9b0 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy @@ -98,7 +98,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor } else { execution.setVariable("globalSubscriberId", globalSubscriberId) } - + execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter") } catch (BpmnError e) { throw e; } catch (Exception ex){ @@ -156,6 +156,85 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor } + public void preInitResourcesOperStatus(Execution execution){ + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + + utils.log("DEBUG", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled) + try{ + String serviceId = execution.getVariable("serviceInstanceId") + String operationId = UUID.randomUUID().toString() + String operationType = "DELETE" + String resourceTemplateUUIDs = "" + String result = "processing" + String progress = "0" + String reason = "" + String operationContent = "Prepare service creation" + utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + oprationType, isDebugEnabled) + serviceId = UriUtils.encode(serviceId,"UTF-8") + execution.setVariable("serviceInstanceId", serviceId) + execution.setVariable("operationId", operationId) + execution.setVariable("operationType", operationType) + // we use resource instance ids for delete flow as resourceTemplateUUIDs + /*[ + { + "resourceInstanceId":"1111", + "resourceType":"vIMS" + }, + { + "resourceInstanceId":"222", + "resourceType":"vEPC" + }, + { + "resourceInstanceId":"3333", + "resourceType":"overlay" + }, + { + "resourceInstanceId":"4444", + "resourceType":"underlay" + } + ]*/ + String serviceRelationShip = execution.getVariable("serviceRelationShip") + + def jsonSlurper = new JsonSlurper() + def jsonOutput = new JsonOutput() + List relationShipList = jsonSlurper.parseText(serviceRelationShip) + + if (relationShipList != null) { + relationShipList.each { + resourceTemplateUUIDs = resourceTemplateUUIDs + it.resourceInstanceId + ":" + } + } + + def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint") + execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint) + utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled) + + String payload = + """ + + + + ${serviceId} + ${operationId} + ${operationType} + ${resourceTemplateUUIDs} + + + """ + + payload = utils.formatXml(payload) + execution.setVariable("CVFMI_initResOperStatusRequest", payload) + utils.log("DEBUG", "Outgoing initResourceOperationStatus: \n" + payload, isDebugEnabled) + utils.logAudit("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload) + + }catch(Exception e){ + utils.log("ERROR", "Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e, isDebugEnabled) + execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage()) + } + utils.log("DEBUG", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled) + } + public void prepareCompletionRequest (Execution execution) { def isDebugEnabled=execution.getVariable("isDebugLogEnabled") utils.log("DEBUG", " *** prepareCompletion *** ", isDebugEnabled) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy index b26976d985..f141bbdeb0 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy @@ -472,85 +472,6 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess utils.log("DEBUG"," *** Exit postProcessAAIDEL *** ", isDebugEnabled) } - public void preInitResourcesOperStatus(Execution execution){ - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") - - utils.log("DEBUG", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled) - try{ - String serviceId = execution.getVariable("serviceInstanceId") - String operationId = execution.getVariable("operationId") - String operationType = execution.getVariable("operationType") - String resourceTemplateUUIDs = "" - String result = "processing" - String progress = "0" - String reason = "" - String operationContent = "Prepare service creation" - utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + oprationType, isDebugEnabled) - serviceId = UriUtils.encode(serviceId,"UTF-8") - execution.setVariable("serviceInstanceId", serviceId) - execution.setVariable("operationId", operationId) - execution.setVariable("operationType", operationType) - // we use resource instance ids for delete flow as resourceTemplateUUIDs - /*[ - { - "resourceInstanceId":"1111", - "resourceType":"vIMS" - }, - { - "resourceInstanceId":"222", - "resourceType":"vEPC" - }, - { - "resourceInstanceId":"3333", - "resourceType":"overlay" - }, - { - "resourceInstanceId":"4444", - "resourceType":"underlay" - } - ]*/ - String serviceRelationShip = execution.getVariable("serviceRelationShip") - - def jsonSlurper = new JsonSlurper() - def jsonOutput = new JsonOutput() - List relationShipList = jsonSlurper.parseText(serviceRelationShip) - - if (relationShipList != null) { - relationShipList.each { - resourceTemplateUUIDs = resourceTemplateUUIDs + it.resourceInstanceId + ":" - } - } - - def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint") - execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint) - utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled) - - String payload = - """ - - - - ${serviceId} - ${operationId} - ${operationType} - ${resourceTemplateUUIDs} - - - """ - - payload = utils.formatXml(payload) - execution.setVariable("CVFMI_initResOperStatusRequest", payload) - utils.log("DEBUG", "Outgoing initResourceOperationStatus: \n" + payload, isDebugEnabled) - utils.logAudit("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload) - - }catch(Exception e){ - utils.log("ERROR", "Exception Occured Processing preInitResourcesOperStatus. Exception is:\n" + e, isDebugEnabled) - execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage()) - } - utils.log("DEBUG", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled) - } - /** * prepare delete parameters */ diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn index f24acb4a51..0273983104 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/DeleteCustomE2EServiceInstance.bpmn @@ -109,7 +109,7 @@ csi.sendSyncError(execution)]]> - SequenceFlow_0yowshs + SequenceFlow_1x62wqv SequenceFlow_0zf2qyk - + + + SequenceFlow_0yowshs + SequenceFlow_1x62wqv + + + - + @@ -148,99 +156,97 @@ csi.sendSyncResponse(execution)]]> - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - - - + + + + - + @@ -325,6 +331,16 @@ csi.sendSyncResponse(execution)]]> + + + + + + + + + + diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn index 581ab3a47d..ea7056d1b4 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCustomDeleteE2EServiceInstance.bpmn @@ -112,7 +112,7 @@ ex.processJavaException(execution)]]> SequenceFlow_1wmjau1 SequenceFlow_0qquvgc - + SequenceFlow_1931m8u @@ -142,7 +142,7 @@ def ddsi = new DoCustomDeleteE2EServiceInstance() ddsi.postProcessSDNCDelete(execution, response, "delete")]]> - SequenceFlow_13sc98g + SequenceFlow_1av166w SequenceFlow_1dza4q4 - - - SequenceFlow_1av166w - SequenceFlow_030y6yz - - - - - - - ${URN_mso_adapters_openecomp_db_endpoint} - - - application/soap+xml - #{BasicAuthHeaderValueDB} - - - ${CVFMI_initResOperStatusRequest} - POST - ${statusCode} - ${response} - - http-connector - - - SequenceFlow_030y6yz - SequenceFlow_13sc98g - @@ -195,7 +165,6 @@ def ddsi = new DoCustomDeleteE2EServiceInstance() ddsi.preResourceDelete(execution, resourceName )]]> - @@ -375,9 +344,9 @@ ddsi.preResourceDelete(execution, resourceName )]]> - + - + @@ -404,20 +373,20 @@ ddsi.preResourceDelete(execution, resourceName )]]> - + - - + + - + - - + + - + @@ -428,19 +397,6 @@ ddsi.preResourceDelete(execution, resourceName )]]> - - - - - - - - - - - - - @@ -465,13 +421,6 @@ ddsi.preResourceDelete(execution, resourceName )]]> - - - - - - - @@ -483,37 +432,37 @@ ddsi.preResourceDelete(execution, resourceName )]]> - + - - + + - + - - + + - + - + - + - + - + - + -- cgit 1.2.3-korg