bug fix for ccvpn uc after integration test 73/67973/1
authorYulian Han <elaine.hanyulian@huawei.com>
Thu, 20 Sep 2018 03:30:15 +0000 (11:30 +0800)
committerYulian Han <elaine.hanyulian@huawei.com>
Thu, 20 Sep 2018 03:30:15 +0000 (11:30 +0800)
Change-Id: Idaa55084f5ecb0dd3636c232cebc14fa70000020
Issue-ID: SO-683
Signed-off-by: Yulian Han <elaine.hanyulian@huawei.com>
16 files changed:
bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AaiUtil.groovy
bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/Create3rdONAPE2EServiceInstance.bpmn
bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateDeviceResource.bpmn
bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/Delete3rdONAPE2EServiceInstance.bpmn
bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteDeviceResource.bpmn
bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn

index cae80e9..3e451a5 100644 (file)
@@ -25,7 +25,7 @@ import org.onap.so.bpmn.core.UrnPropertiesReader;
 import org.onap.so.rest.APIResponse;
 import org.onap.so.rest.RESTClient
 import org.onap.so.rest.RESTConfig
-import org.onap.so.logger.MessageEnum
+import org.springframework.web.util.UriUtils
 import org.onap.so.logger.MsoLogger
 
 class AaiUtil {
@@ -43,6 +43,8 @@ class AaiUtil {
        public AaiUtil(AbstractServiceTaskProcessor taskProcessor) {
                this.taskProcessor = taskProcessor
        }
+       public AaiUtil() {
+       }
 
        public String getNetworkGenericVnfEndpoint(DelegateExecution execution) {
                String endpoint = UrnPropertiesReader.getVariable("aai.endpoint", execution)
@@ -87,6 +89,12 @@ class AaiUtil {
                return uri
        }
 
+       public String getNetworkDeviceUri(DelegateExecution execution) {
+               def uri = getUri(execution, 'device')
+               msoLogger.debug('AaiUtil.getNetworkDeviceUri() - AAI URI: ' + uri)
+               return uri
+       }
+
        public String getBusinessCustomerUri(DelegateExecution execution) {
                def uri = getUri(execution, 'customer')
                msoLogger.debug('AaiUtil.getBusinessCustomerUri() - AAI URI: ' + uri)
@@ -109,7 +117,7 @@ class AaiUtil {
        }
 
        //public String getBusinessCustomerUriv7(DelegateExecution execution) {
-       //      //      //def uri = getUri(execution, BUSINESS_CUSTOMERV7)
+       //      //def uri = getUri(execution, BUSINESS_CUSTOMERV7)
        //      def uri = getUri(execution, 'Customer')
        //      msoLogger.debug('AaiUtil.getBusinessCustomerUriv7() - AAI URI: ' + uri)
        //      return uri
@@ -178,9 +186,30 @@ class AaiUtil {
                (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 9999, "Internal Error: One of the following should be defined in MSO URN properties file: ${versionWithResourceKey}, ${versionWithProcessKey}, ${DEFAULT_VERSION_KEY}")
        }
 
+       public String getMainProcessKey(DelegateExecution execution) {
+               DelegateExecution exec = execution
+
+               while (true) {
+                       DelegateExecution parent = exec.getSuperExecution()
+
+                       if (parent == null) {
+                               parent = exec.getParent()
+
+                               if (parent == null) {
+                                       break
+                               }
+                       }
+
+                       exec = parent
+               }
+
+               return execution.getProcessEngineServices().getRepositoryService()
+                       .getProcessDefinition(exec.getProcessDefinitionId()).getKey()
+       }
+
        public String getUri(DelegateExecution execution, resourceName) {
 
-               def processKey = taskProcessor.getMainProcessKey(execution)
+               def processKey = getMainProcessKey(execution)
 
                //set namespace
                setNamespace(execution)
@@ -656,9 +685,9 @@ class AaiUtil {
 
        private def getPInterface(DelegateExecution execution, String aai_uri) {
 
-               String namespace = getNamespaceFromUri(aai_uri)
+               String namespace = getNamespaceFromUri(execution, aai_uri)
                String aai_endpoint = execution.getVariable("URN_aai_endpoint")
-               String serviceAaiPath = ${aai_endpoint}${aai_uri}
+               String serviceAaiPath = aai_endpoint + aai_uri
 
                APIResponse response = executeAAIGetCall(execution, serviceAaiPath)
                return new XmlParser().parseText(response.getResponseBodyAsString())
@@ -680,58 +709,102 @@ class AaiUtil {
                String aai_uri = '/aai/v14/network/logical-links'
 
                String aai_endpoint = execution.getVariable("URN_aai_endpoint")
-               String serviceAaiPath = ${aai_endpoint}${aai_uri}
+               String serviceAaiPath = aai_endpoint + aai_uri
 
                APIResponse response = executeAAIGetCall(execution, serviceAaiPath)
 
                def logicalLinks = new XmlParser().parseText(response.getResponseBodyAsString())
 
-               logicalLinks."logical-links".find { link ->
-                       def pInterface = []
+               logicalLinks."logical-link".each { link ->
+                       def isRemoteLink = false
+                       def pInterfaces = []
                        def relationship = link."relationship-list"."relationship"
-                       relationship.each {
-                               if ("p-interface".compareToIgnoreCase(it."related-to")) {
-                                       pInterface.add(it)
+                       relationship.each { rel ->
+                               if ("ext-aai-network".compareToIgnoreCase("${rel."related-to"[0]?.text()}") == 0) {
+                                       isRemoteLink = true
+                               }
+                               if ("p-interface".compareToIgnoreCase("${rel."related-to"[0]?.text()}") == 0) {
+                                       pInterfaces.add(rel)
                                }
                        }
-                       if (pInterface.size() == 2) {
+
+                       // if remote link then process
+                       if (isRemoteLink) {
+
+                               // find remote p interface
                                def localTP = null
                                def remoteTP = null
 
-                               if (pInterface[0]."related-link".contains("ext-aai-networks")) {
-                                       remoteTP = pInterface[0]
-                                       localTP = pInterface[1]
-                               }
+                               def pInterface0 = pInterfaces[0]
+                               def pIntfUrl = "${pInterface0."related-link"[0].text()}"
 
-                               if (pInterface[1]."related-link".contains("ext-aai-networks")) {
-                                       localTP = pInterface[0]
-                                       remoteTP = pInterface[1]
+                               if (isRemotePInterface(execution, pIntfUrl)) {
+                                       remoteTP = pInterfaces[0]
+                                       localTP = pInterfaces[1]
+                               } else {
+                                       localTP = pInterfaces[0]
+                                       remoteTP = pInterfaces[1]
                                }
 
                                if (localTP != null && remoteTP != null) {
                                
                                        // give local tp
-                                       var intfLocal = getPInterface(execution, localTP."related-link")
-                                       tpInfotpInfo.put("local-access-node-id", localTP."related-link".split("/")[6])
+                                       def tpUrl = "${localTP."related-link"[0]?.text()}"
+                                       def intfLocal = getPInterface(execution, "${localTP?."related-link"[0]?.text()}")
+                                       tpInfo.put("local-access-node-id", tpUrl.split("/")[6])
                                
-                                       def networkRef = intfLocal."network-ref".split("/")
-                                       tpInfo.put("local-access-provider-id", networkRef[1])
-                                       tpInfo.put("local-access-client-id", networkRef[3])
-                                       tpInfo.put("local-access-topology-id", networkRef[5])
-                                       tpInfo.put("local-access-ltp-id", localTP."interface-name")
+                                       def networkRef = "${intfLocal."network-ref"[0]?.text()}".split("/")
+                                       if (networkRef.size() == 6) {
+                                               tpInfo.put("local-access-provider-id", networkRef[1])
+                                               tpInfo.put("local-access-client-id", networkRef[3])
+                                               tpInfo.put("local-access-topology-id", networkRef[5])
+                                       }
+                                       def ltpIdStr = tpUrl?.substring(tpUrl?.lastIndexOf("/") + 1)
+                                       if (ltpIdStr?.contains("-")) {
+                                               tpInfo.put("local-access-ltp-id", ltpIdStr?.substring(ltpIdStr?.lastIndexOf("-") + 1))
+                                       }
                                        
-                                       // give local tp
-                                       var intfRemote = getPInterface(execution, remoteTP."related-link")
-                                       tpInfo.put("remote-access-node-id", remoteTP."related-link".split("/")[6])                                      
-                                       def networkRefRemote = intfRemote."network-ref".split("/")
-                                       tpInfo.put("remote-access-provider-id", networkRefRemote[1])
-                                       tpInfo.put("remote-access-client-id", networkRefRemote[3])
-                                       tpInfo.put("remote-access-topology-id", networkRefRemote[5])
-                                       tpInfo.put("remote-access-ltp-id", remoteTP."interface-name")
+                                       // give remote tp
+                                       tpUrl = "${remoteTP."related-link"[0]?.text()}"
+                                       def intfRemote = getPInterface(execution, "${remoteTP."related-link"[0].text()}")
+                                       tpInfo.put("remote-access-node-id", tpUrl.split("/")[6])
+
+                                       def networkRefRemote = "${intfRemote."network-ref"[0]?.text()}".split("/")
+
+                                       if (networkRefRemote.size() == 6) {
+                                               tpInfo.put("remote-access-provider-id", networkRefRemote[1])
+                                               tpInfo.put("remote-access-client-id", networkRefRemote[3])
+                                               tpInfo.put("remote-access-topology-id", networkRefRemote[5])
+                                       }
+                                       def ltpIdStrR = tpUrl?.substring(tpUrl?.lastIndexOf("/") + 1)
+                                       if (ltpIdStrR?.contains("-")) {
+                                               tpInfo.put("remote-access-ltp-id", ltpIdStrR?.substring(ltpIdStr?.lastIndexOf("-") + 1))
+                                       }
+                                       return tpInfo
                                }
                        }
 
                }
                return tpInfo
        }
+
+       // this method check if pInterface is remote
+       private def isRemotePInterface(DelegateExecution execution, String uri) {
+               def aai_uri = uri.substring(0, uri.indexOf("/p-interfaces"))
+
+               String namespace = getNamespaceFromUri(execution, aai_uri)
+               String aai_endpoint = execution.getVariable("URN_aai_endpoint")
+               String serviceAaiPath = aai_endpoint + aai_uri
+
+               APIResponse response = executeAAIGetCall(execution, serviceAaiPath)
+               def pnf =  new XmlParser().parseText(response.getResponseBodyAsString())
+
+               def relationship = pnf."relationship-list"."relationship"
+               relationship.each {
+                       if ("ext-aai-network".compareToIgnoreCase("${it."related-to"[0]?.text()}") == 0) {
+                               return true
+                       }
+               }
+               return false
+       }
 }
\ No newline at end of file
index 2c2cd82..7d4adae 100644 (file)
@@ -37,9 +37,9 @@ class ExternalAPIUtil {
        public MsoUtils utils = new MsoUtils()
        
        ExceptionUtil exceptionUtil = new ExceptionUtil()
-    
+
        private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ExternalAPIUtil.class)
-       
+
        public static final String PostServiceOrderRequestsTemplate =
        "{\n" +
        "\t\"externalId\": <externalId>,\n" +
@@ -83,6 +83,8 @@ class ExternalAPIUtil {
     "\t} \n" + 
     "}"
 
+       public ExternalAPIUtil() {
+       }
 
 //     public String getUri(DelegateExecution execution, resourceName) {
 //
index ec8df3d..d2903f5 100644 (file)
@@ -4,7 +4,7 @@
  * ================================================================================
  * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
  * 
 
 package org.onap.so.bpmn.infrastructure.scripts
 
+import org.json.JSONArray
 import org.json.JSONObject
 import org.json.XML
 
 import static org.apache.commons.lang3.StringUtils.*
 import groovy.xml.XmlUtil
-import groovy.json.*
 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
 import org.onap.so.bpmn.common.scripts.ExceptionUtil
 import org.onap.so.bpmn.common.scripts.ExternalAPIUtil
@@ -39,6 +39,7 @@ import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.Abstr
 import org.onap.so.rest.APIResponse
 import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
 import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory
+import java.util.Map
 import java.util.UUID
 import org.onap.so.logger.MsoLogger
 
@@ -62,7 +63,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
        ExceptionUtil exceptionUtil = new ExceptionUtil()
 
        JsonUtils jsonUtil = new JsonUtils()
-       
+
        private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, Create3rdONAPE2EServiceInstance.class)
 
        public void checkSPPartnerInfo (DelegateExecution execution) {
@@ -77,19 +78,19 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                        String resourceInput = execution.getVariable("resourceInput")
                        msoLogger.info("The resourceInput is: " + resourceInput)
                        //Get ResourceInput Object
-                       ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)                       
+                       ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
                        String resourceInputPrameters = resourceInputObj.getResourceParameters()
-                       String inputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")
-                       JSONObject inputParameters = new JSONObject(customizeResourceParam(inputParametersJson))
+                       String inputParametersJson = JsonUtils.getJsonValue(resourceInputPrameters, "requestInputs")
+                       JSONObject inputParameters = new JSONObject(inputParametersJson)
                        
                        // set local resourceInput
                        execution.setVariable(Prefix + "ResourceInput", resourceInputObj)
                        
                        boolean is3rdONAPExist = false
 
-                       if(inputParameters.has("url"))
+                       if(inputParameters.has("sppartner_url"))
                        {
-                               String sppartnerUrl = inputParameters.get("url")
+                               String sppartnerUrl = inputParameters.get("sppartner_url")
                                if(!isBlank(sppartnerUrl)) {
                                        execution.setVariable(Prefix + "SppartnerUrl", sppartnerUrl)
                                        is3rdONAPExist = true
@@ -100,32 +101,32 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                                        msoLogger.debug(msg)
                                }
                        }
-                       if(inputParameters.has("providingServiceInvarianteUuid"))
+                       if(inputParameters.has("sppartner_providingServiceUuid"))
                        {
-                               String sppartnerInvarianteUUID = inputParameters.get("providingServiceInvarianteUuid")
-                               execution.setVariable(Prefix + "SppartnerInvarianteUUID", sppartnerInvarianteUUID)
+                               String sppartnerUUID= inputParameters.get("sppartner_providingServiceUuid")
+                               execution.setVariable(Prefix + "SppartnerUUID", sppartnerUUID)
                                is3rdONAPExist = true
                        }
                        else {
                                is3rdONAPExist = false
-                               String msg = "sppartner providingServiceInvarianteUuid is blank."
+                               String msg = "sppartner providingServiceUuid is blank."
                                msoLogger.debug(msg)
                        }
-                       if(inputParameters.has("providingServiceUuid"))
+                       if(inputParameters.has("sppartner_providingServiceInvariantUuid"))
                        {
-                               String sppartnerUUID = inputParameters.get("providingServiceUuid")
-                               execution.setVariable(Prefix + "SppartnerUUID", sppartnerUUID)
+                               String sppartnerInvarianteUUID  = inputParameters.get("sppartner_providingServiceInvariantUuid")
+                               execution.setVariable(Prefix + "SppartnerInvarianteUUID", sppartnerInvarianteUUID)
                                is3rdONAPExist = true
                        }
                        else {
                                is3rdONAPExist = false
-                               String msg = "sppartner providingServiceUuid is blank."
+                               String msg = "sppartner providingServiceInvarianteUuid is blank."
                                msoLogger.debug(msg)
                        }
                        
-                       if(inputParameters.has("handoverMode"))
+                       if(inputParameters.has("sppartner_handoverMode"))
                        {
-                               String handoverMode = inputParameters.get("handoverMode")
+                               String handoverMode = inputParameters.get("sppartner_handoverMode")
                                execution.setVariable(Prefix + "HandoverMode", handoverMode)
                            is3rdONAPExist = true
                        }
@@ -134,7 +135,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                                String msg = "sppartner handoverMode is blank."
                                msoLogger.debug(msg)
                        }
-                       
+
                        execution.setVariable("Is3rdONAPExist", is3rdONAPExist)
                        execution.setVariable(Prefix + "ServiceInstanceId", resourceInputObj.getServiceInstanceId())
                        execution.setVariable("mso-request-id", requestId)
@@ -150,7 +151,6 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
        }
 
        public void checkLocallCall (DelegateExecution execution) {
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
                msoLogger.info(" ***** Started checkLocallCall *****")
                try {
                                        
@@ -159,9 +159,9 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
 
                        //uuiRequest
                        String incomingRequest = resourceInputObj.getRequestsInputs()
-                       String serviceParameters = jsonUtil.getJsonValue(incomingRequest, "service.parameters")
+                       String serviceParameters = JsonUtils.getJsonValue(incomingRequest, "service.parameters")
                        String requestInputs = JsonUtils.getJsonValue(serviceParameters, "requestInputs")
-                       JSONObject inputParameters = new JSONObject(customizeResourceParam(requestInputs))
+                       JSONObject inputParameters = new JSONObject(requestInputs)
                        execution.setVariable(Prefix + "ServiceParameters", inputParameters)
                        
                        // CallSource is added only when ONAP SO calling 3rdONAP(External API) SO(Remote call)
@@ -189,17 +189,16 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
        }
 
        public void preProcessRequest(DelegateExecution execution){
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
                msoLogger.info(" ***** Started preProcessRequest *****")
+               String msg = ""
+
                try {
                        ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")
-                       String msg = ""
 
                        String globalSubscriberId = resourceInputObj.getGlobalSubscriberId()
                        if (isBlank(globalSubscriberId)) {
                                msg = "Input globalSubscriberId is null"
-                               msoLogger.info(msg)
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               msoLogger.error(msg)
                        }
                        //set local variable
                        execution.setVariable("globalSubscriberId", globalSubscriberId)
@@ -208,8 +207,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                        String serviceType = resourceInputObj.getServiceType()
                        if (isBlank(serviceType)) {
                                msg = "Input serviceType is null"
-                               msoLogger.info(msg)
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               msoLogger.error(msg)
                        }
                        execution.setVariable("serviceType", serviceType)
                        msoLogger.info("serviceType:" + serviceType)
@@ -217,8 +215,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                        String resourceName = resourceInputObj.getResourceInstanceName()
                        if (isBlank(resourceName)) {
                                msg = "Input resourceName is null"
-                               msoLogger.info(msg)
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               msoLogger.error(msg)
                        }
                        execution.setVariable("resourceName", resourceName)
                        msoLogger.info("resourceName:" + resourceName)
@@ -230,23 +227,45 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                        String serviceInstanceId = resourceInputObj.getServiceInstanceId()
                        if (isBlank(serviceInstanceId)) {
                                msg = "Input serviceInstanceId is null"
-                               msoLogger.info(msg)
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               msoLogger.error(msg)
                        }
                        execution.setVariable(Prefix + "ServiceInstanceId", serviceInstanceId)
                        msoLogger.info("serviceInstanceId:" + serviceInstanceId)
 
+                       String resourceModelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid()
+                       if (isBlank(resourceModelInvariantUuid)) {
+                               msg = "Input resourceModelInvariantUuid is null"
+                               msoLogger.error(msg)
+                       }
+                       execution.setVariable(Prefix + "ResourceModelInvariantUuid", resourceModelInvariantUuid)
+                       msoLogger.info("resourceModelInvariantUuid:" + resourceModelInvariantUuid)
+                               
+                       String resourceModelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()
+                       if (isBlank(resourceModelUuid)) {
+                               msg = "Input resourceModelUuid is null"
+                               msoLogger.error(msg)
+                       }
+                       execution.setVariable(Prefix + "ResourceModelUuid", resourceModelUuid)
+                       msoLogger.info("resourceModelUuid:" + resourceModelUuid)
+                       
+                       String resourceModelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
+                       if (isBlank(resourceModelCustomizationUuid)) {
+                               msg = "Input resourceModelCustomizationUuid is null"
+                               msoLogger.error(msg)
+                       }
+                       execution.setVariable(Prefix + "ResourceModelCustomizationUuid", resourceModelCustomizationUuid)
+                       msoLogger.info("resourceModelCustomizationUuid:" + resourceModelCustomizationUuid)
+
                } catch (BpmnError e) {
                        throw e
                } catch (Exception ex){
-                       String msg = "Exception in preProcessRequest " + ex.getMessage()
+                       msg = "Exception in preProcessRequest " + ex.getMessage()
                        msoLogger.debug(msg)
                        exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
                }
        }
 
        public void prepareUpdateProgress(DelegateExecution execution) {
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
                msoLogger.info(" ***** Started prepareUpdateProgress *****")
                ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")
                String operType = resourceInputObj.getOperationType()
@@ -280,7 +299,6 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
        }
 
        public void allocateCrossONAPResource(DelegateExecution execution) {
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
                msoLogger.info(" ***** Started allocateCrossONAPResource *****")
                
                //get TP links from AAI for SOTN handoverMode only
@@ -288,42 +306,45 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                if("SOTN".equalsIgnoreCase(handoverMode)) {
                        // Put TP Link info into serviceParameters
                        JSONObject inputParameters = execution.getVariable(Prefix + "ServiceParameters")
-
-                       Map<String, Object> crossTPs = new HashMap<String, Object>();
-                       crossTPs.put("local-access-provider-id", inputParameters.get("remote-access-provider-id"));
-                       crossTPs.put("local-access-client-id", inputParameters.get("remote-access-client-id"));
-                       crossTPs.put("local-access-topology-id", inputParameters.get("remote-access-topology-id"));
-                       crossTPs.put("local-access-node-id", inputParameters.get("remote-access-node-id"));
-                       crossTPs.put("local-access-ltp-id", inputParameters.get("remote-access-ltp-id"));
-                       crossTPs.put("remote-access-provider-id", inputParameters.get("local-access-provider-id"));
-                       crossTPs.put("remote-access-client-id", inputParameters.get("local-client-id"));
-                       crossTPs.put("remote-access-topology-id", inputParameters.get("local-topology-id"));
-                       crossTPs.put("remote-access-node-id", inputParameters.get("local-node-id"));
-                       crossTPs.put("remote-access-ltp-id", inputParameters.get("local-ltp-id"));
-
-                       inputParameters.put("local-access-provider-id", crossTPs.get("local-access-provider-id"));
-                       inputParameters.put("local-access-client-id", crossTPs.get("local-access-client-id"));
-                       inputParameters.put("local-access-topology-id", crossTPs.get("local-access-topology-id"));
-                       inputParameters.put("local-access-node-id", crossTPs.get("local-access-node-id"));
-                       inputParameters.put("local-access-ltp-id", crossTPs.get("local-access-ltp-id"));
-                       inputParameters.put("remote-access-provider-id", crossTPs.get("remote-access-provider-id"));
-                       inputParameters.put("remote-access-client-id", crossTPs.get("remote-client-id"));
-                       inputParameters.put("remote-access-topology-id", crossTPs.get("remote-topology-id"));
-                       inputParameters.put("remote-access-node-id", crossTPs.get("remote-node-id"));
-                       inputParameters.put("remote-access-ltp-id", crossTPs.get("remote-ltp-id"));
-
-                       execution.setVariable(Prefix + "ServiceParameters", inputParameters)
+                       if(inputParameters.has("remote-access-provider-id")) {
+                               Map<String, Object> crossTPs = new HashMap<String, Object>();
+                               crossTPs.put("local-access-provider-id", inputParameters.get("remote-access-provider-id"));
+                               crossTPs.put("local-access-client-id", inputParameters.get("remote-access-client-id"));
+                               crossTPs.put("local-access-topology-id", inputParameters.get("remote-access-topology-id"));
+                               crossTPs.put("local-access-node-id", inputParameters.get("remote-access-node-id"));
+                               crossTPs.put("local-access-ltp-id", inputParameters.get("remote-access-ltp-id"));
+                               crossTPs.put("remote-access-provider-id", inputParameters.get("local-access-provider-id"));
+                               crossTPs.put("remote-access-client-id", inputParameters.get("local-access-client-id"));
+                               crossTPs.put("remote-access-topology-id", inputParameters.get("local-access-topology-id"));
+                               crossTPs.put("remote-access-node-id", inputParameters.get("local-access-node-id"));
+                               crossTPs.put("remote-access-ltp-id", inputParameters.get("local-access-ltp-id"));
+       
+                               inputParameters.put("local-access-provider-id", crossTPs.get("local-access-provider-id"));
+                               inputParameters.put("local-access-client-id", crossTPs.get("local-access-client-id"));
+                               inputParameters.put("local-access-topology-id", crossTPs.get("local-access-topology-id"));
+                               inputParameters.put("local-access-node-id", crossTPs.get("local-access-node-id"));
+                               inputParameters.put("local-access-ltp-id", crossTPs.get("local-access-ltp-id"));
+                               inputParameters.put("remote-access-provider-id", crossTPs.get("remote-access-provider-id"));
+                               inputParameters.put("remote-access-client-id", crossTPs.get("remote-access-client-id"));
+                               inputParameters.put("remote-access-topology-id", crossTPs.get("remote-access-topology-id"));
+                               inputParameters.put("remote-access-node-id", crossTPs.get("remote-access-node-id"));
+                               inputParameters.put("remote-access-ltp-id", crossTPs.get("remote-access-ltp-id"));
+
+                               execution.setVariable(Prefix + "ServiceParameters", inputParameters)
+                       }
+                       else {
+                                       msoLogger.error("No allocated CrossONAPResource found in ServiceParameters")
+                       }
                }
                
                msoLogger.info("Exit " + allocateCrossONAPResource)
        }
 
        public void prepare3rdONAPRequest(DelegateExecution execution) {
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
                msoLogger.info(" ***** Started prepare3rdONAPRequest *****")
                
                String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
-               String extAPIPath = sppartnerUrl + 'serviceOrder'
+               String extAPIPath = sppartnerUrl + '/serviceOrder'
                execution.setVariable("ExternalAPIURL", extAPIPath)
                
                // ExternalAPI message format
@@ -334,14 +355,14 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                String requestedCompletionDate = utils.generateCurrentTimeInUtc()
                String priority = "1" // 0-4 0:highest
                String subscriberId = execution.getVariable("globalSubscriberId")
-               String customerRole = ""
-               String subscriberName = ""
+               String customerRole = "ONAPcustomer"
+               String subscriberName = subscriberId
                String referredType = "Consumer"
                String orderItemId = "1"
                String action = "add" //for create
                String serviceState = "active"
                String serviceName = execution.getVariable("serviceInstanceName")
-               String serviceUuId = execution.setVariable(Prefix + "SppartnerUUID")
+               String serviceUuId = execution.getVariable(Prefix + "SppartnerUUID")
                
                Map<String, String> valueMap = new HashMap<>()
                valueMap.put("externalId", '"' + externalId + '"')
@@ -357,29 +378,29 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                valueMap.put("orderItemId", '"' + orderItemId + '"')
                valueMap.put("action", '"' + action + '"')
                valueMap.put("serviceState", '"' + serviceState + '"')
-               valueMap.put("serviceId", '""')//To be confirmed 
+               valueMap.put("serviceId", "null") //null for add
                valueMap.put("serviceName", '"' + serviceName + '"')
                valueMap.put("serviceUuId", '"' + serviceUuId + '"')
                
-               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
+               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil()
                
                // insert CallSource='ExternalAPI' to uuiRequest                
                Map<String, String> requestInputsMap = new HashMap<>()
-               requestInputsMap.put("inputName", "CallSource")
-               requestInputsMap.put("inputValue", "ExternalAPI")
+               requestInputsMap.put("inputName",  '"CallSource"')
+               requestInputsMap.put("inputValue", '"ExternalAPI"')
                String _requestInputs_ = externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
                
-               requestInputsMap.clear()                
+               requestInputsMap.clear()
                String serviceInstanceId = execution.getVariable(Prefix + "ServiceInstanceId")
-               requestInputsMap.put("inputName", "SppartnerServiceId")
-               requestInputsMap.put("inputValue", serviceInstanceId)           
+               requestInputsMap.put("inputName", '"SppartnerServiceId"')
+               requestInputsMap.put("inputValue", '"' + serviceInstanceId + '"')
                _requestInputs_ +=  ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
                
                requestInputsMap.clear()
                String serviceType = execution.getVariable("serviceType")
-               requestInputsMap.put("inputName", "serviceType")
-               requestInputsMap.put("inputValue", serviceType)
-               _requestInputs_ +=  ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)                
+               requestInputsMap.put("inputName", '"serviceType"')
+               requestInputsMap.put("inputValue", '"' + serviceType + '"')
+               _requestInputs_ +=  ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
                
                // Transfer all uuiRequest incomeParameters to ExternalAPI format
                JSONObject inputParameters = execution.getVariable(Prefix + "ServiceParameters")
@@ -390,7 +411,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                        requestInputsMap.put("inputName", '"' + inputName+ '"')
                        requestInputsMap.put("inputValue", '"' + inputValue + '"')
                        _requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
-               }                
+               }
                valueMap.put("_requestInputs_",  _requestInputs_)
                
                String payload = externalAPIUtil.setTemplate(ExternalAPIUtil.PostServiceOrderRequestsTemplate, valueMap)
@@ -399,13 +420,14 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
        }
 
        public void doCreateE2ESIin3rdONAP(DelegateExecution execution) {
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
                msoLogger.info(" ***** Started doCreateE2ESIin3rdONAP *****")
                
                String extAPIPath = execution.getVariable("ExternalAPIURL")
                String payload = execution.getVariable(Prefix + "Payload")
+               msoLogger.debug("doCreateE2ESIin3rdONAP externalAPIURL is: " + extAPIPath)
+               msoLogger.debug("doCreateE2ESIin3rdONAP payload is: " + payload)
                
-               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
+               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil()
 
                APIResponse response = externalAPIUtil.executeExternalAPIPostCall(execution, extAPIPath, payload)
 
@@ -416,18 +438,22 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                String extApiResponse = response.getResponseBodyAsString()
                JSONObject responseObj = new JSONObject(extApiResponse)
                execution.setVariable(Prefix + "PostServiceOrderResponse", extApiResponse)
+               
+               msoLogger.debug("doCreateE2ESIin3rdONAP response body is: " + extApiResponse)
+               
                //Process Response
                if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
                        //200 OK 201 CREATED 202 ACCEPTED
                {
                        msoLogger.debug("Post ServiceOrder Received a Good Response")
-                       String serviceOrderId = responseObj.get("ServiceOrderId")
+                       String serviceOrderId = responseObj.get("id")
                        execution.setVariable(Prefix + "SuccessIndicator", true)
-                       execution.setVariable("serviceOrderId", serviceOrderId)
+                       execution.setVariable("ServiceOrderId", serviceOrderId)
+                       msoLogger.info("Post ServiceOrderid is: " + serviceOrderId)
                }
                else{
-                       msoLogger.debug("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Post ServiceOrder Received a bad response from 3rdONAP External API")
+                       msoLogger.error("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
+//                     exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Post ServiceOrder Received a bad response from 3rdONAP External API")
                }
                
                msoLogger.info("Exit " + doCreateE2ESIin3rdONAP)
@@ -435,13 +461,13 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
        
 
        public void getE2ESIProgressin3rdONAP(DelegateExecution execution) {
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
                msoLogger.info(" ***** Started getE2ESIProgressin3rdONAP *****")
                
                String extAPIPath = execution.getVariable("ExternalAPIURL")
                extAPIPath += "/" + execution.getVariable("ServiceOrderId")
+               utils.log("DEBUG", "getE2ESIProgressin3rdONAP create externalAPIURL is: " + extAPIPath, isDebugEnabled)
                
-               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
+               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil()
 
                APIResponse response = externalAPIUtil.executeExternalAPIGetCall(execution, extAPIPath)
 
@@ -453,48 +479,72 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                JSONObject responseObj = new JSONObject(extApiResponse)
                execution.setVariable(Prefix + "GetServiceOrderResponse", extApiResponse)
                
+               msoLogger.debug("getE2ESIProgressin3rdONAP create response body is: " + extApiResponse)
+               
                //Process Response //200 OK 201 CREATED 202 ACCEPTED
-               if(responseCode == 200 || responseCode == 201 || responseCode == 202 )                  
+               if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
                {
-                       msoLogger.debug("Get ServiceOrder Received a Good Response")
-                       
-                       String sppartnerServiceId = responseObj.get("orderIterm.service.id")
+                       msoLogger.debug("Get Create ServiceOrder Received a Good Response")
+
+                       String orderState = responseObj.get("state")
+                       if("REJECTED".equalsIgnoreCase(orderState)) {
+                               execution.setVariable("progress", 100)
+                               execution.setVariable("status", "error")
+                               execution.setVariable("statusDescription", "Create Service Order Status is REJECTED")
+                               return
+                       }
+
+                       JSONArray items = responseObj.getJSONArray("orderItem")
+                       JSONObject item = items[0]
+                       JSONObject service = item.get("service")
+                       String sppartnerServiceId = service.get("id")
+                       if(sppartnerServiceId == null || sppartnerServiceId.equals("null")) {
+                               execution.setVariable("progress", 100)
+                               execution.setVariable("status", "error")
+                               execution.setVariable("statusDescription", "Create Service Order Status get null sppartnerServiceId")
+                               msoLogger.error("null sppartnerServiceId while getting progress from externalAPI")
+                               return
+                       }
+
                        execution.setVariable(Prefix + "SppartnerServiceId", sppartnerServiceId)
 
-                       String serviceOrderState = responseObj.get("orderIterm.state")
+                       String serviceOrderState = item.get("state")
                        execution.setVariable(Prefix + "SuccessIndicator", true)
-                       execution.setVariable("serviceOrderState", serviceOrderState)                   
+                       execution.setVariable("ServiceOrderState", serviceOrderState)
                        
                        // Get serviceOrder State and process progress
                        if("ACKNOWLEDGED".equalsIgnoreCase(serviceOrderState)) {
                                execution.setVariable("progress", 15)
-                               execution.setVariable("status", "processing")                           
+                               execution.setVariable("status", "processing")
+                               execution.setVariable("statusDescription", "Create Service Order Status is " + serviceOrderState)
                        }
-                       if("INPROGRESS".equalsIgnoreCase(serviceOrderState)) {
+                       else if("INPROGRESS".equalsIgnoreCase(serviceOrderState)) {
                                execution.setVariable("progress", 40)
                                execution.setVariable("status", "processing")
+                               execution.setVariable("statusDescription", "Create Service Order Status is " + serviceOrderState)
                        }
-                       if("COMPLETED".equalsIgnoreCase(serviceOrderState)) {
+                       else if("COMPLETED".equalsIgnoreCase(serviceOrderState)) {
                                execution.setVariable("progress", 100)
                                execution.setVariable("status", "finished")
+                               execution.setVariable("statusDescription", "Create Service Order Status is " + serviceOrderState)
                        }
-                       if("FAILED".equalsIgnoreCase(serviceOrderState)) {
+                       else if("FAILED".equalsIgnoreCase(serviceOrderState)) {
                                execution.setVariable("progress", 100)
                                execution.setVariable("status", "error")
+                               execution.setVariable("statusDescription", "Create Service Order Status is " + serviceOrderState)
                        }
                        else {
                                execution.setVariable("progress", 100)
                                execution.setVariable("status", "error")
                                execution.setVariable("statusDescription", "Create Service Order Status is unknown")
                        }
-                       execution.setVariable("statusDescription", "Create Service Order Status is " + serviceOrderState)
                }
                else{                   
                        msoLogger.debug("Get ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
                        execution.setVariable("progress", 100)
                        execution.setVariable("status", "error")
-                       execution.setVariable("statusDescription", "Get ServiceOrder Received a bad response")
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get ServiceOrder Received a bad response from 3rdONAP External API")
+                       execution.setVariable("statusDescription", "Get Create ServiceOrder Received a bad response")
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Create ServiceOrder Received a bad response from 3rdONAP External API")
                }               
                
                msoLogger.info("Exit " + getE2ESIProgressin3rdONAP)
@@ -504,17 +554,15 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
         * delay 5 sec
         */
        public void timeDelay(DelegateExecution execution) {
-               def isDebugEnabled= execution.getVariable("isDebugLogEnabled")
                try {
                        Thread.sleep(5000)
                } catch(InterruptedException e) {
-                       utils.log("ERROR", "Time Delay exception" + e )
+                       msoLogger.error("Time Delay exception" + e)
                }
        }
 
        public void saveSPPartnerInAAI(DelegateExecution execution) {
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
-               msoLogger.info(" ***** Started postCreateE2ESIin3rdONAP *****") 
+               msoLogger.info(" ***** Started saveSPPartnerInAAI *****")       
                
                String sppartnerId = execution.getVariable(Prefix + "SppartnerServiceId")
                String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
@@ -522,8 +570,11 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                String serviceInstanceId = execution.getVariable(Prefix + "ServiceInstanceId")
                String globalSubscriberId = execution.getVariable("globalSubscriberId")
                String serviceType = execution.getVariable("serviceType")
+               String resourceModelInvariantUuid = execution.getVariable(Prefix + "ResourceModelInvariantUuid")
+               String resourceModelUuid = execution.getVariable(Prefix + "ResourceModelUuid")
+               String resourceModelCustomizationUuid = execution.getVariable(Prefix + "ResourceModelCustomizationUuid")
                
-               AaiUtil aaiUriUtil = new AaiUtil(this)
+               AaiUtil aaiUriUtil = new AaiUtil()
                String aai_uri = aaiUriUtil.getBusinessSPPartnerUri(execution)
                String namespace = aaiUriUtil.getNamespaceFromUri(aai_uri)
                
@@ -532,6 +583,9 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                                <id>${sppartnerId}</id>
                                <url>${sppartnerUrl}</url>
                                <callsource>${callSource}</callsource>
+                               <model-invariant-id>${resourceModelInvariantUuid}</model-invariant-id>
+                               <model-version-id>${resourceModelUuid}</model-version-id>
+                               <model-customization-id>${resourceModelCustomizationUuid}</model-customization-id>
                                <relationship-list>
                                  <relationship>
                                    <related-to>service-instance</related-to>
@@ -551,7 +605,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                APIResponse response = aaiUriUtil.executeAAIPutCall(execution, serviceAaiPath, payload)
                int responseCode = response.getStatusCode()
                execution.setVariable(Prefix + "PutSppartnerResponseCode", responseCode)
-               msoLogger.debug("  Put sppartner response code is: " + responseCode)
+               msoLogger.debug("Put sppartner response code is: " + responseCode)
 
                String aaiResponse = response.getResponseBodyAsString()
                aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
@@ -581,7 +635,6 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
        }       
 
        public void postProcess(DelegateExecution execution){
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
                msoLogger.info(" ***** Started postProcess *****")
                String responseCode = execution.getVariable(Prefix + "PutSppartnerResponseCode")
                String responseObj = execution.getVariable(Prefix + "PutSppartnerResponse")
@@ -591,7 +644,6 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
        }
 
        public void sendSyncResponse (DelegateExecution execution) {
-               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
                msoLogger.debug(" *** sendSyncResponse *** ")
 
                try {
@@ -609,21 +661,4 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                }
                msoLogger.debug(" ***** Exit sendSyncResopnse *****")
        }
-       
-       String customizeResourceParam(String inputParametersJson) {
-               List<Map<String, Object>> paramList = new ArrayList()
-               JSONObject jsonObject = new JSONObject(inputParametersJson)
-               Iterator iterator = jsonObject.keys()
-               while (iterator.hasNext()) {
-                       String key = iterator.next()
-                       HashMap<String, String> hashMap = new HashMap()
-                       hashMap.put("name", key)
-                       hashMap.put("value", jsonObject.get(key))
-                       paramList.add(hashMap)
-               }
-               Map<String, List<Map<String, Object>>> paramMap = new HashMap()
-               paramMap.put("param", paramList)
-
-               return  new JSONObject(paramMap).toString()
-       }
 }
index 15b63fb..89a6239 100644 (file)
@@ -65,6 +65,7 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
 
     public void preProcessRequest(DelegateExecution execution){
         msoLogger.info(" ***** Started preProcessRequest *****")
+        String msg = ""
         try {           
             
             //get bpmn inputs from resource request.
@@ -77,25 +78,52 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
             msoLogger.info("The resourceInput is: " + resourceInput)
             //Get ResourceInput Object
             ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
-            execution.setVariable(Prefix + "resourceInput", resourceInputObj)
-                       String resourceInputPrameters = resourceInputObj.getResourceParameters()
-                       String inputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")
-                       JSONObject inputParameters = new JSONObject(customizeResourceParam(inputParametersJson))
-                       execution.setVariable(Prefix + "resourceRequestInputs", inputParameters)
+            execution.setVariable(Prefix + "ResourceInput", resourceInputObj)
+
+            String resourceInputPrameters = resourceInputObj.getResourceParameters()
+            String inputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")
+            JSONObject inputParameters = new JSONObject(inputParametersJson)
+            execution.setVariable(Prefix + "ResourceRequestInputs", inputParameters)
+
+//            String incomingRequest = resourceInputObj.getRequestsInputs()
+//            String serviceParameters = JsonUtils.getJsonValue(incomingRequest, "service.parameters")
+//            String requestInputs = JsonUtils.getJsonValue(serviceParameters, "requestInputs")
+//            JSONObject serviceInputParameters = new JSONObject(requestInputs)
+//            execution.setVariable(Prefix + "ServiceParameters", serviceInputParameters)
             
             //Deal with recipeParams
             String recipeParamsFromWf = execution.getVariable("recipeParamXsd")
-            String resourceName = resourceInputObj.getResourceInstanceName()            
-            //For sdnc requestAction default is "createNetworkInstance"
-            String operationType = "Network"    
-            if(!StringUtils.isBlank(recipeParamsFromRequest)){
-                //the operationType from worflow(first node) is second priority.
-                operationType = jsonUtil.getJsonValue(recipeParamsFromRequest, "operationType")
+            String resourceName = resourceInputObj.getResourceInstanceName() 
+            if (isBlank(resourceName)) {
+                msg = "Input resourceName is null"
+                msoLogger.error(msg)
             }
-            if(!StringUtils.isBlank(recipeParamsFromWf)){
-                //the operationType from worflow(first node) is highest priority.
-                operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType")
+            execution.setVariable("resourceName", resourceName)
+            msoLogger.info("resourceName:" + resourceName)
+
+            String resourceModelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid()
+            if (isBlank(resourceModelInvariantUuid)) {
+                msg = "Input resourceModelInvariantUuid is null"
+                msoLogger.error(msg)
+            }
+            execution.setVariable(Prefix + "ResourceModelInvariantUuid", resourceModelInvariantUuid)
+            msoLogger.info("resourceModelInvariantUuid:" + resourceModelInvariantUuid)
+                               
+            String resourceModelUuid = resourceInputObj.getResourceModelInfo().getModelUuid()
+            if (isBlank(resourceModelUuid)) {
+                msg = "Input resourceModelUuid is null"
+                msoLogger.error(msg)
+            }
+            execution.setVariable(Prefix + "ResourceModelUuid", resourceModelUuid)
+            msoLogger.info("resourceModelUuid:" + resourceModelUuid)
+                       
+            String resourceModelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
+            if (isBlank(resourceModelCustomizationUuid)) {
+                msg = "Input resourceModelCustomizationUuid is null"
+                msoLogger.error(msg)
             }
+            execution.setVariable(Prefix + "ResourceModelCustomizationUuid", resourceModelCustomizationUuid)
+            msoLogger.info("resourceModelCustomizationUuid:" + resourceModelCustomizationUuid)
 
             execution.setVariable(Prefix + "serviceInstanceId", resourceInputObj.getServiceInstanceId())
             execution.setVariable("mso-request-id", requestId)
@@ -103,40 +131,26 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
         } catch (BpmnError e) {
             throw e;
         } catch (Exception ex){
-            String msg = "Exception in preProcessRequest " + ex.getMessage()
+            msg = "Exception in preProcessRequest " + ex.getMessage()
             msoLogger.debug(msg)
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
         }
     }
        
-       String customizeResourceParam(String networkInputParametersJson) {
-        List<Map<String, Object>> paramList = new ArrayList();
-        JSONObject jsonObject = new JSONObject(networkInputParametersJson);
-        Iterator iterator = jsonObject.keys();
-        while (iterator.hasNext()) {
-            String key = iterator.next();
-            HashMap<String, String> hashMap = new HashMap();
-            hashMap.put("name", key);
-            hashMap.put("value", jsonObject.get(key))
-            paramList.add(hashMap)
-        }
-        Map<String, List<Map<String, Object>>> paramMap = new HashMap();
-        paramMap.put("param", paramList);
-
-        return  new JSONObject(paramMap).toString();
-    }
-       
        public void checkDevType(DelegateExecution execution){
                msoLogger.info(" ***** Started checkDevType *****")
                try {
-                       
-                       JSONObject inputParameters = execution.getVariable(Prefix + "resourceRequestInputs")
 
-                       String devType = inputParameters.get("device_class")
+                       JSONObject resourceInputParameters = execution.getVariable(Prefix + "ResourceRequestInputs")
+                       String devType = resourceInputParameters.get("device_class")
                        
                        if(StringUtils.isBlank(devType)) {
                                devType = "OTHER"
                        }
+                       // support VNF as PNF, to modify 
+                       else if(StringUtils.equalsIgnoreCase(devType, "VNF")) {
+                               devType = "PNF"
+                       }                       
                        
                        execution.setVariable("device_class", devType)
 
@@ -147,6 +161,45 @@ public class CreateDeviceResource extends AbstractServiceTaskProcessor {
                }
        }
        
+       private void setProgressUpdateVariables(DelegateExecution execution, String body) {
+               def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+               execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
+               execution.setVariable("CVFMI_updateResOperStatusRequest", body)
+       }
+       
+       public void prepareUpdateProgress(DelegateExecution execution) {
+               msoLogger.info(" ***** Started prepareUpdateProgress *****")
+               ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")
+               String operType = resourceInputObj.getOperationType()
+               String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
+               String ServiceInstanceId = resourceInputObj.getServiceInstanceId()
+               String modelName = resourceInputObj.getResourceModelInfo().getModelName()
+               String operationId = resourceInputObj.getOperationId()
+               String progress = execution.getVariable("progress")
+               String status = execution.getVariable("status")
+               String statusDescription = execution.getVariable("statusDescription")
+
+               String body = """
+                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        <soapenv:Header/>
+                <soapenv:Body>
+                    <ns:updateResourceOperationStatus>
+                               <operType>${operType}</operType>
+                               <operationId>${operationId}</operationId>
+                               <progress>${progress}</progress>
+                               <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID>
+                               <serviceId>${ServiceInstanceId}</serviceId>
+                               <status>${status}</status>
+                               <statusDescription>${statusDescription}</statusDescription>
+                    </ns:updateResourceOperationStatus>
+                </soapenv:Body>
+                </soapenv:Envelope>"""
+
+               setProgressUpdateVariables(execution, body)
+               msoLogger.info(" ***** Exit prepareUpdateProgress *****")
+       }
+       
        public void getVNFTemplatefromSDC(DelegateExecution execution){
                msoLogger.info(" ***** Started getVNFTemplatefromSDC *****")
                try {
index 37c7d4d..06346ea 100644 (file)
@@ -4,7 +4,7 @@
  * ================================================================================
  * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
  * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
  * 
 
 package org.onap.so.bpmn.infrastructure.scripts
 
+import org.json.JSONArray
 import org.json.JSONObject
 import org.json.XML
 
 import static org.apache.commons.lang3.StringUtils.*
 import groovy.xml.XmlUtil
-import groovy.json.*
 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
 import org.onap.so.bpmn.common.scripts.ExceptionUtil
 import org.onap.so.bpmn.common.scripts.ExternalAPIUtil
@@ -37,7 +37,6 @@ import org.onap.so.bpmn.core.WorkflowException
 import org.onap.so.bpmn.core.json.JsonUtils
 import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.AbstractBuilder
 import org.onap.so.rest.APIResponse
-import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
 import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory
 import java.util.UUID
 import org.onap.so.logger.MsoLogger
@@ -77,26 +76,29 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                        String resourceInput = execution.getVariable("resourceInput")
                        msoLogger.info("The resourceInput is: " + resourceInput)
                        //Get ResourceInput Object
-                       ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)                                       
+                       ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
                        // set local resourceInput
                        execution.setVariable(Prefix + "ResourceInput", resourceInputObj)
                        
                        String resourceInstanceId = resourceInputObj.getResourceInstancenUuid()
+                       String sppartnerId = resourceInstanceId
+                       execution.setVariable(Prefix + "SppartnerId", sppartnerId)
                        
                        // Get Sppartner from AAI
-                       AaiUtil aaiUriUtil = new AaiUtil(this)
+                       AaiUtil aaiUriUtil = new AaiUtil()
                        String aai_uri = aaiUriUtil.getBusinessSPPartnerUri(execution)
                        String namespace = aaiUriUtil.getNamespaceFromUri(aai_uri)                      
                        String aai_endpoint = execution.getVariable("URN_aai_endpoint")
                        String serviceAaiPath = "${aai_endpoint}${aai_uri}/" + UriUtils.encode(sppartnerId,"UTF-8")
-                       execution.setVariable(Prefix + "serviceAaiPath", serviceAaiPath)
+                       execution.setVariable(Prefix + "ServiceAaiPath", serviceAaiPath)
                        
                        getSPPartnerInAAI(execution)
                        
                        String callSource = "UUI"
                        String sppartnerUrl = ""
-                       if(execution.getVariable(Prefix + "SuccessIndicator")) {
+                       if(execution.hasVariable(Prefix + "CallSource")) {
                                callSource = execution.getVariable(Prefix + "CallSource")
+                               sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
                        }
                        
                        boolean is3rdONAPExist = false  
@@ -131,15 +133,15 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
 
        public void preProcessRequest(DelegateExecution execution){
                msoLogger.info(" ***** Started preProcessRequest *****")
+               String msg = ""
+
                try {
-                       ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput")
-                       String msg = ""                 
+                       ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")                        
 
                        String globalSubscriberId = resourceInputObj.getGlobalSubscriberId()
                        if (isBlank(globalSubscriberId)) {
                                msg = "Input globalSubscriberId is null"
-                               msoLogger.info( msg)
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               msoLogger.error( msg)
                        }
                        //set local variable
                        execution.setVariable("globalSubscriberId", globalSubscriberId)
@@ -148,8 +150,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                        String serviceType = resourceInputObj.getServiceType()
                        if (isBlank(serviceType)) {
                                msg = "Input serviceType is null"
-                               msoLogger.info( msg)
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               msoLogger.error( msg)
                        }
                        execution.setVariable("serviceType", serviceType)
                        msoLogger.info( "serviceType:" + serviceType)
@@ -157,26 +158,23 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                        String operationId = resourceInputObj.getOperationId()                  
                        if (isBlank(operationId)) {
                                msg = "Input operationId is null"
-                               msoLogger.info( msg)
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               msoLogger.error( msg)
                        }
                        execution.setVariable("operationId", operationId)
                        msoLogger.info( "operationId:" + operationId)
                        
-                       String resourceName = resourceInputObj.getResourceInstanceName()                        
+                       String resourceName = resourceInputObj.getResourceInstanceName()
                        if (isBlank(resourceName)) {
                                msg = "Input resourceName is null"
-                               msoLogger.info( msg)
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               msoLogger.error( msg)
                        }
                        execution.setVariable("resourceName", resourceName)
-                       msoLogger.info( "resourceInstanceId:" + resourceName)
+                       msoLogger.info("resourceName:" + resourceName)
                        
                        String resourceTemplateId = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
                        if (isBlank(resourceTemplateId)) {
                                msg = "Input resourceTemplateId is null"
-                               msoLogger.info( msg)
-                               exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               msoLogger.error( msg)
                        }
                        execution.setVariable("resourceTemplateId", resourceTemplateId)
                        msoLogger.info( "resourceTemplateId:" + resourceTemplateId)
@@ -184,7 +182,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                } catch (BpmnError e) {
                        throw e
                } catch (Exception ex){
-                       String msg = "Exception in preProcessRequest " + ex.getMessage()
+                       msg = "Exception in preProcessRequest " + ex.getMessage()
                        msoLogger.debug(msg)
                        exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
                }
@@ -227,7 +225,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                msoLogger.info(" ***** Started prepare3rdONAPRequest *****")
                
                String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
-               String extAPIPath = sppartnerUrl + 'serviceOrder'
+               String extAPIPath = sppartnerUrl + '/serviceOrder'
                execution.setVariable("ExternalAPIURL", extAPIPath)
                
                // ExternalAPI message format
@@ -238,8 +236,8 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                String requestedCompletionDate = utils.generateCurrentTimeInUtc()
                String priority = "1" // 0-4 0:highest
                String subscriberId = execution.getVariable("globalSubscriberId")
-               String customerRole = ""
-               String subscriberName = ""
+               String customerRole = "ONAPcustomer"
+               String subscriberName = subscriberId
                String referredType = "Consumer"
                String orderItemId = "1"
                String action = "delete" //for delete
@@ -249,7 +247,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                String serviceId = execution.getVariable(Prefix + "SppartnerId")
                
                queryServicefrom3rdONAP(execution)
-               String serviceUuId = execution.getVariable(Prefix + "serviceSpecificationId")           
+               String serviceSpecificationId = execution.getVariable(Prefix + "ServiceSpecificationId")                
                
                Map<String, String> valueMap = new HashMap<>()
                valueMap.put("externalId", '"' + externalId + '"')
@@ -266,11 +264,10 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                valueMap.put("action", '"' + action + '"')
                valueMap.put("serviceState", '"' + serviceState + '"')
                valueMap.put("serviceId", '"' + serviceId + '"')
-               valueMap.put("serviceName", '"' + serviceName + '"')
-               valueMap.put("serviceType", '"' + serviceType + '"')
-               valueMap.put("serviceUuId", '"' + serviceUuId + '"')
+               valueMap.put("serviceName", "null")
+               valueMap.put("serviceUuId", '"' + serviceSpecificationId + '"')
                
-               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)             
+               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil()
         
                valueMap.put("_requestInputs_",  "")
                
@@ -283,32 +280,45 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
        {
                msoLogger.info(" ***** Started queryServicefrom3rdONAP *****")
                
-               //https://{api_url}/nbi/api/v1/service/{serviceinstanceid}
+               String globalSubscriberId = execution.getVariable("globalSubscriberId")
+               String SppartnerServiceId = execution.getVariable(Prefix + "SppartnerId")
+
+               //https://{api_url}/nbi/api/v1/service?relatedParty.id=${globalSubscriberId}
                String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
-               String extAPIPath = sppartnerUrl + "service/" + execution.setVariable(Prefix + "SppartnerId")
-               
-               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
+               String extAPIPath = sppartnerUrl + "/service?relatedParty.id=" + globalSubscriberId
+               msoLogger.debug("queryServicefrom3rdONAP externalAPIURL is: " + extAPIPath)
+
+               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil()
 
                APIResponse response = externalAPIUtil.executeExternalAPIGetCall(execution, extAPIPath)
 
                int responseCode = response.getStatusCode()
-               execution.setVariable(Prefix + "getServiceResponseCode", responseCode)
-               utils.log("DEBUG", "Get Service response code is: " + responseCode)
+               execution.setVariable(Prefix + "GetServiceResponseCode", responseCode)
+               msoLogger.debug("Get Service response code is: " + responseCode)
 
                String extApiResponse = response.getResponseBodyAsString()
-               JSONObject responseObj = new JSONObject(extApiResponse)
-               execution.setVariable(Prefix + "getServiceResponse", extApiResponse)
+
+               execution.setVariable(Prefix + "GetServiceResponse", extApiResponse)            
+               msoLogger.debug("queryServicefrom3rdONAP response body is: " + extApiResponse)
                
                //Process Response //200 OK 201 CREATED 202 ACCEPTED
                if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
                {
-                       utils.log("DEBUG", "Get Service Received a Good Response")
-                       String serviceUuid = responseObj.get("serviceSpecification.id")
-                       execution.setVariable(Prefix + "serviceSpecificationId", serviceUuid)
+                       msoLogger.debug("Get Service Received a Good Response")
+                       JSONArray responseList = new JSONArray(extApiResponse)
+                       for(JSONObject obj : responseList) {
+                               String svcId  = obj.get("id")
+                               if(StringUtils.equalsIgnoreCase(SppartnerServiceId, svcId)) {
+                                       JSONObject serviceSpecification = obj.get("serviceSpecification")
+                                       String serviceUuid = serviceSpecification.get("id")
+                                       execution.setVariable(Prefix + "ServiceSpecificationId", serviceUuid)
+                                       break
+                               }
+                       }
                }
                else{
-                       utils.log("DEBUG", "Get Service Received a Bad Response Code. Response Code is: " + responseCode)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Service Received a bad response from 3rdONAP External API")
+                       msoLogger.error("Get Service Received a Bad Response Code. Response Code is: " + responseCode)
+//                     exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Service Received a bad response from 3rdONAP External API")
                }
                
                msoLogger.info( "Exit " + queryServicefrom3rdONAP)
@@ -319,29 +329,35 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                
                String extAPIPath = execution.getVariable("ExternalAPIURL")
                String payload = execution.getVariable(Prefix + "Payload")
+               msoLogger.debug("doDeleteE2ESIin3rdONAP externalAPIURL is: " + extAPIPath)
+               msoLogger.debug("doDeleteE2ESIin3rdONAP payload is: " + payload)
                
-               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
+               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil()
 
                APIResponse response = externalAPIUtil.executeExternalAPIPostCall(execution, extAPIPath, payload)
 
                int responseCode = response.getStatusCode()
-               execution.setVariable(Prefix + "postServiceOrderResponseCode", responseCode)
+               execution.setVariable(Prefix + "PostServiceOrderResponseCode", responseCode)
                msoLogger.debug("Post ServiceOrder response code is: " + responseCode)
 
                String extApiResponse = response.getResponseBodyAsString()
                JSONObject responseObj = new JSONObject(extApiResponse)
-               execution.setVariable(Prefix + "postServiceOrderResponse", extApiResponse)
+               execution.setVariable(Prefix + "PostServiceOrderResponse", extApiResponse)
+
+               msoLogger.debug("doDeleteE2ESIin3rdONAP response body is: " + extApiResponse)
+
                //Process Response
                if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
                        //200 OK 201 CREATED 202 ACCEPTED
                {
                        msoLogger.debug("Post ServiceOrder Received a Good Response")
-                       String serviceOrderId = responseObj.get("ServiceOrderId")
+                       String serviceOrderId = responseObj.get("id")
                        execution.setVariable(Prefix + "SuccessIndicator", true)
-                       execution.setVariable("serviceOrderId", serviceOrderId)
+                       execution.setVariable("ServiceOrderId", serviceOrderId)
+                       msoLogger.info("Post ServiceOrderid is: " + serviceOrderId)
                }
                else{
-                       msoLogger.debug("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
+                       msoLogger.error("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
                        exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Post ServiceOrder Received a bad response from 3rdONAP External API")
                }
                
@@ -354,57 +370,85 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                
                String extAPIPath = execution.getVariable("ExternalAPIURL")
                extAPIPath += "/" + execution.getVariable("ServiceOrderId")
+               msoLogger.debug("getE2ESIProgressin3rdONAP delete externalAPIURL is: " + extAPIPath)
                
-               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(this)
+               ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil()
 
                APIResponse response = externalAPIUtil.executeExternalAPIGetCall(execution, extAPIPath)
 
                int responseCode = response.getStatusCode()
-               execution.setVariable(Prefix + "getServiceOrderResponseCode", responseCode)
+               execution.setVariable(Prefix + "GetServiceOrderResponseCode", responseCode)
                msoLogger.debug("Get ServiceOrder response code is: " + responseCode)
 
                String extApiResponse = response.getResponseBodyAsString()
                JSONObject responseObj = new JSONObject(extApiResponse)
-               execution.setVariable(Prefix + "getServiceOrderResponse", extApiResponse)
+               execution.setVariable(Prefix + "GetServiceOrderResponse", extApiResponse)
                
+               utils.log("DEBUG", "getE2ESIProgressin3rdONAP delete response body is: " + extApiResponse, isDebugEnabled)
+
                //Process Response //200 OK 201 CREATED 202 ACCEPTED
-               if(responseCode == 200 || responseCode == 201 || responseCode == 202 )                  
+               if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
                {
                        msoLogger.debug("Get ServiceOrder Received a Good Response")
-                       String serviceOrderState = responseObj.get("State")
+
+                       String orderState = responseObj.get("state")
+                       if("REJECTED".equalsIgnoreCase(orderState)) {
+                               execution.setVariable("progress", 100)
+                               execution.setVariable("status", "error")
+                               execution.setVariable("statusDescription", "Delete Service Order Status is REJECTED")
+                               return
+                       }
+
+                       JSONArray items = responseObj.getJSONArray("orderItem")
+                       JSONObject item = items[0]
+                       JSONObject service = item.get("service")
+                       String sppartnerServiceId = service.get("id")
+                       if(sppartnerServiceId == null || sppartnerServiceId.equals("null")) {
+                               execution.setVariable("progress", 100)
+                               execution.setVariable("status", "error")
+                               execution.setVariable("statusDescription", "Delete Service Order Status get null sppartnerServiceId")
+                               msoLogger.error("null sppartnerServiceId while getting progress from externalAPI")
+                               return
+                       }
+                       execution.setVariable(Prefix + "SppartnerServiceId", sppartnerServiceId)
+
+                       String serviceOrderState = item.get("state")
                        execution.setVariable(Prefix + "SuccessIndicator", true)
-                       execution.setVariable("serviceOrderState", serviceOrderState)                   
-                       
+                       execution.setVariable("ServiceOrderState", serviceOrderState)
+
                        // Get serviceOrder State and process progress
                        if("ACKNOWLEDGED".equalsIgnoreCase(serviceOrderState)) {
                                execution.setVariable("progress", 15)
-                               execution.setVariable("status", "processing")                           
+                               execution.setVariable("status", "processing")
+                               execution.setVariable("statusDescription", "Delete Service Order Status is " + serviceOrderState)
                        }
-                       if("INPROGRESS".equalsIgnoreCase(serviceOrderState)) {
+                       else if("INPROGRESS".equalsIgnoreCase(serviceOrderState)) {
                                execution.setVariable("progress", 40)
                                execution.setVariable("status", "processing")
+                               execution.setVariable("statusDescription", "Delete Service Order Status is " + serviceOrderState)
                        }
-                       if("COMPLETED".equalsIgnoreCase(serviceOrderState)) {
+                       else if("COMPLETED".equalsIgnoreCase(serviceOrderState)) {
                                execution.setVariable("progress", 100)
                                execution.setVariable("status", "finished")
+                               execution.setVariable("statusDescription", "Delete Service Order Status is " + serviceOrderState)
                        }
-                       if("FAILED".equalsIgnoreCase(serviceOrderState)) {
+                       else if("FAILED".equalsIgnoreCase(serviceOrderState)) {
                                execution.setVariable("progress", 100)
                                execution.setVariable("status", "error")
+                               execution.setVariable("statusDescription", "Delete Service Order Status is " + serviceOrderState)
                        }
                        else {
                                execution.setVariable("progress", 100)
                                execution.setVariable("status", "error")
                                execution.setVariable("statusDescription", "Delete Service Order Status is unknown")
                        }
-                       execution.setVariable("statusDescription", "Delete Service Order Status is " + serviceOrderState)
                }
                else{                   
                        msoLogger.debug("Get ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
                        execution.setVariable("progress", 100)
                        execution.setVariable("status", "error")
-                       execution.setVariable("statusDescription", "Get ServiceOrder Received a bad response")
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get ServiceOrder Received a bad response from 3rdONAP External API")
+                       execution.setVariable("statusDescription", "Get Delete ServiceOrder Received a bad response")
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Delete ServiceOrder Received a bad response from 3rdONAP External API")
                }               
                
                msoLogger.info( "Exit " + getE2ESIProgressin3rdONAP)
@@ -417,15 +461,15 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                try {
                        Thread.sleep(5000)
                } catch(InterruptedException e) {
-                       utils.log("ERROR", "Time Delay exception" + e )
+                       msoLogger.error("Time Delay exception" + e )
                }
        }
 
        private void getSPPartnerInAAI(DelegateExecution execution) {
-               msoLogger.info(" ***** Started postDeleteE2ESIin3rdONAP *****") 
+               msoLogger.info(" ***** Started getSPPartnerInAAI *****")        
                
-               AaiUtil aaiUriUtil = new AaiUtil(this)
-               String serviceAaiPath = execution.getVariable(Prefix + "serviceAaiPath")                
+               AaiUtil aaiUriUtil = new AaiUtil()
+               String serviceAaiPath = execution.getVariable(Prefix + "ServiceAaiPath")                
                APIResponse response = aaiUriUtil.executeAAIGetCall(execution, serviceAaiPath)
                int responseCode = response.getStatusCode()
                execution.setVariable(Prefix + "GetSppartnerResponseCode", responseCode)
@@ -444,13 +488,13 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                        execution.setVariable(Prefix + "SuccessIndicator", true)
                        execution.setVariable(Prefix + "FoundIndicator", true)
                        
-                       String sppartnerId = utils.getNodeText1(aaiResponse, "sppartner-id")
+                       String sppartnerId = utils.getNodeText1(aaiResponse, "sp-partner-id")
                        execution.setVariable(Prefix + "SppartnerId", sppartnerId)
                        msoLogger.debug(" SppartnerId is: " + sppartnerId)
-                       String sppartnerUrl = utils.getNodeText1(aaiResponse, "sppartner-url")
+                       String sppartnerUrl = utils.getNodeText1(aaiResponse, "url")
                        execution.setVariable(Prefix + "SppartnerUrl", sppartnerUrl)
                        msoLogger.debug(" SppartnerUrl is: " + sppartnerUrl)
-                       String callSource = utils.getNodeText1(aaiResponse, "sppartner-callsource")
+                       String callSource = utils.getNodeText1(aaiResponse, "callsource")
                        execution.setVariable(Prefix + "CallSource", callSource)
                        msoLogger.debug(" CallSource is: " + callSource)
                        String sppartnerVersion = utils.getNodeText1(aaiResponse, "resource-version")
@@ -460,22 +504,22 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                else
                {
                        msoLogger.debug("Get sppartner Received a Bad Response Code. Response Code is: " + responseCode)
-                       exceptionUtil.MapAAIExceptionToWorkflowExceptionGeneric(execution, aaiResponse, responseCode)
-                       throw new BpmnError("MSOWorkflowException")
+//                     exceptionUtil.MapAAIExceptionToWorkflowExceptionGeneric(execution, aaiResponse, responseCode)
+//                     throw new BpmnError("MSOWorkflowException")
                }
                
-               msoLogger.info( "Exit " + deleteSPPartnerInAAI)
+               msoLogger.info( "Exit " + getSPPartnerInAAI)
        }
        
        public void deleteSPPartnerInAAI(DelegateExecution execution) {
-               msoLogger.info(" ***** Started postDeleteE2ESIin3rdONAP *****")
+               msoLogger.info(" ***** Started deleteSPPartnerInAAI *****")
                
                String sppartnerId = execution.getVariable(Prefix + "SppartnerId")
-               String sppartnerUrl = execution.getVariable(Prefix + "sppartnerUrl")
-               String sppartnerVersion = execution.getVariable(Prefix + "sppartnerVersion")
+               String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
+               String sppartnerVersion = execution.getVariable(Prefix + "SppartnerVersion")
                
-               AaiUtil aaiUriUtil = new AaiUtil(this)
-               String serviceAaiPath = execution.getVariable(Prefix + "serviceAaiPath") + "?resource-version=${sppartnerVersion}"
+               AaiUtil aaiUriUtil = new AaiUtil()
+               String serviceAaiPath = execution.getVariable(Prefix + "ServiceAaiPath") + "?resource-version=${sppartnerVersion}"
                APIResponse response = aaiUriUtil.executeAAIDeleteCall(execution, serviceAaiPath)
                int responseCode = response.getStatusCode()
                execution.setVariable(Prefix + "DeleteSppartnerResponseCode", responseCode)
@@ -486,8 +530,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                execution.setVariable(Prefix + "DeleteSppartnerResponse", aaiResponse)
 
                //Process Response
-               if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
-                       //200 OK 201 CREATED 202 ACCEPTED
+               if(responseCode == 200 || responseCode == 204 )         
                {
                        msoLogger.debug("Delete sppartner Received a Good Response")
                        execution.setVariable(Prefix + "SuccessIndicator", true)
@@ -499,13 +542,13 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                else
                {
                        msoLogger.debug("Delete sppartner Received a Bad Response Code. Response Code is: " + responseCode)
-                       exceptionUtil.MapAAIExceptionToWorkflowExceptionGeneric(execution, aaiResponse, responseCode)
-                       throw new BpmnError("MSOWorkflowException")
+//                     exceptionUtil.MapAAIExceptionToWorkflowExceptionGeneric(execution, aaiResponse, responseCode)
+//                     throw new BpmnError("MSOWorkflowException")
                }
                
                msoLogger.info( "Exit " + deleteSPPartnerInAAI)
        }
-       
+
        private void setProgressUpdateVariables(DelegateExecution execution, String body) {
                def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
                execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
@@ -514,8 +557,8 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
 
        public void postProcess(DelegateExecution execution){
                msoLogger.info(" ***** Started postProcess *****")
-               String responseCode = execution.getVariable(Prefix + "putSppartnerResponseCode")
-               String responseObj = execution.getVariable(Prefix + "putSppartnerResponse")
+               String responseCode = execution.getVariable(Prefix + "PutSppartnerResponseCode")
+               String responseObj = execution.getVariable(Prefix + "PutSppartnerResponse")
 
                msoLogger.info("response from AAI for put sppartner, response code :" + responseCode + "  response object :" + responseObj)
                msoLogger.info(" ***** Exit postProcess *****")
@@ -535,7 +578,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
                } catch (Exception ex) {
                        String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
                        msoLogger.debug(msg)
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+//                     exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
                }
                msoLogger.debug(" ***** Exit sendSyncResopnse *****")
        }
index 5a21fd7..71ce28d 100644 (file)
@@ -25,7 +25,6 @@ import org.json.XML;
 
 import static org.apache.commons.lang3.StringUtils.*;
 import groovy.xml.XmlUtil
-import groovy.json.*
 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
 import org.onap.so.bpmn.common.scripts.ExceptionUtil
 import org.onap.so.bpmn.common.recipe.ResourceInput;
@@ -50,8 +49,8 @@ import org.onap.so.rest.APIResponse;
 import org.onap.so.bpmn.common.scripts.AaiUtil
 
 /**
- * This groovy class supports the <class>CreateDeviceResource.bpmn</class> process.
- * flow for Device Resource Create
+ * This groovy class supports the <class>DeleteDeviceResource.bpmn</class> process.
+ * flow for Device Resource Delete
  */
 public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
 
@@ -77,25 +76,21 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
             msoLogger.info("The resourceInput is: " + resourceInput)
             //Get ResourceInput Object
             ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
-            execution.setVariable(Prefix + "resourceInput", resourceInputObj)
+            execution.setVariable(Prefix + "ResourceInput", resourceInputObj)
             String resourceInputPrameters = resourceInputObj.getResourceParameters()
             String inputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")
-            JSONObject inputParameters = new JSONObject(customizeResourceParam(inputParametersJson))
-            execution.setVariable(Prefix + "resourceRequestInputs", inputParameters)
+            JSONObject inputParameters = new JSONObject(inputParametersJson)
+            execution.setVariable(Prefix + "ResourceRequestInputs", inputParameters)
 
             //Deal with recipeParams
             String recipeParamsFromWf = execution.getVariable("recipeParamXsd")
             String resourceName = resourceInputObj.getResourceInstanceName()
-            //For sdnc requestAction default is "createNetworkInstance"
-            String operationType = "Network"
-            if(!StringUtils.isBlank(recipeParamsFromRequest)){
-                //the operationType from worflow(first node) is second priority.
-                operationType = jsonUtil.getJsonValue(recipeParamsFromRequest, "operationType")
-            }
-            if(!StringUtils.isBlank(recipeParamsFromWf)){
-                //the operationType from worflow(first node) is highest priority.
-                operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType")
-            }
+
+            String resourceInstanceId = resourceInputObj.getResourceInstancenUuid()
+            String deviceId = resourceInstanceId
+            execution.setVariable(Prefix + "DeviceId", deviceId)
+
+            getDeviceInAAI(execution)
 
             execution.setVariable(Prefix + "serviceInstanceId", resourceInputObj.getServiceInstanceId())
             execution.setVariable("mso-request-id", requestId)
@@ -104,35 +99,58 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
             throw e;
         } catch (Exception ex){
             String msg = "Exception in preProcessRequest " + ex.getMessage()
-            msoLogger.debug( msg)
+            msoLogger.debug(msg)
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
         }
     }
 
-    String customizeResourceParam(String networkInputParametersJson) {
-        List<Map<String, Object>> paramList = new ArrayList();
-        JSONObject jsonObject = new JSONObject(networkInputParametersJson);
-        Iterator iterator = jsonObject.keys();
-        while (iterator.hasNext()) {
-            String key = iterator.next();
-            HashMap<String, String> hashMap = new HashMap();
-            hashMap.put("name", key);
-            hashMap.put("value", jsonObject.get(key))
-            paramList.add(hashMap)
-        }
-        Map<String, List<Map<String, Object>>> paramMap = new HashMap();
-        paramMap.put("param", paramList);
-
-        return  new JSONObject(paramMap).toString();
-    }
+       private void getDeviceInAAI(DelegateExecution execution) {
+               msoLogger.info(" ***** Started getDeviceInAAI *****")
+               
+               String deviceId = execution.getVariable(Prefix + "DeviceId")
+               AaiUtil aaiUriUtil = new AaiUtil()
+               String aai_uri = aaiUriUtil.getNetworkDeviceUri(execution)
+               String aai_endpoint = execution.getVariable("URN_aai_endpoint")
+               String serviceAaiPath = "${aai_endpoint}${aai_uri}/" + UriUtils.encode(deviceId,"UTF-8")
+               execution.setVariable(Prefix + "ServiceAaiPath", serviceAaiPath)
+               
+               APIResponse response = aaiUriUtil.executeAAIGetCall(execution, serviceAaiPath)
+               int responseCode = response.getStatusCode()
+               execution.setVariable(Prefix + "GetDeviceResponseCode", responseCode)
+               msoLogger.debug("  Get device response code is: " + responseCode)
+
+               String aaiResponse = response.getResponseBodyAsString()
+               aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
+               aaiResponse = aaiResponse.replaceAll("&", "&amp;")
+               execution.setVariable(Prefix + "GetDeviceResponse", aaiResponse)
+
+               //Process Response
+               if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
+                       //200 OK 201 CREATED 202 ACCEPTED
+               {
+                       msoLogger.debug("GET Device Received a Good Response")
+                       execution.setVariable(Prefix + "SuccessIndicator", true)
+                       execution.setVariable(Prefix + "FoundIndicator", true)
+                       
+                       String devClass = utils.getNodeText1(aaiResponse, "device_class")
+                       execution.setVariable(Prefix + "DeviceClass", devClass)
+                       msoLogger.debug(" DeviceClass is: " + devClass)
+
+               }
+               else
+               {
+                       msoLogger.debug("Get DeviceInAAI Received a Bad Response Code. Response Code is: " + responseCode)
+
+               }
+
+               msoLogger.info(" ***** Exit getDeviceInAAI *****")
+       }
 
     public void checkDevType(DelegateExecution execution){
-        utils.log("INFO"," ***** Started checkDevType *****")
+        msoLogger.info(" ***** Started checkDevType *****")
         try {
 
-            JSONObject inputParameters = execution.getVariable(Prefix + "resourceRequestInputs")
-
-            String devType = inputParameters.get("device_class")
+            String devType = execution.getVariable(Prefix + "DeviceClass")
 
             if(StringUtils.isBlank(devType)) {
                 devType = "OTHER"
@@ -147,8 +165,47 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
         }
     }
 
+       private void setProgressUpdateVariables(DelegateExecution execution, String body) {
+               def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+               execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
+               execution.setVariable("CVFMI_updateResOperStatusRequest", body)
+       }
+
+       public void prepareUpdateProgress(DelegateExecution execution) {
+               msoLogger.info(" ***** Started prepareUpdateProgress *****")
+               ResourceInput resourceInputObj = execution.getVariable(Prefix + "ResourceInput")
+               String operType = resourceInputObj.getOperationType()
+               String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
+               String ServiceInstanceId = resourceInputObj.getServiceInstanceId()
+               String modelName = resourceInputObj.getResourceModelInfo().getModelName()
+               String operationId = resourceInputObj.getOperationId()
+               String progress = execution.getVariable("progress")
+               String status = execution.getVariable("status")
+               String statusDescription = execution.getVariable("statusDescription")
+
+               String body = """
+                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        <soapenv:Header/>
+                <soapenv:Body>
+                    <ns:updateResourceOperationStatus>
+                               <operType>${operType}</operType>
+                               <operationId>${operationId}</operationId>
+                               <progress>${progress}</progress>
+                               <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID>
+                               <serviceId>${ServiceInstanceId}</serviceId>
+                               <status>${status}</status>
+                               <statusDescription>${statusDescription}</statusDescription>
+                    </ns:updateResourceOperationStatus>
+                </soapenv:Body>
+                </soapenv:Envelope>"""
+
+               setProgressUpdateVariables(execution, body)
+               msoLogger.info(" ***** Exit prepareUpdateProgress *****")
+       }
+
     public void getVNFTemplatefromSDC(DelegateExecution execution){
-        utils.log("INFO"," ***** Started getVNFTemplatefromSDC *****")
+        msoLogger.info(" ***** Started getVNFTemplatefromSDC *****")
         try {
             // To do
 
@@ -161,7 +218,7 @@ public class DeleteDeviceResource extends AbstractServiceTaskProcessor {
     }
 
     public void postVNFInfoProcess(DelegateExecution execution){
-        utils.log("INFO"," ***** Started postVNFInfoProcess *****")
+        msoLogger.info(" ***** Started postVNFInfoProcess *****")
         try {
             // To do
 
index 26b0fea..4b84802 100644 (file)
@@ -332,38 +332,6 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
                }
        }
 
-
-       public void saveServiceInputToAAI(DelegateExecution execution) {
-               AaiUtil aaiUriUtil = new AaiUtil(this)
-
-               // create url for AAI requestInput
-               String aai_uri = aaiUriUtil.getAAIServiceInstanceUri(execution)
-               String namespace = aaiUriUtil.getNamespaceFromUri(aai_uri)
-
-               String serviceInstanceId = execution.getVariable("serviceInstanceId")
-               String serviceInstanceName = execution.getVariable("serviceInstanceName")
-               String serviceType = execution.getVariable("serviceType")
-               String uuiRequest = execution.getVariable("uuiRequest")
-
-               String payload =
-                               """< xmlns=\"${namespace}\">
-                                       <service-instance>
-                                               <service-instance-id>${serviceInstanceId}</service-instance-id>
-                                               <service-instance-name>${serviceInstanceName}</service-instance-name>
-                                               <service-type>${serviceType}</service-type>
-                                       <customer-request>${uuiRequest}</customer-request>
-                                       </service-instance>""".trim()
-               utils.logAudit(payload)
-
-               String aai_endpoint = execution.getVariable("URN_aai_endpoint")
-               String serviceAaiPath = "${aai_endpoint}${aai_uri}/" + UriUtils.encode(serviceInstanceId,"UTF-8")
-
-               APIResponse response = aaiUriUtil.executeAAIPutCall(execution, serviceAaiPath, payload)
-               int responseCode = response.getStatusCode()
-               execution.setVariable(Prefix + "PutSppartnerResponseCode", responseCode)
-       }
-
-
        public void postProcessAAIGET2(DelegateExecution execution) {
                msoLogger.trace("postProcessAAIGET2 ")
                String msg = ""
index 17dbe50..482da23 100644 (file)
@@ -104,7 +104,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
         
         String serviceModelUUID = execution.getVariable("modelUuid")      
                
-        List<Resource> addResourceList = execution.getVariable("addResourceList")        
+        List<Resource> addResourceList = execution.getVariable("addResourceList")
 
         List<NetworkResource> networkResourceList = new ArrayList<NetworkResource>()
 
@@ -149,17 +149,22 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
         }
 
         String isContainsWanResource = networkResourceList.isEmpty() ? "false" : "true"
+        //if no networkResource, get SDNC config from properties file
+        if( "false".equals(isContainsWanResource)) {
+            String serviceNeedSDNC = "mso.workflow.custom." + serviceModelName + ".sdnc.need";
+            isContainsWanResource = BPMNProperties.getProperty(serviceNeedSDNC, isContainsWanResource)
+        }
+                               
         execution.setVariable("isContainsWanResource", isContainsWanResource)
         execution.setVariable("currentResourceIndex", 0)
         execution.setVariable("sequencedResourceList", sequencedResourceList)
         msoLogger.info("sequencedResourceList: " + sequencedResourceList) 
         msoLogger.trace("COMPLETED sequenceResoure Process ")
-    }   
-   
+    }
+
     public prepareServiceTopologyRequest(DelegateExecution execution) {
 
-        def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
-        utils.log("INFO", "======== Start prepareServiceTopologyRequest Process ======== ", isDebugEnabled)
+        msoLogger.trace("======== Start prepareServiceTopologyRequest Process ======== ")
 
         String serviceDecompose = execution.getVariable("serviceDecomposition")
 
@@ -174,7 +179,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
         execution.setVariable("modelUuid", serviceUuid)
         execution.setVariable("serviceModelName", serviceModelName)
 
-        utils.log("INFO", "======== End prepareServiceTopologyRequest Process ======== ", isDebugEnabled)
+        msoLogger.trace("======== End prepareServiceTopologyRequest Process ======== ")
     }
    
     public void getCurrentResoure(DelegateExecution execution){
@@ -205,7 +210,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
                 msoLogger.trace("Start prepareResourceRecipeRequest Process ")
                 ResourceInput resourceInput = new ResourceInput()
                 String serviceInstanceName = execution.getVariable("serviceInstanceName")
-         String resourceType = execution.getVariable("resourceType")
+                String resourceType = execution.getVariable("resourceType")
                 String resourceInstanceName = resourceType + "_" + serviceInstanceName
                 resourceInput.setResourceInstanceName(resourceInstanceName)
                 msoLogger.info("Prepare Resource Request resourceInstanceName:" + resourceInstanceName)
@@ -252,19 +257,19 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
                         String requestAction = "createInstance"
                         JSONObject resourceRecipe = cutils.getResourceRecipe(execution, resourceInput.getResourceModelInfo().getModelUuid(), requestAction)
 
-                if (resourceRecipe != null) {
-                        String recipeURL = BPMNProperties.getProperty("bpelURL", "http://mso:8080") + resourceRecipe.getString("orchestrationUri")
-                                int recipeTimeOut = resourceRecipe.getInt("recipeTimeout")
-                                String recipeParamXsd = resourceRecipe.get("paramXSD")
-                                HttpResponse resp = BpmnRestClient.post(recipeURL, requestId, recipeTimeOut, requestAction, serviceInstanceId, serviceType, resourceInput.toString(), recipeParamXsd)
-                } else {
-                    String exceptionMessage = "Resource receipe is not found for resource modeluuid: " +
+                        if (resourceRecipe != null) {
+                            String recipeURL = BPMNProperties.getProperty("bpelURL", "http://mso:8080") + resourceRecipe.getString("orchestrationUri")
+                            int recipeTimeOut = resourceRecipe.getInt("recipeTimeout")
+                            String recipeParamXsd = resourceRecipe.get("paramXSD")
+                            HttpResponse resp = BpmnRestClient.post(recipeURL, requestId, recipeTimeOut, requestAction, serviceInstanceId, serviceType, resourceInput.toString(), recipeParamXsd)
+                        } else {
+                            String exceptionMessage = "Resource receipe is not found for resource modeluuid: " +
                             resourceInput.getResourceModelInfo().getModelUuid()
-                    msoLogger.trace(exceptionMessage)
-                    exceptionUtil.buildAndThrowWorkflowException(execution, 500, exceptionMessage)
-                }
+                            msoLogger.trace(exceptionMessage)
+                            exceptionUtil.buildAndThrowWorkflowException(execution, 500, exceptionMessage)
+                        }
 
-                msoLogger.trace("======== end executeResourceRecipe Process ======== ")
+                        msoLogger.trace("======== end executeResourceRecipe Process ======== ")
                 }catch(BpmnError b){
                         msoLogger.debug("Rethrowing MSOWorkflowException")
                         throw b
@@ -273,7 +278,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
                         exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured during DoCreateResources executeResourceRecipe Catalog")
                 }
         }
-        
+
      public void postConfigRequest(DelegateExecution execution){
          //now do noting
      }
index 76dba27..66bd1ec 100644 (file)
@@ -28,13 +28,15 @@ import org.apache.commons.lang3.*
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.delegate.DelegateExecution
 import org.json.JSONArray
-import org.json.JSONObject;
+import org.json.JSONObject
+import org.onap.so.bpmn.common.scripts.AaiUtil
 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
 import org.onap.so.bpmn.common.scripts.ExceptionUtil
 import org.onap.so.bpmn.common.scripts.MsoUtils
 import org.onap.so.bpmn.core.WorkflowException
 import org.onap.so.bpmn.core.domain.Resource
-import org.onap.so.bpmn.core.domain.ServiceDecomposition;
+import org.onap.so.bpmn.core.domain.ServiceDecomposition
+import org.onap.so.rest.APIResponse
 import org.onap.so.bpmn.core.json.JsonUtils
 import org.springframework.web.util.UriUtils;
 import org.w3c.dom.Document
@@ -314,9 +316,9 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
                JSONObject jObj = new JSONObject()
                
                def relation  = utils.nodeToString(node)
-               def rt  = utils.getNodeText1(relation, "related-to")
+               def rt  = utils.getNodeText(relation, "related-to")
                
-               def rl  = utils.getNodeText1(relation, "related-link")
+               def rl  = utils.getNodeText(relation, "related-link")
                utils.log("INFO", "ServiceInstance Related NS/Configuration :" + rl, isDebugEnabled)
                
                def rl_datas = utils.getIdenticalChildren(node, "relationship-data")
@@ -331,16 +333,13 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
                                jObj.put("resourceInstanceId", eValue)
                        }
                        // for sp-partner and others
-                       else if(eKey.equals(rt + ".id")){                               
-                               jObj.put("resourceInstanceId", eValue)
-                               String resourceName = rt + eValue;
-                               jObj.put("resourceType", resourceName)
-                       }
-                       else if(eKey.equals(rt + ".id")){                               
+                       else if(eKey.endsWith("-id")){
                                jObj.put("resourceInstanceId", eValue)
                                String resourceName = rt + eValue;
                                jObj.put("resourceType", resourceName)
                        }
+
+                       jObj.put("resourceLinkUrl", rl)
                }
 
                def rl_props = utils.getIdenticalChildren(node, "related-to-property")
@@ -398,6 +397,71 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
         }
     }
 
+       private void generateRelatedResourceInfo(String response, JSONObject jObj){
+               
+               def xml = new XmlSlurper().parseText(response)
+               def rtn = xml.childNodes()
+               while (rtn.hasNext()) {
+                       groovy.util.slurpersupport.Node node = rtn.next()
+                       def key = node.name()
+                       def value = node.text()
+                       jObj.put(key, value)
+               }
+       }
+       
+       private JSONObject getRelatedResourceInAAI (DelegateExecution execution, JSONObject jObj)
+       {
+               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+               utils.log("INFO"," ***** Started getRelatedResourceInAAI *****",  isDebugEnabled)               
+                       
+               AaiUtil aaiUriUtil = new AaiUtil()
+               String aai_endpoint = execution.getVariable("URN_aai_endpoint")
+               String urlLink = jObj.get("resourceLinkUrl")
+               String serviceAaiPath = "${aai_endpoint}${urlLink}"
+               APIResponse response = aaiUriUtil.executeAAIGetCall(execution, serviceAaiPath)
+               int responseCode = response.getStatusCode()
+               execution.setVariable(Prefix + "GeRelatedResourceResponseCode", responseCode)
+               utils.log("DEBUG", "  Get RelatedResource code is: " + responseCode, isDebugEnabled)
+
+               String aaiResponse = response.getResponseBodyAsString()
+               aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
+               aaiResponse = aaiResponse.replaceAll("&", "&amp;")
+               execution.setVariable(Prefix + "GetRelatedResourceResponse", aaiResponse)
+               
+               //Process Response
+               if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
+                       //200 OK 201 CREATED 202 ACCEPTED
+               {
+                       utils.log("DEBUG", "GET RelatedResource Received a Good Response", isDebugEnabled)
+                       execution.setVariable(Prefix + "SuccessIndicator", true)
+                       execution.setVariable(Prefix + "FoundIndicator", true)
+                       
+                       generateRelatedResourceInfo(aaiResponse, jObj)
+                       
+                       //get model-invariant-uuid and model-uuid
+                       String modelInvariantId = ""
+                       String modelUuid = ""
+                       String modelCustomizationId = ""
+                       if(jObj.has("model-invariant-id")) {
+                               modelInvariantId = jObj.get("model-invariant-id")
+                               modelUuid = jObj.get("model-version-id")
+                               modelCustomizationId = jObj.get("model-customization-id")
+                       }
+                       
+                       jObj.put("modelInvariantId", modelInvariantId)                  
+                       jObj.put("modelVersionId", modelUuid)                   
+                       jObj.put("modelCustomizationId", modelCustomizationId)
+               }
+               else
+               {
+                       utils.log("ERROR", "Get RelatedResource Received a Bad Response Code. Response Code is: " + responseCode, isDebugEnabled)                       
+               }
+               
+               utils.log("INFO", " ***** Exit getRelatedResourceInAAI *****", isDebugEnabled)
+               return jObj;    
+               
+       }
+
     public void postDecomposeService(DelegateExecution execution) {
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
 
@@ -417,27 +481,38 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
             if (serviceRelationShip != null) {
                 relationShipList = jsonSlurper.parseText(serviceRelationShip)
             }
-                       
-            List<Resource> deleteRealResourceList = new ArrayList<Resource>();
+
+            List<Resource> deleteRealResourceList = new ArrayList<Resource>()
 
             //Set the real resource instance id to the decomosed resource list
-            for (Resource resource: deleteResourceList) {
-                //reset the resource instance id , because in the decompose flow ,its a random one.
-                resource.setResourceId("");
-                //match the resource-instance-name and the model name
-                if (relationShipList != null) {
-                    relationShipList.each {
-                        if (StringUtils.containsIgnoreCase(it.resourceType, resource.getModelInfo().getModelName())) {
-                            resource.setResourceId(it.resourceInstanceId)
+            //reset the resource instance id , because in the decompose flow ,its a random one.
+            //match the resource-instance-name and the model name
+            if (relationShipList != null) {
+                relationShipList.each {
+
+                    JSONObject obj = getRelatedResourceInAAI(execution, (JSONObject)it)
+                                       
+                    for (Resource resource : deleteResourceList) {
+
+                        String modelName = resource.getModelInfo().getModelName()
+
+                        String modelCustomizationUuid = resource.getModelInfo().getModelCustomizationUuid()
+                        if (StringUtils.containsIgnoreCase(obj.get("resourceType"), modelName)) {
+                            resource.setResourceId(obj.get("resourceInstanceId"))
+                            deleteRealResourceList.add(resource)
+                        }
+                        else if (modelCustomizationUuid.equals(obj.get("modelCustomizationId"))) {
+                            resource.setResourceId(obj.get("resourceInstanceId"))
+                            resource.setResourceInstanceName(obj.get("resourceType"))
                             deleteRealResourceList.add(resource)
                         }
                     }
                 }
-            }
-                       
+            }          
+
             // only delete real existing resources
             execution.setVariable("deleteResourceList", deleteRealResourceList)
-                       
+
             utils.log("DEBUG", "delete resource list : " + deleteRealResourceList, isDebugEnabled)
         } catch (Exception ex) {
             String exceptionMessage = "Bpmn error encountered in  create generic e2e service flow. processDecomposition() - " + ex.getMessage()
index a5a96f3..cf0bd3f 100644 (file)
@@ -150,8 +150,11 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
 
         // get delete resource list and order list
         List<Resource> delResourceList = execution.getVariable("deleteResourceList")
+
+        ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+        String serviceModelName = serviceDecomposition.getModelInfo().getModelName();
         
-        def resourceSequence = BPMNProperties.getResourceSequenceProp()
+        def resourceSequence = BPMNProperties.getResourceSequenceProp(serviceModelName)
 
         if(resourceSequence != null) {
             for (resourceType in resourceSequence.reverse()) {
@@ -186,6 +189,11 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
         }
 
         String isContainsWanResource = wanResources.isEmpty() ? "false" : "true"
+        //if no networkResource, get SDNC config from properties file
+        if( "false".equals(isContainsWanResource)) {
+            String serviceNeedSDNC = "mso.workflow.custom." + serviceModelName + ".sdnc.need";
+            isContainsWanResource = BPMNProperties.getProperty(serviceNeedSDNC, isContainsWanResource)
+        }
         execution.setVariable("isContainsWanResource", isContainsWanResource)
         execution.setVariable("currentResourceIndex", 0)
         execution.setVariable("sequencedResourceList", sequencedResourceList)
@@ -244,7 +252,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
                resourceInput.setResourceInstanceName(currentResource.getResourceInstanceName())
                resourceInput.setResourceInstancenUuid(currentResource.getResourceId())
                resourceInput.setOperationId(execution.getVariable("operationId"))
-        resourceInput.setOperationType(execution.getVariable("operationType"))
+               resourceInput.setOperationType(execution.getVariable("operationType"))
                String globalSubscriberId = execution.getVariable("globalSubscriberId") 
                resourceInput.setGlobalSubscriberId(globalSubscriberId)
                resourceInput.setResourceModelInfo(currentResource.getModelInfo());
index 6346309..98e552f 100644 (file)
@@ -21,6 +21,7 @@
 package org.onap.so.bpmn.infrastructure.workflow.service;
 
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.net.SocketTimeoutException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -54,6 +55,7 @@ import org.onap.so.bpmn.common.scripts.AaiUtil;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
+import org.springframework.web.util.UriUtils;
 
 public class ServicePluginFactory {
 
@@ -79,6 +81,10 @@ public class ServicePluginFactory {
                }
                return instance;
        }
+
+       private ServicePluginFactory() {
+
+       }
        
        private String getInventoryOSSEndPoint(){
                return UrnPropertiesReader.getVariable("mso.service-plugin.inventory-oss-endpoint", INVENTORY_OSS_DEFAULT_ENDPOINT);
@@ -110,13 +116,18 @@ public class ServicePluginFactory {
                        return newRequest;
                }
 
-               List<Resource> addResourceList = serviceDecomposition.getServiceResources();
+               List<Resource> addResourceList = new ArrayList<Resource>();
+               addResourceList.addAll(serviceDecomposition.getServiceResources());
+               
+               serviceDecomposition.setVnfResources(null);
+               serviceDecomposition.setAllottedResources(null);
+               serviceDecomposition.setNetworkResources(null);
+               serviceDecomposition.setConfigResources(null);
                for (Resource resource : addResourceList) {
                        String resourcemodelName = resource.getModelInfo().getModelName();
-                       if (!StringUtils.containsIgnoreCase(resourcemodelName, "sp-partner") 
-                                       || !StringUtils.containsIgnoreCase(resourcemodelName, "sppartner")) {
+                       if (StringUtils.containsIgnoreCase(resourcemodelName, "sppartner")) {
                                // change serviceDecomposition
-                               serviceDecomposition.deleteResource(resource);
+                               serviceDecomposition.addResource(resource);
                                break;
                        }
                }
@@ -149,7 +160,7 @@ public class ServicePluginFactory {
                accessTPInfo.put("access-ltp-id", tpInfoMap.get("access-ltp-id"));
 
                // change resources
-               String resourceName = (String) accessTPInfo.get("resourceName");
+               String resourceName = (String) tpInfoMap.get("resourceName");
                for(Object curResource : resources) {
                        Map<String, Object> resource = (Map<String, Object>)curResource;
                        String curResourceName = (String) resource.get("resourceName");
@@ -165,9 +176,9 @@ public class ServicePluginFactory {
        
        @SuppressWarnings("unchecked")
        private Map<String, Object> getTPforVPNAttachment(Map<String, Object> serviceRequestInputs) {
-               Object location = "";
-               Object clientSignal = "";
-               String vpnAttachmentResourceName = "";
+               Object location = null;
+               Object clientSignal = null;
+               String vpnAttachmentResourceName = null;
 
                // support R2 uuiReq and R1 uuiReq
                // logic for R2 uuiRequest params in service level
@@ -185,7 +196,7 @@ public class ServicePluginFactory {
                Map<String, Object> tpInfoMap =  new HashMap<String, Object>();
                
                // Site resource has location param and SOTNAttachment resource has clientSignal param
-               if("".equals(location) || "".equals(clientSignal) ) {
+               if(location == null || clientSignal == null ) {
                        return tpInfoMap;
                }
                
@@ -193,9 +204,16 @@ public class ServicePluginFactory {
                String locationAddress = (String) location;             
                List<Object> locationTPList = queryAccessTPbyLocationFromInventoryOSS(locationAddress);
                if(locationTPList != null && !locationTPList.isEmpty()) {
-                       tpInfoMap = (Map<String, Object>) locationTPList.get(0);
-                       // add resourceName
-                       tpInfoMap.put("resourceName", vpnAttachmentResourceName);
+                   for(Object tp: locationTPList) {
+                       Map<String, Object> tpJson = (Map<String, Object>) tp;
+                       String loc =  (String)tpJson.get ("location");
+                       if(StringUtils.equalsIgnoreCase (locationAddress, loc)) {
+                           tpInfoMap = tpJson;
+                           // add resourceName
+                           tpInfoMap.put("resourceName", vpnAttachmentResourceName);
+                           break;
+                       }
+                   }
                        LOGGER.debug("Get Terminal TP from InventoryOSS");
                        return tpInfoMap;
                }
@@ -205,11 +223,14 @@ public class ServicePluginFactory {
        
        @SuppressWarnings("unchecked")
        private List<Object> queryAccessTPbyLocationFromInventoryOSS(String locationAddress) {
-               Map<String, String> locationSrc = new HashMap<String, String>();
-               locationSrc.put("location", locationAddress);
-               String reqContent = getJsonString(locationSrc);
                String url = getInventoryOSSEndPoint();
-               String responseContent = sendRequest(url, "POST", reqContent);
+               try {
+                       url += "/oss/inventory?location=" +  UriUtils.encode(locationAddress,"UTF-8");
+               } catch (UnsupportedEncodingException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+               String responseContent = sendRequest(url, "GET", "");
                List<Object> accessTPs = new ArrayList<Object>();
                if (null != responseContent) {
                        accessTPs = getJsonObject(responseContent, List.class);
@@ -227,8 +248,14 @@ public class ServicePluginFactory {
                if(resource.containsKey("parameters")) {
                        Map<String, Object> resParametersObject = (Map<String, Object>) resource.get("parameters");
                        if(resParametersObject.containsKey("requestInputs")) {
-                               Map<String, Object> resRequestInputs = (Map<String, Object>) resourceParametersObject.get("requestInputs");
-                               resRequestInputs.putAll(resourceInputs);                                
+                               Map<String, Object> resRequestInputs = (Map<String, Object>) resourceRequestInputs.get("requestInputs");
+                               Map<String, Object> oldRequestInputs = (Map<String, Object>) resParametersObject.get("requestInputs");
+                               if(oldRequestInputs != null) {                                  
+                                       oldRequestInputs.putAll(resRequestInputs);
+                               }
+                               else {
+                                       resParametersObject.put("requestInputs", resRequestInputs);
+                               }
                        }
                        else {
                                resParametersObject.putAll(resourceRequestInputs);                              
@@ -267,14 +294,20 @@ public class ServicePluginFactory {
                        if("ExternalAPI".equalsIgnoreCase(callSource)) {
                                return false;
                        }                                                       
-               }                               
-               return true;
+               }
+               for (String input : serviceRequestInputs.keySet())
+               {
+                       if(input.toLowerCase().contains("sotnconnectivity")) {
+                               return true;
+                       }
+               }
+               return false;
        }
        
        @SuppressWarnings("unchecked")
        private void allocateCrossTPResources(DelegateExecution execution, Map<String, Object> serviceRequestInputs) {
 
-               AaiUtil aai = new AaiUtil(null);
+               AaiUtil aai = new AaiUtil();
                Map<String, Object> crossTPs = aai.getTPsfromAAI(execution);
                
                if(crossTPs == null || crossTPs.isEmpty()) {
@@ -581,6 +614,8 @@ public class ServicePluginFactory {
                        } else if ("GET".equals(methodType.toUpperCase())) {
                                HttpGet httpGet = new HttpGet(msbUrl);
                                httpGet.setConfig(requestConfig);
+                               httpGet.addHeader("X-FromAppId", "MSO");
+                               httpGet.addHeader("Accept","application/json");
                                method = httpGet;
                        } else if ("DELETE".equals(methodType.toUpperCase())) {
                                HttpDelete httpDelete = new HttpDelete(msbUrl);
index 21f18e9..6a7cf81 100644 (file)
@@ -14,7 +14,7 @@ dcsi.prepare3rdONAPRequest(execution)]]></bpmn:script>
     <bpmn:endEvent id="EndEvent_013449q" name="Create3rdONAPRES_End">
       <bpmn:incoming>SequenceFlow_0a8k9xi</bpmn:incoming>
     </bpmn:endEvent>
-    <bpmn:scriptTask id="ScriptTask_1b88nnk" name="Save SPPartner In AAI">
+    <bpmn:scriptTask id="ScriptTask_1b88nnk" name="Save SPPartner In AAI" scriptFormat="groovy">
       <bpmn:incoming>SequenceFlow_0y2g8mr</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0znwu8z</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
@@ -93,7 +93,7 @@ dcsi.doCreateE2ESIin3rdONAP(execution)]]></bpmn:script>
           <camunda:connectorId>http-connector</camunda:connectorId>
         </camunda:connector>
       </bpmn:extensionElements>
-      <bpmn:incoming>SequenceFlow_0fkfn70</bpmn:incoming>
+      <bpmn:incoming>SequenceFlow_03ouq4m</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1luhljs</bpmn:outgoing>
     </bpmn:serviceTask>
     <bpmn:scriptTask id="ScriptTask_03xvdc8" name="Allocate connection resources for cross ONAP" scriptFormat="groovy">
@@ -167,7 +167,7 @@ dcsi.checkLocallCall(execution)]]></bpmn:script>
     <bpmn:endEvent id="EndEvent_0o0n3fa" name="Create3rdONAPRES_End">
       <bpmn:incoming>SequenceFlow_131f1jj</bpmn:incoming>
     </bpmn:endEvent>
-    <bpmn:scriptTask id="ScriptTask_1lazb8l" name="Save SPPartner In AAI">
+    <bpmn:scriptTask id="ScriptTask_1lazb8l" name="Save SPPartner In AAI" scriptFormat="groovy">
       <bpmn:incoming>SequenceFlow_1wq9f5k</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_18gb81f</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
@@ -191,7 +191,7 @@ execution.setVariable("statusDescription", "Local Creation Only")
 def dcsi = new Create3rdONAPE2EServiceInstance()
 dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
     </bpmn:scriptTask>
-    <bpmn:serviceTask id="ServiceTask_1kgvq5e" name="update progress update">
+    <bpmn:serviceTask id="ServiceTask_1kgvq5e" name="resource progress update">
       <bpmn:extensionElements>
         <camunda:connector>
           <camunda:inputOutput>
@@ -276,9 +276,9 @@ csi.sendSyncResponse(execution)]]></bpmn:script>
     <bpmn:sequenceFlow id="SequenceFlow_15mvx68" sourceRef="ScriptTask_0rs5t7w" targetRef="ScriptTask_0r2cxvb" />
     <bpmn:sequenceFlow id="SequenceFlow_0wp73cw" sourceRef="ScriptTask_0r2cxvb" targetRef="ExclusiveGateway_1662gjm" />
     <bpmn:sequenceFlow id="SequenceFlow_13s0mg5" name="yes" sourceRef="ExclusiveGateway_1662gjm" targetRef="ScriptTask_0yz8d8c">
-      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("serviceOrderId" )  != null && execution.getVariable("serviceOrderId" )  != "" )}]]></bpmn:conditionExpression>
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("ServiceOrderId" )  != null && execution.getVariable("ServiceOrderId" )  != "" )}]]></bpmn:conditionExpression>
     </bpmn:sequenceFlow>
-    <bpmn:sequenceFlow id="SequenceFlow_0fkfn70" sourceRef="ScriptTask_0yz8d8c" targetRef="ServiceTask_0p5029r" />
+    <bpmn:sequenceFlow id="SequenceFlow_0fkfn70" sourceRef="ScriptTask_0yz8d8c" targetRef="ScriptTask_0lffwny" />
     <bpmn:sequenceFlow id="SequenceFlow_1suwdgi" sourceRef="ServiceTask_039ju3f" targetRef="ScriptTask_03xvdc8" />
     <bpmn:sequenceFlow id="SequenceFlow_0kkou66" sourceRef="ScriptTask_1pdhttw" targetRef="ScriptTask_0yz8d8c" />
     <bpmn:sequenceFlow id="SequenceFlow_1luhljs" sourceRef="ServiceTask_0p5029r" targetRef="ExclusiveGateway_1we7izu" />
@@ -327,6 +327,14 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
     </bpmn:serviceTask>
     <bpmn:sequenceFlow id="SequenceFlow_0i9iiuo" sourceRef="ScriptTask_07cq0pw" targetRef="ServiceTask_1ixmamy" />
     <bpmn:sequenceFlow id="SequenceFlow_1mei7hu" sourceRef="ServiceTask_1ixmamy" targetRef="EndEvent_19joonf" />
+    <bpmn:scriptTask id="ScriptTask_0lffwny" name="update resource progress" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_0fkfn70</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_03ouq4m</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new Create3rdONAPE2EServiceInstance()
+dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="SequenceFlow_03ouq4m" sourceRef="ScriptTask_0lffwny" targetRef="ServiceTask_0p5029r" />
   </bpmn:process>
   <bpmn:error id="Error_0nbdy47" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
@@ -365,7 +373,7 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
         <dc:Bounds x="163" y="12" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_0p5029r_di" bpmnElement="ServiceTask_0p5029r">
-        <dc:Bounds x="798" y="12" width="100" height="80" />
+        <dc:Bounds x="798" y="129" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_03xvdc8_di" bpmnElement="ScriptTask_03xvdc8">
         <dc:Bounds x="798" y="-153" width="100" height="80" />
@@ -600,7 +608,7 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_1pdhttw_di" bpmnElement="ScriptTask_1pdhttw">
-        <dc:Bounds x="573" y="187" width="100" height="80" />
+        <dc:Bounds x="573" y="220" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ExclusiveGateway_1662gjm_di" bpmnElement="ExclusiveGateway_1662gjm" isMarkerVisible="true">
         <dc:Bounds x="386" y="27" width="50" height="50" />
@@ -609,9 +617,9 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ExclusiveGateway_1we7izu_di" bpmnElement="ExclusiveGateway_1we7izu" isMarkerVisible="true">
-        <dc:Bounds x="823" y="202" width="50" height="50" />
+        <dc:Bounds x="823" y="235" width="50" height="50" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="880" y="206" width="68" height="42" />
+          <dc:Bounds x="878" y="239" width="72" height="36" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_18auy29_di" bpmnElement="ScriptTask_18auy29">
@@ -649,9 +657,11 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0fkfn70_di" bpmnElement="SequenceFlow_0fkfn70">
         <di:waypoint xsi:type="dc:Point" x="673" y="52" />
+        <di:waypoint xsi:type="dc:Point" x="736" y="52" />
+        <di:waypoint xsi:type="dc:Point" x="736" y="52" />
         <di:waypoint xsi:type="dc:Point" x="798" y="52" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="690.5" y="30" width="90" height="14" />
+          <dc:Bounds x="706" y="45" width="90" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1suwdgi_di" bpmnElement="SequenceFlow_1suwdgi">
@@ -662,24 +672,24 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0kkou66_di" bpmnElement="SequenceFlow_0kkou66">
-        <di:waypoint xsi:type="dc:Point" x="623" y="187" />
+        <di:waypoint xsi:type="dc:Point" x="623" y="220" />
         <di:waypoint xsi:type="dc:Point" x="623" y="92" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="593" y="132.5" width="90" height="14" />
+          <dc:Bounds x="593" y="149" width="90" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1luhljs_di" bpmnElement="SequenceFlow_1luhljs">
-        <di:waypoint xsi:type="dc:Point" x="848" y="92" />
-        <di:waypoint xsi:type="dc:Point" x="848" y="202" />
+        <di:waypoint xsi:type="dc:Point" x="848" y="209" />
+        <di:waypoint xsi:type="dc:Point" x="848" y="235" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="818" y="140" width="90" height="14" />
+          <dc:Bounds x="818" y="215" width="90" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1udji9x_di" bpmnElement="SequenceFlow_1udji9x">
-        <di:waypoint xsi:type="dc:Point" x="823" y="227" />
-        <di:waypoint xsi:type="dc:Point" x="673" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="823" y="260" />
+        <di:waypoint xsi:type="dc:Point" x="673" y="260" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="746" y="208" width="12" height="14" />
+          <dc:Bounds x="746" y="241" width="12" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="EndEvent_19joonf_di" bpmnElement="EndEvent_19joonf">
@@ -698,12 +708,12 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0y2g8mr_di" bpmnElement="SequenceFlow_0y2g8mr">
-        <di:waypoint xsi:type="dc:Point" x="848" y="252" />
+        <di:waypoint xsi:type="dc:Point" x="848" y="285" />
         <di:waypoint xsi:type="dc:Point" x="848" y="324" />
         <di:waypoint xsi:type="dc:Point" x="9" y="324" />
         <di:waypoint xsi:type="dc:Point" x="9" y="371" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="419.8991436726927" y="302" width="18" height="14" />
+          <dc:Bounds x="419" y="302" width="19" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0mmu3kz_di" bpmnElement="SequenceFlow_0mmu3kz">
@@ -735,6 +745,16 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
           <dc:Bounds x="326.5" y="193" width="0" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_0lffwny_di" bpmnElement="ScriptTask_0lffwny">
+        <dc:Bounds x="798" y="12" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_03ouq4m_di" bpmnElement="SequenceFlow_03ouq4m">
+        <di:waypoint xsi:type="dc:Point" x="848" y="92" />
+        <di:waypoint xsi:type="dc:Point" x="848" y="129" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="863" y="104.5" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>
index 3e2c316..3c7be09 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3">
-  <bpmn:process id="CreateDeviceResource.bpmn" name="CreateDeviceResource.bpmn" isExecutable="true">
+  <bpmn:process id="CreateDeviceResource" name="CreateDeviceResource" isExecutable="true">
     <bpmn:endEvent id="EndEvent_1x6k78c" name="create Dev end">
       <bpmn:incoming>SequenceFlow_0auvfvm</bpmn:incoming>
     </bpmn:endEvent>
@@ -8,7 +8,7 @@
       <bpmn:incoming>SequenceFlow_05niqbf</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0auvfvm</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
-def csi = new  CreateDeviceResource.bpmn()
+def csi = new  CreateDeviceResource()
 csi.sendSyncResponse(execution)]]></bpmn:script>
     </bpmn:scriptTask>
     <bpmn:sequenceFlow id="SequenceFlow_05niqbf" sourceRef="Task_0bga3e8" targetRef="ScriptTask_1g5zyi6" />
@@ -43,11 +43,11 @@ csi.sendSyncResponse(execution)]]></bpmn:script>
 def dcsi = new CreateDeviceResource()
 dcsi.checkDevType(execution)]]></bpmn:script>
     </bpmn:scriptTask>
-    <bpmn:exclusiveGateway id="ExclusiveGateway_0kba700" name="Dev Type" default="SequenceFlow_076ma0v">
+    <bpmn:exclusiveGateway id="ExclusiveGateway_0kba700" name="Dev Type" default="SequenceFlow_0b5nrig">
       <bpmn:incoming>SequenceFlow_1hp2h5t</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1ss02ik</bpmn:outgoing>
       <bpmn:outgoing>SequenceFlow_0h4378g</bpmn:outgoing>
-      <bpmn:outgoing>SequenceFlow_076ma0v</bpmn:outgoing>
+      <bpmn:outgoing>SequenceFlow_0b5nrig</bpmn:outgoing>
     </bpmn:exclusiveGateway>
     <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1chnlq6" name="GoTo StartCreateDevinSDNC">
       <bpmn:incoming>SequenceFlow_0h4378g</bpmn:incoming>
@@ -91,10 +91,6 @@ dcsi.preProcessRequest(execution)]]></bpmn:script>
       <bpmn:outgoing>SequenceFlow_0pkp4ce</bpmn:outgoing>
     </bpmn:callActivity>
     <bpmn:sequenceFlow id="SequenceFlow_0pkp4ce" sourceRef="CallActivity_0pyrfca" targetRef="ScriptTask_0u1piih" />
-    <bpmn:endEvent id="EndEvent_0ymfq61">
-      <bpmn:incoming>SequenceFlow_076ma0v</bpmn:incoming>
-    </bpmn:endEvent>
-    <bpmn:sequenceFlow id="SequenceFlow_076ma0v" sourceRef="ExclusiveGateway_0kba700" targetRef="EndEvent_0ymfq61" />
     <bpmn:scriptTask id="ScriptTask_02rli65" name="Get VNF Template fom SDC" scriptFormat="groovy">
       <bpmn:incoming>SequenceFlow_1ss02ik</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0pg3072</bpmn:outgoing>
@@ -111,9 +107,47 @@ def dcsi = new CreateDeviceResource()
 dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
     </bpmn:scriptTask>
     <bpmn:sequenceFlow id="SequenceFlow_1ylvnxq" sourceRef="ScriptTask_0u1piih" targetRef="IntermediateThrowEvent_1caax8u" />
+    <bpmn:scriptTask id="ScriptTask_0p4b5vu" name="Prepare Create resource progress" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_0b5nrig</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_09s5dfc</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+execution.setVariable("progress", "100")
+execution.setVariable("status", "finished")
+execution.setVariable("statusDescription", "Finished for the devType")
+def dcsi = new CreateDeviceResource()
+dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="SequenceFlow_0b5nrig" sourceRef="ExclusiveGateway_0kba700" targetRef="ScriptTask_0p4b5vu" />
+    <bpmn:serviceTask id="ServiceTask_08e6hpm" name="resource progress update">
+      <bpmn:extensionElements>
+        <camunda:connector>
+          <camunda:inputOutput>
+            <camunda:inputParameter name="url">${CVFMI_dbAdapterEndpoint}</camunda:inputParameter>
+            <camunda:inputParameter name="headers">
+              <camunda:map>
+                <camunda:entry key="content-type">application/soap+xml</camunda:entry>
+                <camunda:entry key="Authorization">Basic QlBFTENsaWVudDpwYXNzd29yZDEk</camunda:entry>
+              </camunda:map>
+            </camunda:inputParameter>
+            <camunda:inputParameter name="payload">${CVFMI_updateResOperStatusRequest}</camunda:inputParameter>
+            <camunda:inputParameter name="method">POST</camunda:inputParameter>
+            <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter>
+            <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter>
+          </camunda:inputOutput>
+          <camunda:connectorId>http-connector</camunda:connectorId>
+        </camunda:connector>
+      </bpmn:extensionElements>
+      <bpmn:incoming>SequenceFlow_09s5dfc</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0kt3xbf</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_09s5dfc" sourceRef="ScriptTask_0p4b5vu" targetRef="ServiceTask_08e6hpm" />
+    <bpmn:endEvent id="EndEvent_0ntv40y">
+      <bpmn:incoming>SequenceFlow_0kt3xbf</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_0kt3xbf" sourceRef="ServiceTask_08e6hpm" targetRef="EndEvent_0ntv40y" />
   </bpmn:process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
-    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateDeviceResource.bpmn">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateDeviceResource">
       <bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
         <dc:Bounds x="1026" y="111" width="36" height="36" />
         <bpmndi:BPMNLabel>
@@ -158,7 +192,7 @@ dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
       <bpmndi:BPMNShape id="ExclusiveGateway_0kba700_di" bpmnElement="ExclusiveGateway_0kba700" isMarkerVisible="true">
         <dc:Bounds x="334" y="-152" width="50" height="50" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="309" y="-166" width="34" height="12" />
+          <dc:Bounds x="302" y="-166" width="48" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="IntermediateThrowEvent_1chnlq6_di" bpmnElement="IntermediateThrowEvent_1chnlq6">
@@ -228,19 +262,6 @@ dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
           <dc:Bounds x="760.5" y="-148" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="EndEvent_0ymfq61_di" bpmnElement="EndEvent_0ymfq61">
-        <dc:Bounds x="341" y="-251" width="36" height="36" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="359" y="-211" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_076ma0v_di" bpmnElement="SequenceFlow_076ma0v">
-        <di:waypoint xsi:type="dc:Point" x="359" y="-152" />
-        <di:waypoint xsi:type="dc:Point" x="359" y="-215" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="374" y="-189.5" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_02rli65_di" bpmnElement="ScriptTask_02rli65">
         <dc:Bounds x="480" y="-167" width="100" height="80" />
       </bpmndi:BPMNShape>
@@ -261,6 +282,43 @@ dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
           <dc:Bounds x="987.5" y="-148" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_0p4b5vu_di" bpmnElement="ScriptTask_0p4b5vu">
+        <dc:Bounds x="309" y="-290" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0b5nrig_di" bpmnElement="SequenceFlow_0b5nrig">
+        <di:waypoint xsi:type="dc:Point" x="359" y="-152" />
+        <di:waypoint xsi:type="dc:Point" x="359" y="-181" />
+        <di:waypoint xsi:type="dc:Point" x="359" y="-181" />
+        <di:waypoint xsi:type="dc:Point" x="359" y="-210" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="374" y="-187" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_08e6hpm_di" bpmnElement="ServiceTask_08e6hpm">
+        <dc:Bounds x="530" y="-290" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_09s5dfc_di" bpmnElement="SequenceFlow_09s5dfc">
+        <di:waypoint xsi:type="dc:Point" x="409" y="-250" />
+        <di:waypoint xsi:type="dc:Point" x="477" y="-250" />
+        <di:waypoint xsi:type="dc:Point" x="477" y="-250" />
+        <di:waypoint xsi:type="dc:Point" x="530" y="-250" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="492" y="-256" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="EndEvent_0ntv40y_di" bpmnElement="EndEvent_0ntv40y">
+        <dc:Bounds x="705" y="-268" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="723" y="-228" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0kt3xbf_di" bpmnElement="SequenceFlow_0kt3xbf">
+        <di:waypoint xsi:type="dc:Point" x="630" y="-250" />
+        <di:waypoint xsi:type="dc:Point" x="705" y="-250" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="667.5" y="-271" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>
index 4b6f8d9..25fd6af 100644 (file)
@@ -14,7 +14,7 @@ dcsi.prepare3rdONAPRequest(execution)]]></bpmn:script>
     <bpmn:endEvent id="EndEvent_013449q" name="Delete3rdONAPRES_End">
       <bpmn:incoming>SequenceFlow_0a8k9xi</bpmn:incoming>
     </bpmn:endEvent>
-    <bpmn:scriptTask id="ScriptTask_1b88nnk" name="Delete SPPartner In AAI">
+    <bpmn:scriptTask id="ScriptTask_1b88nnk" name="Delete SPPartner In AAI" scriptFormat="groovy">
       <bpmn:incoming>SequenceFlow_0y2g8mr</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0znwu8z</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
@@ -93,7 +93,7 @@ dcsi.doDeleteE2ESIin3rdONAP(execution)]]></bpmn:script>
           <camunda:connectorId>http-connector</camunda:connectorId>
         </camunda:connector>
       </bpmn:extensionElements>
-      <bpmn:incoming>SequenceFlow_0fkfn70</bpmn:incoming>
+      <bpmn:incoming>SequenceFlow_122usz6</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1luhljs</bpmn:outgoing>
     </bpmn:serviceTask>
     <bpmn:sequenceFlow id="SequenceFlow_190fewc" sourceRef="StartEvent_0hj12gh" targetRef="ScriptTask_160sboy" />
@@ -160,7 +160,7 @@ dcsi.checkLocallCall(execution)]]></bpmn:script>
     <bpmn:endEvent id="EndEvent_0o0n3fa" name="Delete3rdONAPRES_End">
       <bpmn:incoming>SequenceFlow_131f1jj</bpmn:incoming>
     </bpmn:endEvent>
-    <bpmn:scriptTask id="ScriptTask_1lazb8l" name="Delete SPPartner In AAI">
+    <bpmn:scriptTask id="ScriptTask_1lazb8l" name="Delete SPPartner In AAI" scriptFormat="groovy">
       <bpmn:incoming>SequenceFlow_1wq9f5k</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_18gb81f</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
@@ -180,11 +180,11 @@ dcsi.preProcessRequest(execution)]]></bpmn:script>
       <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
 execution.setVariable("progress", "100")
 execution.setVariable("status", "finished")
-execution.setVariable("statusDescription", "Local Creation Only")
+execution.setVariable("statusDescription", "Local Deletion Only")
 def dcsi = new Delete3rdONAPE2EServiceInstance()
 dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
     </bpmn:scriptTask>
-    <bpmn:serviceTask id="ServiceTask_1kgvq5e" name="update progress update">
+    <bpmn:serviceTask id="ServiceTask_1kgvq5e" name="resource progress update">
       <bpmn:extensionElements>
         <camunda:connector>
           <camunda:inputOutput>
@@ -269,9 +269,9 @@ csi.sendSyncResponse(execution)]]></bpmn:script>
     <bpmn:sequenceFlow id="SequenceFlow_15mvx68" sourceRef="ScriptTask_0rs5t7w" targetRef="ScriptTask_0r2cxvb" />
     <bpmn:sequenceFlow id="SequenceFlow_0wp73cw" sourceRef="ScriptTask_0r2cxvb" targetRef="ExclusiveGateway_1662gjm" />
     <bpmn:sequenceFlow id="SequenceFlow_13s0mg5" name="yes" sourceRef="ExclusiveGateway_1662gjm" targetRef="ScriptTask_0yz8d8c">
-      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("serviceOrderId" )  != null && execution.getVariable("serviceOrderId" )  != "" )}]]></bpmn:conditionExpression>
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("ServiceOrderId" )  != null && execution.getVariable("ServiceOrderId" )  != "" )}]]></bpmn:conditionExpression>
     </bpmn:sequenceFlow>
-    <bpmn:sequenceFlow id="SequenceFlow_0fkfn70" sourceRef="ScriptTask_0yz8d8c" targetRef="ServiceTask_0p5029r" />
+    <bpmn:sequenceFlow id="SequenceFlow_0fkfn70" sourceRef="ScriptTask_0yz8d8c" targetRef="ScriptTask_0yiew1d" />
     <bpmn:sequenceFlow id="SequenceFlow_1suwdgi" sourceRef="ServiceTask_039ju3f" targetRef="ScriptTask_0rs5t7w" />
     <bpmn:sequenceFlow id="SequenceFlow_0kkou66" sourceRef="ScriptTask_1pdhttw" targetRef="ScriptTask_0yz8d8c" />
     <bpmn:sequenceFlow id="SequenceFlow_1luhljs" sourceRef="ServiceTask_0p5029r" targetRef="ExclusiveGateway_1we7izu" />
@@ -319,6 +319,14 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
     </bpmn:serviceTask>
     <bpmn:sequenceFlow id="SequenceFlow_0i9iiuo" sourceRef="ScriptTask_07cq0pw" targetRef="ServiceTask_1ixmamy" />
     <bpmn:sequenceFlow id="SequenceFlow_1mei7hu" sourceRef="ServiceTask_1ixmamy" targetRef="EndEvent_19joonf" />
+    <bpmn:scriptTask id="ScriptTask_0yiew1d" name="update resource progress" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_0fkfn70</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_122usz6</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+def dcsi = new Create3rdONAPE2EServiceInstance()
+dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="SequenceFlow_122usz6" sourceRef="ScriptTask_0yiew1d" targetRef="ServiceTask_0p5029r" />
   </bpmn:process>
   <bpmn:error id="Error_0nbdy47" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
@@ -357,7 +365,7 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
         <dc:Bounds x="163" y="12" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_0p5029r_di" bpmnElement="ServiceTask_0p5029r">
-        <dc:Bounds x="798" y="12" width="100" height="80" />
+        <dc:Bounds x="798" y="126" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_190fewc_di" bpmnElement="SequenceFlow_190fewc">
         <di:waypoint xsi:type="dc:Point" x="27" y="-400" />
@@ -589,7 +597,7 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_1pdhttw_di" bpmnElement="ScriptTask_1pdhttw">
-        <dc:Bounds x="573" y="187" width="100" height="80" />
+        <dc:Bounds x="573" y="222" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ExclusiveGateway_1662gjm_di" bpmnElement="ExclusiveGateway_1662gjm" isMarkerVisible="true">
         <dc:Bounds x="386" y="27" width="50" height="50" />
@@ -598,9 +606,9 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ExclusiveGateway_1we7izu_di" bpmnElement="ExclusiveGateway_1we7izu" isMarkerVisible="true">
-        <dc:Bounds x="823" y="202" width="50" height="50" />
+        <dc:Bounds x="823" y="237" width="50" height="50" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="880" y="206" width="68" height="42" />
+          <dc:Bounds x="878" y="241" width="72" height="36" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_18auy29_di" bpmnElement="ScriptTask_18auy29">
@@ -654,24 +662,24 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0kkou66_di" bpmnElement="SequenceFlow_0kkou66">
-        <di:waypoint xsi:type="dc:Point" x="623" y="187" />
+        <di:waypoint xsi:type="dc:Point" x="623" y="222" />
         <di:waypoint xsi:type="dc:Point" x="623" y="92" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="593" y="132.5" width="90" height="14" />
+          <dc:Bounds x="593" y="150" width="90" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1luhljs_di" bpmnElement="SequenceFlow_1luhljs">
-        <di:waypoint xsi:type="dc:Point" x="848" y="92" />
-        <di:waypoint xsi:type="dc:Point" x="848" y="202" />
+        <di:waypoint xsi:type="dc:Point" x="848" y="206" />
+        <di:waypoint xsi:type="dc:Point" x="848" y="237" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="818" y="140" width="90" height="14" />
+          <dc:Bounds x="818" y="214.5" width="90" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1udji9x_di" bpmnElement="SequenceFlow_1udji9x">
-        <di:waypoint xsi:type="dc:Point" x="823" y="227" />
-        <di:waypoint xsi:type="dc:Point" x="673" y="227" />
+        <di:waypoint xsi:type="dc:Point" x="823" y="262" />
+        <di:waypoint xsi:type="dc:Point" x="673" y="262" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="746" y="208" width="12" height="14" />
+          <dc:Bounds x="746" y="243" width="12" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="EndEvent_19joonf_di" bpmnElement="EndEvent_19joonf">
@@ -690,12 +698,12 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0y2g8mr_di" bpmnElement="SequenceFlow_0y2g8mr">
-        <di:waypoint xsi:type="dc:Point" x="848" y="252" />
+        <di:waypoint xsi:type="dc:Point" x="848" y="287" />
         <di:waypoint xsi:type="dc:Point" x="848" y="324" />
         <di:waypoint xsi:type="dc:Point" x="9" y="324" />
         <di:waypoint xsi:type="dc:Point" x="9" y="371" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="419.8991436726927" y="302" width="18" height="14" />
+          <dc:Bounds x="419" y="302" width="19" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_07cq0pw_di" bpmnElement="ScriptTask_07cq0pw">
@@ -718,6 +726,16 @@ dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
           <dc:Bounds x="326.5" y="193" width="0" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_0yiew1d_di" bpmnElement="ScriptTask_0yiew1d">
+        <dc:Bounds x="798" y="12" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_122usz6_di" bpmnElement="SequenceFlow_122usz6">
+        <di:waypoint xsi:type="dc:Point" x="848" y="92" />
+        <di:waypoint xsi:type="dc:Point" x="848" y="126" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="863" y="103" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>
index be15908..f0baac0 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3">
-  <bpmn:process id="DeleteDeviceResource.bpmn" name="DeleteDeviceResource.bpmn" isExecutable="true">
+  <bpmn:process id="DeleteDeviceResource" name="DeleteDeviceResource" isExecutable="true">
     <bpmn:endEvent id="EndEvent_1x6k78c" name="delete Dev end">
       <bpmn:incoming>SequenceFlow_0auvfvm</bpmn:incoming>
     </bpmn:endEvent>
@@ -8,7 +8,7 @@
       <bpmn:incoming>SequenceFlow_05niqbf</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0auvfvm</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
-def csi = new  DeleteDeviceResource.bpmn()
+def csi = new  DeleteDeviceResource()
 csi.sendSyncResponse(execution)]]></bpmn:script>
     </bpmn:scriptTask>
     <bpmn:sequenceFlow id="SequenceFlow_05niqbf" sourceRef="Task_0bga3e8" targetRef="ScriptTask_1g5zyi6" />
@@ -43,11 +43,11 @@ csi.sendSyncResponse(execution)]]></bpmn:script>
 def dcsi = new DeleteDeviceResource()
 dcsi.checkDevType(execution)]]></bpmn:script>
     </bpmn:scriptTask>
-    <bpmn:exclusiveGateway id="ExclusiveGateway_0kba700" name="Dev Type" default="SequenceFlow_076ma0v">
+    <bpmn:exclusiveGateway id="ExclusiveGateway_0kba700" name="Dev Type" default="SequenceFlow_1g6azih">
       <bpmn:incoming>SequenceFlow_1hp2h5t</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1ss02ik</bpmn:outgoing>
       <bpmn:outgoing>SequenceFlow_0h4378g</bpmn:outgoing>
-      <bpmn:outgoing>SequenceFlow_076ma0v</bpmn:outgoing>
+      <bpmn:outgoing>SequenceFlow_1g6azih</bpmn:outgoing>
     </bpmn:exclusiveGateway>
     <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1chnlq6" name="GoTo StartDeleteDevinSDNC">
       <bpmn:incoming>SequenceFlow_0h4378g</bpmn:incoming>
@@ -91,10 +91,6 @@ dcsi.preProcessRequest(execution)]]></bpmn:script>
       <bpmn:outgoing>SequenceFlow_0pkp4ce</bpmn:outgoing>
     </bpmn:callActivity>
     <bpmn:sequenceFlow id="SequenceFlow_0pkp4ce" sourceRef="CallActivity_0pyrfca" targetRef="ScriptTask_0u1piih" />
-    <bpmn:endEvent id="EndEvent_0ymfq61">
-      <bpmn:incoming>SequenceFlow_076ma0v</bpmn:incoming>
-    </bpmn:endEvent>
-    <bpmn:sequenceFlow id="SequenceFlow_076ma0v" sourceRef="ExclusiveGateway_0kba700" targetRef="EndEvent_0ymfq61" />
     <bpmn:scriptTask id="ScriptTask_02rli65" name="Get VNF ID" scriptFormat="groovy">
       <bpmn:incoming>SequenceFlow_1ss02ik</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0pg3072</bpmn:outgoing>
@@ -111,9 +107,47 @@ def dcsi = new DeleteDeviceResource()
 dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
     </bpmn:scriptTask>
     <bpmn:sequenceFlow id="SequenceFlow_1ylvnxq" sourceRef="ScriptTask_0u1piih" targetRef="IntermediateThrowEvent_1caax8u" />
+    <bpmn:scriptTask id="ScriptTask_14oc86m" name="Prepare Create resource progress" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_1g6azih</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_003svcq</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+execution.setVariable("progress", "100")
+execution.setVariable("status", "finished")
+execution.setVariable("statusDescription", "Finished for the devType")
+def dcsi = new DeleteDeviceResource()
+dcsi.prepareUpdateProgress(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:serviceTask id="ServiceTask_1b3omyh" name="resource progress update">
+      <bpmn:extensionElements>
+        <camunda:connector>
+          <camunda:inputOutput>
+            <camunda:inputParameter name="url">${CVFMI_dbAdapterEndpoint}</camunda:inputParameter>
+            <camunda:inputParameter name="headers">
+              <camunda:map>
+                <camunda:entry key="content-type">application/soap+xml</camunda:entry>
+                <camunda:entry key="Authorization">Basic QlBFTENsaWVudDpwYXNzd29yZDEk</camunda:entry>
+              </camunda:map>
+            </camunda:inputParameter>
+            <camunda:inputParameter name="payload">${CVFMI_updateResOperStatusRequest}</camunda:inputParameter>
+            <camunda:inputParameter name="method">POST</camunda:inputParameter>
+            <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter>
+            <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter>
+          </camunda:inputOutput>
+          <camunda:connectorId>http-connector</camunda:connectorId>
+        </camunda:connector>
+      </bpmn:extensionElements>
+      <bpmn:incoming>SequenceFlow_003svcq</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1donwoj</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_003svcq" sourceRef="ScriptTask_14oc86m" targetRef="ServiceTask_1b3omyh" />
+    <bpmn:sequenceFlow id="SequenceFlow_1g6azih" sourceRef="ExclusiveGateway_0kba700" targetRef="ScriptTask_14oc86m" />
+    <bpmn:endEvent id="EndEvent_1tn8i1e">
+      <bpmn:incoming>SequenceFlow_1donwoj</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_1donwoj" sourceRef="ServiceTask_1b3omyh" targetRef="EndEvent_1tn8i1e" />
   </bpmn:process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
-    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteDeviceResource.bpmn">
+    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteDeviceResource">
       <bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
         <dc:Bounds x="1026" y="111" width="36" height="36" />
         <bpmndi:BPMNLabel>
@@ -158,7 +192,7 @@ dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
       <bpmndi:BPMNShape id="ExclusiveGateway_0kba700_di" bpmnElement="ExclusiveGateway_0kba700" isMarkerVisible="true">
         <dc:Bounds x="334" y="-152" width="50" height="50" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="309" y="-166" width="34" height="12" />
+          <dc:Bounds x="302" y="-166" width="48" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="IntermediateThrowEvent_1chnlq6_di" bpmnElement="IntermediateThrowEvent_1chnlq6">
@@ -228,19 +262,6 @@ dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
           <dc:Bounds x="760.5" y="-148" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="EndEvent_0ymfq61_di" bpmnElement="EndEvent_0ymfq61">
-        <dc:Bounds x="341" y="-251" width="36" height="36" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="359" y="-211" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_076ma0v_di" bpmnElement="SequenceFlow_076ma0v">
-        <di:waypoint xsi:type="dc:Point" x="359" y="-152" />
-        <di:waypoint xsi:type="dc:Point" x="359" y="-215" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="374" y="-189.5" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_02rli65_di" bpmnElement="ScriptTask_02rli65">
         <dc:Bounds x="480" y="-167" width="100" height="80" />
       </bpmndi:BPMNShape>
@@ -261,6 +282,39 @@ dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
           <dc:Bounds x="987.5" y="-148" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_14oc86m_di" bpmnElement="ScriptTask_14oc86m">
+        <dc:Bounds x="309" y="-281" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_1b3omyh_di" bpmnElement="ServiceTask_1b3omyh">
+        <dc:Bounds x="480" y="-281" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_003svcq_di" bpmnElement="SequenceFlow_003svcq">
+        <di:waypoint xsi:type="dc:Point" x="409" y="-241" />
+        <di:waypoint xsi:type="dc:Point" x="480" y="-241" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="444.5" y="-262" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1g6azih_di" bpmnElement="SequenceFlow_1g6azih">
+        <di:waypoint xsi:type="dc:Point" x="359" y="-152" />
+        <di:waypoint xsi:type="dc:Point" x="359" y="-201" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="374" y="-182.5" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="EndEvent_1tn8i1e_di" bpmnElement="EndEvent_1tn8i1e">
+        <dc:Bounds x="663" y="-259" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="681" y="-219" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1donwoj_di" bpmnElement="SequenceFlow_1donwoj">
+        <di:waypoint xsi:type="dc:Point" x="580" y="-241" />
+        <di:waypoint xsi:type="dc:Point" x="663" y="-241" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="621.5" y="-262" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>
index 0dc5707..9cf21dd 100644 (file)
@@ -76,7 +76,7 @@ ddsi.postProcessAAIPUT(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:sequenceFlow id="SequenceFlow_1qctzm0" sourceRef="Task_0uiekmn" targetRef="Task_0raqlqc" />
     <bpmn2:scriptTask id="Task_0uiekmn" name="Prepare Resource Oper Status" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_1hbesp9</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_1e5j351</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_1qctzm0</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
 def ddsi = new DoCreateE2EServiceInstance()
@@ -102,7 +102,7 @@ ddsi.preInitResourcesOperStatus(execution)]]></bpmn2:script>
         </camunda:connector>
       </bpmn2:extensionElements>
       <bpmn2:incoming>SequenceFlow_1qctzm0</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_0bfwj4y</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_1s5aas9</bpmn2:outgoing>
     </bpmn2:serviceTask>
     <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_0bq4fxs" name="Go to Decompose_Service">
       <bpmn2:incoming>SequenceFlow_0w9t6tc</bpmn2:incoming>
@@ -147,10 +147,10 @@ dcsi.prepareDecomposeService(execution)]]></bpmn2:script>
     <bpmn2:sequenceFlow id="SequenceFlow_1qiiycn" sourceRef="createSI_startEvent" targetRef="preProcessRequest_ScriptTask" />
     <bpmn2:sequenceFlow id="SequenceFlow_166w91p" sourceRef="IntermediateCatchEvent_0tv85pg" targetRef="ScriptTask_1cllqk3" />
     <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_16okck2" name="GoTo StartPrepareResource">
-      <bpmn2:incoming>SequenceFlow_15d8lqu</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_1tkgqu3</bpmn2:incoming>
       <bpmn2:linkEventDefinition name="StartPrepareResource" />
     </bpmn2:intermediateThrowEvent>
-    <bpmn2:sequenceFlow id="SequenceFlow_1tkgqu3" sourceRef="ScriptTask_0q37vn9" targetRef="ScriptTask_08yiqtu" />
+    <bpmn2:sequenceFlow id="SequenceFlow_1tkgqu3" sourceRef="ScriptTask_0q37vn9" targetRef="IntermediateThrowEvent_16okck2" />
     <bpmn2:sequenceFlow id="SequenceFlow_0w9t6tc" sourceRef="preProcessRequest_ScriptTask" targetRef="IntermediateThrowEvent_0bq4fxs" />
     <bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_0jrb3xu" name="StartService">
       <bpmn2:outgoing>SequenceFlow_1i7t9hq</bpmn2:outgoing>
@@ -161,7 +161,7 @@ dcsi.prepareDecomposeService(execution)]]></bpmn2:script>
       <bpmn2:outgoing>SequenceFlow_1hbesp9</bpmn2:outgoing>
       <bpmn2:linkEventDefinition name="StartPrepareResource" />
     </bpmn2:intermediateCatchEvent>
-    <bpmn2:sequenceFlow id="SequenceFlow_1hbesp9" sourceRef="IntermediateCatchEvent_05dus9b" targetRef="Task_0uiekmn" />
+    <bpmn2:sequenceFlow id="SequenceFlow_1hbesp9" sourceRef="IntermediateCatchEvent_05dus9b" targetRef="ScriptTask_0dpt36a" />
     <bpmn2:callActivity id="CallActivity_1ojtwas" name="Call DoCreateResources" calledElement="DoCreateResourcesV3">
       <bpmn2:extensionElements>
         <camunda:in source="nsServiceName" target="nsServiceName" />
@@ -205,30 +205,22 @@ csi.postProcessForAddResource(execution)]]></bpmn2:script>
     <bpmn2:sequenceFlow id="SequenceFlow_0a6vgsu" sourceRef="ScriptTask_1y7jr4t" targetRef="EndEvent_0hzmoug" />
     <bpmn2:sequenceFlow id="SequenceFlow_012h7yx" sourceRef="ScriptTask_1o01d7d" targetRef="IntermediateThrowEvent_1mlbhmt" />
     <bpmn2:scriptTask id="ScriptTask_0dpt36a" name="Process Site Location" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_0bfwj4y</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_1e5vxox</bpmn2:outgoing>
+      <bpmn2:incoming>SequenceFlow_1hbesp9</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_1e5j351</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
 def dcsi= new DoCreateE2EServiceInstance()
 dcsi.doProcessSiteLocation(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:scriptTask id="ScriptTask_1a5mdd6" name="Process Link TP Resource Allocation" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_1e5vxox</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_1s5aas9</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_0p6ba92</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
 def dcsi= new DoCreateE2EServiceInstance()
 dcsi.doTPResourcesAllocation(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
-    <bpmn2:sequenceFlow id="SequenceFlow_1e5vxox" sourceRef="ScriptTask_0dpt36a" targetRef="ScriptTask_1a5mdd6" />
-    <bpmn2:sequenceFlow id="SequenceFlow_0bfwj4y" sourceRef="Task_0raqlqc" targetRef="ScriptTask_0dpt36a" />
     <bpmn2:sequenceFlow id="SequenceFlow_0p6ba92" sourceRef="ScriptTask_1a5mdd6" targetRef="ScriptTask_04b21gb" />
-    <bpmn2:scriptTask id="ScriptTask_08yiqtu" name="Store ServiceInput to AAI" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_1tkgqu3</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_15d8lqu</bpmn2:outgoing>
-      <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
-def ddsi = new DoCreateE2EServiceInstance()
-ddsi.saveServiceInputToAAI(execution)]]></bpmn2:script>
-    </bpmn2:scriptTask>
-    <bpmn2:sequenceFlow id="SequenceFlow_15d8lqu" sourceRef="ScriptTask_08yiqtu" targetRef="IntermediateThrowEvent_16okck2" />
+    <bpmn2:sequenceFlow id="SequenceFlow_1s5aas9" sourceRef="Task_0raqlqc" targetRef="ScriptTask_1a5mdd6" />
+    <bpmn2:sequenceFlow id="SequenceFlow_1e5j351" sourceRef="ScriptTask_0dpt36a" targetRef="Task_0uiekmn" />
   </bpmn2:process>
   <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
   <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" />
@@ -311,17 +303,17 @@ ddsi.saveServiceInputToAAI(execution)]]></bpmn2:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1qctzm0_di" bpmnElement="SequenceFlow_1qctzm0">
-        <di:waypoint xsi:type="dc:Point" x="226" y="300" />
-        <di:waypoint xsi:type="dc:Point" x="297" y="300" />
+        <di:waypoint xsi:type="dc:Point" x="376" y="300" />
+        <di:waypoint xsi:type="dc:Point" x="447" y="300" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="216.5" y="279" width="90" height="12" />
+          <dc:Bounds x="367" y="279" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_0v81r5h_di" bpmnElement="Task_0uiekmn">
-        <dc:Bounds x="126" y="260" width="100" height="80" />
+        <dc:Bounds x="276" y="260" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_14tnuxf_di" bpmnElement="Task_0raqlqc">
-        <dc:Bounds x="297" y="260" width="100" height="80" />
+        <dc:Bounds x="447" y="260" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="IntermediateThrowEvent_11saqvj_di" bpmnElement="IntermediateThrowEvent_0bq4fxs">
         <dc:Bounds x="1315" y="-207" width="36" height="36" />
@@ -386,9 +378,9 @@ ddsi.saveServiceInputToAAI(execution)]]></bpmn2:script>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1tkgqu3_di" bpmnElement="SequenceFlow_1tkgqu3">
         <di:waypoint xsi:type="dc:Point" x="813" y="94" />
-        <di:waypoint xsi:type="dc:Point" x="991" y="94" />
+        <di:waypoint xsi:type="dc:Point" x="1315" y="94" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="857" y="73" width="90" height="12" />
+          <dc:Bounds x="1019" y="73" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0w9t6tc_di" bpmnElement="SequenceFlow_0w9t6tc">
@@ -423,9 +415,9 @@ ddsi.saveServiceInputToAAI(execution)]]></bpmn2:script>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1hbesp9_di" bpmnElement="SequenceFlow_1hbesp9">
         <di:waypoint xsi:type="dc:Point" x="54" y="300" />
-        <di:waypoint xsi:type="dc:Point" x="126" y="300" />
+        <di:waypoint xsi:type="dc:Point" x="102" y="300" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="45" y="279" width="90" height="12" />
+          <dc:Bounds x="33" y="279" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="CallActivity_1ojtwas_di" bpmnElement="CallActivity_1ojtwas">
@@ -472,25 +464,11 @@ ddsi.saveServiceInputToAAI(execution)]]></bpmn2:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_0dpt36a_di" bpmnElement="ScriptTask_0dpt36a">
-        <dc:Bounds x="455" y="260" width="100" height="80" />
+        <dc:Bounds x="102" y="260" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_1a5mdd6_di" bpmnElement="ScriptTask_1a5mdd6">
         <dc:Bounds x="613" y="260" width="100" height="80" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_1e5vxox_di" bpmnElement="SequenceFlow_1e5vxox">
-        <di:waypoint xsi:type="dc:Point" x="555" y="300" />
-        <di:waypoint xsi:type="dc:Point" x="613" y="300" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="539" y="279" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_0bfwj4y_di" bpmnElement="SequenceFlow_0bfwj4y">
-        <di:waypoint xsi:type="dc:Point" x="397" y="300" />
-        <di:waypoint xsi:type="dc:Point" x="455" y="300" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="426" y="279" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0p6ba92_di" bpmnElement="SequenceFlow_0p6ba92">
         <di:waypoint xsi:type="dc:Point" x="713" y="300" />
         <di:waypoint xsi:type="dc:Point" x="799" y="300" />
@@ -498,14 +476,18 @@ ddsi.saveServiceInputToAAI(execution)]]></bpmn2:script>
           <dc:Bounds x="756" y="279" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ScriptTask_08yiqtu_di" bpmnElement="ScriptTask_08yiqtu">
-        <dc:Bounds x="991" y="54" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_15d8lqu_di" bpmnElement="SequenceFlow_15d8lqu">
-        <di:waypoint xsi:type="dc:Point" x="1091" y="94" />
-        <di:waypoint xsi:type="dc:Point" x="1315" y="94" />
+      <bpmndi:BPMNEdge id="SequenceFlow_1s5aas9_di" bpmnElement="SequenceFlow_1s5aas9">
+        <di:waypoint xsi:type="dc:Point" x="547" y="300" />
+        <di:waypoint xsi:type="dc:Point" x="613" y="300" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="580" y="279" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1e5j351_di" bpmnElement="SequenceFlow_1e5j351">
+        <di:waypoint xsi:type="dc:Point" x="202" y="300" />
+        <di:waypoint xsi:type="dc:Point" x="276" y="300" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1203" y="73" width="0" height="12" />
+          <dc:Bounds x="239" y="279" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>