Merge "Added canceling subsription to pnf-pnp workflow"
authorSeshu Kumar M <seshu.kumar.m@huawei.com>
Mon, 23 Apr 2018 08:44:47 +0000 (08:44 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 23 Apr 2018 08:44:47 +0000 (08:44 +0000)
42 files changed:
INFO.yaml [new file with mode: 0644]
adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipe.java
adapters/mso-requests-db-adapter/src/test/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandlerTest.java [new file with mode: 0644]
adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImplTest.java
adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResourceTest.java
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NSResourceInputParameter.java
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfPluginAdapterImpl.java
asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCConfiguration.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnIntegerParam.java [moved from adapters/mso-requests-db-adapter/src/test/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandlerTestException.java with 64% similarity]
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequest.java
bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java
bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVFCNSResource.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn
bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUpdateE2EServiceInstance.bpmn
bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java
common/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java
common/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java
common/src/main/java/org/openecomp/mso/openpojo/rules/HasAnnotationPropertyWithValueMatcher.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java
mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java
mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java

diff --git a/INFO.yaml b/INFO.yaml
new file mode 100644 (file)
index 0000000..34f11c2
--- /dev/null
+++ b/INFO.yaml
@@ -0,0 +1,106 @@
+---
+project: 'so'
+project_creation_date: '2017-01-30'
+lifecycle_state: 'Incubation'
+project_lead: &onap_releng_ptl
+    name: 'Seshu Kumar'
+    email: 'seshu.kumar.m@huawei.com'
+    id: 'seshukm'
+    company: 'Huawei'
+    timezone: 'India/Bangalore'
+primary_contact: *onap_releng_ptl
+issue_tracking:
+    type: 'jira'
+    url: 'https://jira.onap.org/projects/SO'
+    key: 'SO'
+meetings:
+    - type: 'zoom'
+        agenda: 'https://wiki.onap.org/display/DW/Minutes+Of+Meeting'
+        url: 'https://wiki.onap.org/display/DW/Service+Orchestrator+Project'
+        server: 'n/a'
+        channel: 'n/a'
+        repeats: 'weekly'
+        time: '14:00 UTC'
+committers:
+    - <<: *onap_releng_ptl
+    - name: 'Chuanyu Chen'
+        email: 'chenchuanyu@huawei.com'
+        company: 'Huawei'
+        id: 'boychuanyu'
+        timezone: 'Beijing/China'
+    - name: 'Byung-Woo Jun'
+        email: 'byung-woo.jun@ericsson.com'
+        company: 'Ericsson'
+        id: 'byungwoojun'
+        timezone: ''
+    - name: 'Christophe Closset'
+        email: 'cc697w@intl.att.com'
+        company: 'ATT'
+        id: 'ChrisC'
+        timezone: 'Belgium/Namur'
+    - name: 'Claude Noshpitz'
+        email: 'claude.noshpitz@att.com'
+        company: 'ATT'
+        id: 'clauden'
+        timezone: ''
+    - name: 'Hui Deng'
+        email: 'denghui12@huawei.com'
+        company: 'Huawei'
+        id: 'denghui02'
+        timezone: 'China/Beijing'
+    - name: 'DeWayne Filppi'
+        email: 'dewayne@cloudify.co'
+        company: 'Cloudify'
+        id: 'dfilppi'
+        timezone: ''
+    - name: 'Eric Debeau'
+        email: 'eric.debeau@orange.com'
+        company: 'Orange'
+        id: 'eric.debeau'
+        timezone: ''
+    - name: 'Ethan Lynn'
+        email: 'ethanlynnl@vmware.com'
+        company: 'VMware'
+        id: 'ethanlynnl'
+        timezone: 'France/Lannion'
+    - name: 'Jie Feng'
+        email: 'feng.jie2@zte.com.cn'
+        company: 'ZTE'
+        id: 'fengjie'
+        timezone: ''
+    - name: 'Fu Jinhua'
+        email: 'fu.jinhua@zte.com.cn'
+        company: 'ZTE'
+        id: 'fujinhua'
+        timezone: ''
+    - name: 'maopeng zhang'
+        email: 'zhang.maopeng1@zte.com.cn'
+        company: 'ZTE'
+        id: 'maopengzhang'
+        timezone: 'China/Nanjing'
+    - name: 'Bin Hou'
+        email: 'bin.hou@huawei.com'
+        company: 'Huawei'
+        id: 'piggie-hou'
+        timezone: 'China/Beijing'
+    - name: 'Rob Daugherty'
+        email: 'rd472p@att.com'
+        company: 'ATT'
+        id: 'rd472p'
+        timezone: ''
+    - name: 'jackie tian'
+        email: 'tian.yi@zte.com.cn'
+        company: 'ZTE'
+        id: 'tianyi'
+        timezone: 'China/Beijing'
+    - name: 'Chengli Wang'
+        email: 'wangchengli@chinamobile.com'
+        company: 'China Mobile'
+        id: 'wangchengli'
+        timezone: 'China/Beijing'
+tsc:
+    approval: 'https://lists.onap.org/pipermail/onap-tsc'
+    changes:
+        - type: 'removal'
+            name: 'Tal Liron'
+            link: 'https://lists.onap.org/pipermail/onap-tsc/2018-February/004361.html'
index 5be6970..7d6aed4 100644 (file)
@@ -24,6 +24,10 @@ import java.util.Map;
 \r
 import org.openecomp.mso.db.catalog.beans.Recipe;\r
 \r
+import com.fasterxml.jackson.core.JsonProcessingException;\r
+import com.fasterxml.jackson.databind.ObjectMapper;\r
+import com.fasterxml.jackson.databind.SerializationFeature;\r
+\r
 /**\r
  * serivce csar query support \r
  * <br>\r
@@ -41,16 +45,6 @@ public class QueryResourceRecipe extends CatalogQuery{
         this.resourceRecipe =resourceRecipe;\r
     }\r
 \r
-    private final String template =\r
-            "\t{\n"+\r
-            "\t\t\"id\"                     : <ID>,\n"+\r
-            "\t\t\"action\"                 : <ACTION>,\n"+\r
-            "\t\t\"orchestrationUri\"       : <ORCHESTRATION_URI>,\n"+\r
-            "\t\t\"recipeTimeout\"          : <RECIPE_TIMEOUT>,\n"+\r
-            "\t\t\"paramXSD\"               : <PARAM_XSD>,\n"+\r
-            "\t\t\"description\"            : <DESCRIPTION>\n"+\r
-            "\t}";\r
-    \r
     @Override\r
     public String toString() {\r
 \r
@@ -58,15 +52,25 @@ public class QueryResourceRecipe extends CatalogQuery{
     }\r
 \r
     @Override\r
-    public String JSON2(boolean isArray, boolean isEmbed) {\r
+    public String JSON2(boolean isArray, boolean isEmbed) {            \r
+       \r
         Map<String, String> valueMap = new HashMap<>();\r
-        put(valueMap, "ID", null == resourceRecipe ? null : resourceRecipe.getId());\r
-        put(valueMap, "ACTION", null == resourceRecipe ? null : resourceRecipe.getAction());\r
-        put(valueMap, "ORCHESTRATION_URI", null == resourceRecipe ? null : resourceRecipe.getOrchestrationUri());\r
-        put(valueMap, "RECIPE_TIMEOUT", null == resourceRecipe ? null : resourceRecipe.getRecipeTimeout());\r
-        put(valueMap, "PARAM_XSD", null == resourceRecipe ? null : resourceRecipe.getParamXSD());\r
-        put(valueMap, "DESCRIPTION", null == resourceRecipe ? null : resourceRecipe.getDescription());\r
-        return this.setTemplate(template, valueMap);\r
+        valueMap.put("id",  null == resourceRecipe ? null :String.valueOf(resourceRecipe.getId()));\r
+        valueMap.put("action",  null == resourceRecipe ? null :resourceRecipe.getAction());\r
+        valueMap.put("orchestrationUri", null == resourceRecipe ? null : resourceRecipe.getOrchestrationUri());\r
+        valueMap.put("recipeTimeout", null == resourceRecipe ? null : String.valueOf(resourceRecipe.getRecipeTimeout()));\r
+        valueMap.put("paramXSD", null == resourceRecipe ? null : resourceRecipe.getParamXSD());\r
+        valueMap.put("description", null == resourceRecipe ? null : resourceRecipe.getDescription());\r
+        ObjectMapper mapper = new ObjectMapper();\r
+        mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);\r
+        String jsonStr = "";\r
+        try {\r
+            jsonStr = mapper.writeValueAsString(valueMap);\r
+        } catch(JsonProcessingException e) {\r
+\r
+            e.printStackTrace();\r
+        }\r
+        return jsonStr;\r
     }\r
 \r
 }\r
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandlerTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandlerTest.java
new file mode 100644 (file)
index 0000000..87e2a87
--- /dev/null
@@ -0,0 +1,67 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.adapters.requestsdb;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openecomp.mso.HealthCheckUtils;
+import org.openecomp.mso.logger.MsoLogger;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import javax.ws.rs.core.Response;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.when;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(HealthCheckHandler.class)
+public class HealthCheckHandlerTest {
+
+    HealthCheckHandler hcH;
+
+    @Before
+    public void init(){
+
+        hcH = new HealthCheckHandler();
+    }
+
+    @Test
+    public void testNoServiceResp() {
+
+        HealthCheckUtils test = PowerMockito.mock(HealthCheckUtils.class);
+        try {
+            PowerMockito.whenNew(HealthCheckUtils.class).withNoArguments().thenReturn(test);
+            when(test.siteStatusCheck(any(MsoLogger.class))).thenReturn(true);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+       Response response =  hcH.healthcheck("request");
+       assertEquals(503,response.getStatus());
+    }
+
+}
+
+
index 6e05402..98b368f 100644 (file)
 
 package org.openecomp.mso.adapters.sdnc.impl;
 
-import org.junit.Assert;
+import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.openecomp.mso.HealthCheckUtils;
+import org.openecomp.mso.logger.MsoLogger;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
 
+import javax.ws.rs.core.Response;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.when;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(SDNCAdapterRestImpl.class)
 public class SDNCAdapterRestImplTest {
 
-    SDNCAdapterRestImpl test = new SDNCAdapterRestImpl();
+    SDNCAdapterRestImpl test;
 
-   /*Need to revist this .. commenting for now to proceed
-   @Test(expected = ClassFormatError.class)
-    public void testMSORequestException() {
+    @Before
+    public void init(){
 
-        test.MSORequest("reqXML");
-        Assert.assertFalse(true);
-               
+        test = new SDNCAdapterRestImpl();
     }
 
-    @Test(expected = NoClassDefFoundError.class)
-    public void testHealthCheckException() {
+   @Test
+   public void testBadReqNoServiceRsp() {
 
-        test.healthcheck("1a25a7c0-4c91-4f74-9a78-8c11b7a57f1a");
-        Assert.assertFalse(true);
-    }
+       HealthCheckUtils hCU = PowerMockito.mock(HealthCheckUtils.class);
+        try {
+            PowerMockito.whenNew(HealthCheckUtils.class).withNoArguments().thenReturn(hCU);
+            when(hCU.siteStatusCheck(any(MsoLogger.class))).thenReturn(true);
 
-    @Test(expected = ClassFormatError.class)
-    public void testglobalHealthcheckException() {
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
-        test.globalHealthcheck(true);
-        Assert.assertFalse(true);
-    }
+       String reqXML = "<xml>test</xml>";
+
+       Response response = test.MSORequest(reqXML);
+       assertEquals(400,response.getStatus());
+
+       response = test.healthcheck("1a25a7c0-4c91-4f74-9a78-8c11b7a57f1a");
+       assertEquals(503,response.getStatus());
 
+       response = test.globalHealthcheck(true);
+       assertEquals(503,response.getStatus());
 
-    @Test(expected = NoClassDefFoundError.class)
-    public void testNodeHealthCheckException() {
+       response = test.nodeHealthcheck();
+       assertEquals(503,response.getStatus());
 
-        test.nodeHealthcheck();
-        Assert.assertFalse(true);
-    }*/
+   }
 
 }
 
index a62f42a..75cd360 100644 (file)
@@ -24,6 +24,9 @@ import org.junit.Test;
 import org.mockito.Mock;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.Response;
+
+import static org.junit.Assert.assertEquals;
 
 public class SDNCNotifyResourceTest {
 
@@ -31,16 +34,19 @@ public class SDNCNotifyResourceTest {
     HttpServletRequest httpServletRequest;
 
     SDNCNotifyResource test = new SDNCNotifyResource();
-//These tests need a recheck for the class cast exception
- /*   @Test(expected = ClassFormatError.class)
-    public void testPrintMessageException() {
-        test.printMessage();
-        test.printMessageParam("msg");
-    }
 
-    @Test(expected = ClassFormatError.class)
-    public void testSDNCNotifyException() {
-        test.SDNCNotify("reqXML", httpServletRequest);
+    @Test
+    public void testPrintMessage() {
+
+        Response response = test.printMessage();
+        assertEquals(200, response.getStatus());
 
-    }*/
+        response = test.printMessageParam("msg");
+        assertEquals(200, response.getStatus());
+
+        String reqXML = "<xml>test</xml>";
+        response = test.SDNCNotify(reqXML, httpServletRequest);
+        assertEquals(400, response.getStatus());
+
+    }
 }
index 8e16d1c..0673af2 100644 (file)
@@ -88,7 +88,7 @@ public class VfcManager {
   public RestfulResponse createNs(NSResourceInputParameter segInput) throws ApplicationException {
 
     // Step1: get service template by node type
-    String csarId = segInput.getNsOperationKey().getNodeTemplateUUID();
+    String csarId = segInput.getNsServiceModelUUID();
     // nsdId for NFVO is "id" in the response, while for SDNO is "servcice template id"
     LOGGER.info("serviceTemplateId is {}, id is {}", csarId);
 
index 765ee52..d468443 100644 (file)
@@ -45,6 +45,8 @@ public class NSResourceInputParameter {
     private String nsServiceName;
 
     private String nsServiceDescription;
+    
+    private String nsServiceModelUUID;
 
     private NsParameters nsParameters;
 
@@ -136,4 +138,15 @@ public class NSResourceInputParameter {
     public void setNsScaleParameters(NsScaleParameters nsScaleParameters) {
         this.nsScaleParameters = nsScaleParameters;
     }
+
+
+       public String getNsServiceModelUUID() {
+               return nsServiceModelUUID;
+       }
+
+
+       public void setNsServiceModelUUID(String nsServiceModelUUID) {
+               this.nsServiceModelUUID = nsServiceModelUUID;
+       }
+    
 }
index fcbbf85..0bedd12 100644 (file)
@@ -83,7 +83,7 @@ public class RestfulUtil {
                 msbPort = msoPropertiesFactory.getMsoJavaProperties("MSO_PROP_TOPOLOGY").getProperty("msb-port", DEFAULT_MSB_PORT);
             }
         } catch(MsoPropertiesException e) {
-            LOGGER.error(MessageEnum.RA_NS_EXC, "VFC Adapter", "", MsoLogger.ErrorCode.AvailabilityError, "Get msb properties failed");
+            LOGGER.error(MessageEnum.RA_NS_EXC, "VFC Adapter", "", MsoLogger.ErrorCode.AvailabilityError, "Get msb properties failed",e);
             e.printStackTrace();
         }
         return "http://" + msbIp + ":" + msbPort;
index a817a6b..0b9ffd9 100644 (file)
@@ -381,7 +381,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                                return Integer.valueOf(inputValue);
                        }
                        catch (Exception e) {
-                               LOGGER.debug("Unable to convert " + inputValue + " to an integer!");
+                               LOGGER.debug("Unable to convert " + inputValue + " to an integer!" , e);
                                return null;
                        }
                } else if (type.equalsIgnoreCase("json")) {
@@ -390,7 +390,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                                return jsonNode;
                        }
                        catch (Exception e) {
-                               LOGGER.debug("Unable to convert " + inputValue + " to a JsonNode!");
+                               LOGGER.debug("Unable to convert " + inputValue + " to a JsonNode!", e);
                                return null;
                        }
                } else if (type.equalsIgnoreCase("boolean")) {
@@ -411,28 +411,28 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                        String str = "" + stackOutputs.get(key);
                        stringOutputs.put(key, str);
                } catch (Exception e) {
-                       LOGGER.debug("Unable to add " + key + " to outputs");
+                       LOGGER.debug("Unable to add " + key + " to outputs", e);
                }
             } else if (stackOutputs.get(key) instanceof JsonNode) {
                try {
                        String str = this.convertNode((JsonNode) stackOutputs.get(key));
                        stringOutputs.put(key, str);
                } catch (Exception e) {
-                       LOGGER.debug("Unable to add " + key + " to outputs - exception converting JsonNode");
+                       LOGGER.debug("Unable to add " + key + " to outputs - exception converting JsonNode", e);
                }
             } else if (stackOutputs.get(key) instanceof java.util.LinkedHashMap) {
                try {
                                        String str = JSON_MAPPER.writeValueAsString(stackOutputs.get(key));
                        stringOutputs.put(key, str);
                } catch (Exception e) {
-                       LOGGER.debug("Unable to add " + key + " to outputs - exception converting LinkedHashMap");
+                       LOGGER.debug("Unable to add " + key + " to outputs - exception converting LinkedHashMap", e);
                }
             } else {
                try {
                        String str = stackOutputs.get(key).toString();
                        stringOutputs.put(key, str);
                } catch (Exception e) {
-                       LOGGER.debug("Unable to add " + key + " to outputs - unable to call .toString() " + e.getMessage());
+                       LOGGER.debug("Unable to add " + key + " to outputs - unable to call .toString() " + e.getMessage(), e);
                }
             }
         }
@@ -510,7 +510,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                         String str = this.convertNode((JsonNode) obj);
                         stringMap.put(key, str);
                     } catch (Exception e) {
-                                               LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key);
+                                               LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for JsonNode "+ key, e);
                         //okay in this instance - only string values (fqdn) are expected to be needed
                     }
                 } else if (obj instanceof java.util.LinkedHashMap) {
@@ -519,21 +519,21 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
                         String str = JSON_MAPPER.writeValueAsString(obj);
                         stringMap.put(key, str);
                     } catch (Exception e) {
-                                               LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key);
+                                               LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for LinkedHashMap "+ key, e);
                                        }
                                }  else if (obj instanceof Integer) {
                                        try {
                                                String str = "" + obj;
                                                stringMap.put(key, str);
                                        } catch (Exception e) {
-                                               LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key);
+                                               LOGGER.debug("DANGER WILL ROBINSON: unable to convert value for Integer "+ key, e);
                     }
                 } else {
                     try {
                                                String str = obj.toString();
                         stringMap.put(key, str);
                     } catch (Exception e) {
-                                               LOGGER.debug("DANGER WILL ROBINSON: unable to convert value "+ key + " (" + e.getMessage() + ")");
+                                               LOGGER.debug("DANGER WILL ROBINSON: unable to convert value "+ key + " (" + e.getMessage() + ")", e);
                     }
                 }
             }
index a151b5d..7cc6ab8 100644 (file)
@@ -31,6 +31,7 @@ import java.util.Map.Entry;
 import java.util.Properties;
 
 import org.openecomp.mso.asdc.client.exceptions.ASDCParametersException;
+import org.openecomp.mso.logger.MsoLogger;
 import org.openecomp.mso.properties.MsoJsonProperties;
 import org.openecomp.mso.properties.MsoPropertiesException;
 import org.openecomp.mso.properties.MsoPropertiesFactory;
@@ -80,7 +81,8 @@ public class ASDCConfiguration implements IConfiguration {
     public static final String TOSCA_CSAR="TOSCA_CSAR";
     public static final String VF_MODULES_METADATA="VF_MODULES_METADATA";
 
-
+    private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
+    
     private static final String[] SUPPORTED_ARTIFACT_TYPES = {HEAT,
                HEAT_ARTIFACT,
                HEAT_ENV,
@@ -284,6 +286,7 @@ public class ASDCConfiguration implements IConfiguration {
             return null;
         }
                } catch (IOException e) {
+                       msoLogger.debug("IOException occured", e);
                         return null;
                }
     }
@@ -376,6 +379,7 @@ public class ASDCConfiguration implements IConfiguration {
                        return null;
                }
                } catch (IOException e) {
+                       msoLogger.debug("IOException occured", e);
                        return null;
                }
        }
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+package org.openecomp.mso.bpmn.common.recipe;
 
-package org.openecomp.mso.adapters.requestsdb;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
-import org.junit.Test;
+public class BpmnIntegerParam {
 
-public class HealthCheckHandlerTestException {
+       @JsonProperty("value")
+       private int value;
+       @JsonProperty("type")
+       private final String type = "Integer";
 
-    @Test(expected = NullPointerException.class)
-    public void testHealthCheckSiteNameNull() {
+       public BpmnIntegerParam() {
+       }
 
-        HealthCheckHandler hcH =  new HealthCheckHandler();
-        hcH.healthcheck("request");
-    }
-}
+       @JsonProperty("value")
+       public int getValue() {
+               return value;
+       }
 
+       @JsonProperty("type")
+       public void setValue(int value) {
+               this.value = value;
+       }
 
+       @Override
+       public String toString() {
+               return "CamundaInput [value=" + Integer.toString(value) + ", type=" + type + "]";
+       }
+}
index 016afa8..1dc0451 100644 (file)
@@ -115,9 +115,6 @@ public class BpmnRestClient {
 \r
         HttpPost post = new HttpPost(recipeUri);\r
         MsoJavaProperties props = loadMsoProperties();\r
-        RequestConfig requestConfig =\r
-                RequestConfig.custom().setSocketTimeout(recipeTimeout).setConnectTimeout(recipeTimeout).setConnectionRequestTimeout(recipeTimeout).build();\r
-        post.setConfig(requestConfig);\r
         msoLogger.debug("call the bpmn,  url:" + recipeUri);\r
         String jsonReq = wrapResourceRequest(requestId, recipeTimeout, requestAction, serviceInstanceId, serviceType, requestDetails, recipeParamXsd);\r
 \r
@@ -177,6 +174,8 @@ public class BpmnRestClient {
             BpmnParam serviceInstanceIdInput = new BpmnParam();\r
             BpmnParam serviceTypeInput = new BpmnParam();\r
             BpmnParam recipeParamsInput = new BpmnParam();\r
+            BpmnIntegerParam recipeTimeoutInput = new BpmnIntegerParam();\r
+            recipeTimeoutInput.setValue(recipeTimeout);\r
             // host.setValue(parseURL());\r
             requestIdInput.setValue(requestId);\r
             requestActionInput.setValue(requestAction);\r
@@ -191,6 +190,7 @@ public class BpmnRestClient {
             recipeRequest.setServiceType(serviceTypeInput);\r
             recipeRequest.setRecipeParams(recipeParamsInput);\r
             recipeRequest.setResourceInput(resourceInput);\r
+            recipeRequest.setRecipeTimeout(recipeTimeoutInput);\r
             jsonReq = recipeRequest.toString();\r
             msoLogger.debug("request body is " + jsonReq);\r
         } catch(Exception e) {\r
index 00e4ae7..13b1666 100644 (file)
-/*-\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-package org.openecomp.mso.bpmn.common.recipe;\r
-\r
-import org.openecomp.mso.bpmn.core.domain.ModelInfo;\r
-\r
-import com.fasterxml.jackson.annotation.JsonProperty;\r
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;\r
-import com.fasterxml.jackson.annotation.JsonRootName;\r
-import com.fasterxml.jackson.core.JsonProcessingException;\r
-import com.fasterxml.jackson.databind.ObjectMapper;\r
-import com.fasterxml.jackson.databind.SerializationFeature;\r
-\r
-/**\r
- * the inputs for the resource recipe\r
- * <br>\r
- * <p>\r
- * </p>\r
- * \r
- * @author\r
- * @version     ONAP Beijing Release  2018-03-08\r
- */\r
-@JsonPropertyOrder({"resourceInstanceName", "resourceInstanceDes", "globalSubscriberId", "serviceType", "serviceId", "operationId", "serviceModelInfo","resourceModelInfo", "resourceInstancenUuid","resourceParameters","operationType"})\r
-@JsonRootName("variables")\r
-public class ResourceInput {\r
-\r
-    @JsonProperty("resourceInstanceName")\r
-    private String resourceInstanceName;\r
-    \r
-    @JsonProperty("resourceInstanceDes")\r
-    private String resourceInstanceDes;\r
-    \r
-    @JsonProperty("globalSubscriberId")\r
-    private String globalSubscriberId;\r
-    \r
-    @JsonProperty("serviceType")\r
-    private String serviceType;\r
-    \r
-    @JsonProperty("serviceInstanceId")\r
-    private String serviceInstanceId;\r
-    \r
-    @JsonProperty("operationId")\r
-    private String operationId;\r
-    \r
-    @JsonProperty("serviceModelInfo")\r
-    private ModelInfo serviceModelInfo;\r
-    \r
-    @JsonProperty("resourceModelInfo")\r
-    private ModelInfo resourceModelInfo;\r
-    \r
-    //for delete resource\r
-    @JsonProperty("resourceInstancenUuid")\r
-    private String resourceInstancenUuid;\r
-    \r
-    @JsonProperty("resourceParameters")\r
-    private String resourceParameters;\r
-    \r
-    @JsonProperty("operationType")\r
-    private String operationType;\r
-\r
-    \r
-    /**\r
-     * @return Returns the resourceInstanceName.\r
-     */\r
-    @JsonProperty("resourceInstanceName")\r
-    public String getResourceInstanceName() {\r
-        return resourceInstanceName;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @param resourceInstanceName The resourceInstanceName to set.\r
-     */\r
-    @JsonProperty("resourceInstanceName")\r
-    public void setResourceInstanceName(String resourceInstanceName) {\r
-        this.resourceInstanceName = resourceInstanceName;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @return Returns the resourceInstanceDes.\r
-     */\r
-    @JsonProperty("resourceInstanceDes")\r
-    public String getResourceInstanceDes() {\r
-        return resourceInstanceDes;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @param resourceInstanceDes The resourceInstanceDes to set.\r
-     */\r
-    @JsonProperty("resourceInstanceDes")\r
-    public void setResourceInstanceDes(String resourceInstanceDes) {\r
-        this.resourceInstanceDes = resourceInstanceDes;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @return Returns the globalSubscriberId.\r
-     */\r
-    @JsonProperty("globalSubscriberId")\r
-    public String getGlobalSubscriberId() {\r
-        return globalSubscriberId;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @param globalSubscriberId The globalSubscriberId to set.\r
-     */\r
-    @JsonProperty("globalSubscriberId")\r
-    public void setGlobalSubscriberId(String globalSubscriberId) {\r
-        this.globalSubscriberId = globalSubscriberId;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @return Returns the serviceType.\r
-     */\r
-    @JsonProperty("serviceType")\r
-    public String getServiceType() {\r
-        return serviceType;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @param serviceType The serviceType to set.\r
-     */\r
-    @JsonProperty("serviceType")\r
-    public void setServiceType(String serviceType) {\r
-        this.serviceType = serviceType;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @return Returns the serviceId.\r
-     */\r
-    @JsonProperty("serviceInstanceId")\r
-    public String getServiceInstanceId() {\r
-        return serviceInstanceId;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @param serviceId The serviceId to set.\r
-     */\r
-    @JsonProperty("serviceInstanceId")\r
-    public void setServiceInstanceId(String serviceId) {\r
-        this.serviceInstanceId = serviceId;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @return Returns the operationId.\r
-     */\r
-    @JsonProperty("operationId")\r
-    public String getOperationId() {\r
-        return operationId;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @param operationId The operationId to set.\r
-     */\r
-    @JsonProperty("operationId")\r
-    public void setOperationId(String operationId) {\r
-        this.operationId = operationId;\r
-    }\r
-    \r
-    /**\r
-     * @return Returns the serviceModelInfo.\r
-     */\r
-    @JsonProperty("serviceModelInfo")\r
-    public ModelInfo getServiceModelInfo() {\r
-        return serviceModelInfo;\r
-    }\r
-\r
-\r
-    \r
-    /**\r
-     * @param serviceModelInfo The serviceModelInfo to set.\r
-     */\r
-    @JsonProperty("serviceModelInfo")\r
-    public void setServiceModelInfo(ModelInfo serviceModelInfo) {\r
-        this.serviceModelInfo = serviceModelInfo;\r
-    }\r
-\r
-\r
-    \r
-    /**\r
-     * @return Returns the resourceModelInfo.\r
-     */\r
-    @JsonProperty("resourceModelInfo")\r
-    public ModelInfo getResourceModelInfo() {\r
-        return resourceModelInfo;\r
-    }\r
-\r
-\r
-    \r
-    /**\r
-     * @param resourceModelInfo The resourceModelInfo to set.\r
-     */\r
-    @JsonProperty("resourceModelInfo")\r
-    public void setResourceModelInfo(ModelInfo resourceModelInfo) {\r
-        this.resourceModelInfo = resourceModelInfo;\r
-    }\r
-\r
-\r
-    /**\r
-     * @return Returns the resourceParameters.\r
-     */\r
-    @JsonProperty("resourceParameters")\r
-    public String getResourceParameters() {\r
-        return resourceParameters;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @param resourceParameters The resourceParameters to set.\r
-     */\r
-    @JsonProperty("resourceParameters")\r
-    public void setResourceParameters(String resourceParameters) {\r
-        this.resourceParameters = resourceParameters;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @return Returns the operationType.\r
-     */\r
-    @JsonProperty("operationType")\r
-    public String getOperationType() {\r
-        return operationType;\r
-    }\r
-\r
-    \r
-    /**\r
-     * @param operationType The operationType to set.\r
-     */\r
-    @JsonProperty("operationType")\r
-    public void setOperationType(String operationType) {\r
-        this.operationType = operationType;\r
-    }\r
-\r
-\r
-    \r
-    /**\r
-     * @return Returns the resourceInstancenUuid.\r
-     */\r
-    @JsonProperty("resourceInstancenUuid")\r
-    public String getResourceInstancenUuid() {\r
-        return resourceInstancenUuid;\r
-    }\r
-\r
-\r
-    \r
-    /**\r
-     * @param resourceInstancenUuid The resourceInstancenUuid to set.\r
-     */\r
-    @JsonProperty("resourceInstancenUuid")\r
-    public void setResourceInstancenUuid(String resourceInstancenUuid) {\r
-        this.resourceInstancenUuid = resourceInstancenUuid;\r
-    }\r
-    \r
-    @Override\r
-    public String toString() {\r
-        ObjectMapper mapper = new ObjectMapper();\r
-        mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);\r
-        String jsonStr = "";\r
-        try {\r
-            jsonStr = mapper.writeValueAsString(this);\r
-        } catch(JsonProcessingException e) {\r
-\r
-            e.printStackTrace();\r
-        }\r
-        return jsonStr;\r
-    }\r
-}\r
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.bpmn.common.recipe;
+
+import org.openecomp.mso.bpmn.core.domain.ModelInfo;
+import org.openecomp.mso.logger.MsoLogger;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+
+/**
+ * the inputs for the resource recipe
+ * <br>
+ * <p>
+ * </p>
+ * 
+ * @author
+ * @version     ONAP Beijing Release  2018-03-08
+ */
+@JsonPropertyOrder({"resourceInstanceName", "resourceInstanceDes", "globalSubscriberId", "serviceType", "serviceId", "operationId", "serviceModelInfo","resourceModelInfo", "resourceInstancenUuid","resourceParameters","operationType"})
+@JsonRootName("variables")
+public class ResourceInput {
+
+       private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
+       
+    @JsonProperty("resourceInstanceName")
+    private String resourceInstanceName;
+    
+    @JsonProperty("resourceInstanceDes")
+    private String resourceInstanceDes;
+    
+    @JsonProperty("globalSubscriberId")
+    private String globalSubscriberId;
+    
+    @JsonProperty("serviceType")
+    private String serviceType;
+    
+    @JsonProperty("serviceInstanceId")
+    private String serviceInstanceId;
+    
+    @JsonProperty("operationId")
+    private String operationId;
+    
+    @JsonProperty("serviceModelInfo")
+    private ModelInfo serviceModelInfo;
+    
+    @JsonProperty("resourceModelInfo")
+    private ModelInfo resourceModelInfo;
+    
+    //for delete resource
+    @JsonProperty("resourceInstancenUuid")
+    private String resourceInstancenUuid;
+    
+    @JsonProperty("resourceParameters")
+    private String resourceParameters;
+    
+    @JsonProperty("operationType")
+    private String operationType;
+
+    
+    /**
+     * @return Returns the resourceInstanceName.
+     */
+    @JsonProperty("resourceInstanceName")
+    public String getResourceInstanceName() {
+        return resourceInstanceName;
+    }
+
+    
+    /**
+     * @param resourceInstanceName The resourceInstanceName to set.
+     */
+    @JsonProperty("resourceInstanceName")
+    public void setResourceInstanceName(String resourceInstanceName) {
+        this.resourceInstanceName = resourceInstanceName;
+    }
+
+    
+    /**
+     * @return Returns the resourceInstanceDes.
+     */
+    @JsonProperty("resourceInstanceDes")
+    public String getResourceInstanceDes() {
+        return resourceInstanceDes;
+    }
+
+    
+    /**
+     * @param resourceInstanceDes The resourceInstanceDes to set.
+     */
+    @JsonProperty("resourceInstanceDes")
+    public void setResourceInstanceDes(String resourceInstanceDes) {
+        this.resourceInstanceDes = resourceInstanceDes;
+    }
+
+    
+    /**
+     * @return Returns the globalSubscriberId.
+     */
+    @JsonProperty("globalSubscriberId")
+    public String getGlobalSubscriberId() {
+        return globalSubscriberId;
+    }
+
+    
+    /**
+     * @param globalSubscriberId The globalSubscriberId to set.
+     */
+    @JsonProperty("globalSubscriberId")
+    public void setGlobalSubscriberId(String globalSubscriberId) {
+        this.globalSubscriberId = globalSubscriberId;
+    }
+
+    
+    /**
+     * @return Returns the serviceType.
+     */
+    @JsonProperty("serviceType")
+    public String getServiceType() {
+        return serviceType;
+    }
+
+    
+    /**
+     * @param serviceType The serviceType to set.
+     */
+    @JsonProperty("serviceType")
+    public void setServiceType(String serviceType) {
+        this.serviceType = serviceType;
+    }
+
+    
+    /**
+     * @return Returns the serviceId.
+     */
+    @JsonProperty("serviceInstanceId")
+    public String getServiceInstanceId() {
+        return serviceInstanceId;
+    }
+
+    
+    /**
+     * @param serviceId The serviceId to set.
+     */
+    @JsonProperty("serviceInstanceId")
+    public void setServiceInstanceId(String serviceId) {
+        this.serviceInstanceId = serviceId;
+    }
+
+    
+    /**
+     * @return Returns the operationId.
+     */
+    @JsonProperty("operationId")
+    public String getOperationId() {
+        return operationId;
+    }
+
+    
+    /**
+     * @param operationId The operationId to set.
+     */
+    @JsonProperty("operationId")
+    public void setOperationId(String operationId) {
+        this.operationId = operationId;
+    }
+    
+    /**
+     * @return Returns the serviceModelInfo.
+     */
+    @JsonProperty("serviceModelInfo")
+    public ModelInfo getServiceModelInfo() {
+        return serviceModelInfo;
+    }
+
+
+    
+    /**
+     * @param serviceModelInfo The serviceModelInfo to set.
+     */
+    @JsonProperty("serviceModelInfo")
+    public void setServiceModelInfo(ModelInfo serviceModelInfo) {
+        this.serviceModelInfo = serviceModelInfo;
+    }
+
+
+    
+    /**
+     * @return Returns the resourceModelInfo.
+     */
+    @JsonProperty("resourceModelInfo")
+    public ModelInfo getResourceModelInfo() {
+        return resourceModelInfo;
+    }
+
+
+    
+    /**
+     * @param resourceModelInfo The resourceModelInfo to set.
+     */
+    @JsonProperty("resourceModelInfo")
+    public void setResourceModelInfo(ModelInfo resourceModelInfo) {
+        this.resourceModelInfo = resourceModelInfo;
+    }
+
+
+    /**
+     * @return Returns the resourceParameters.
+     */
+    @JsonProperty("resourceParameters")
+    public String getResourceParameters() {
+        return resourceParameters;
+    }
+
+    
+    /**
+     * @param resourceParameters The resourceParameters to set.
+     */
+    @JsonProperty("resourceParameters")
+    public void setResourceParameters(String resourceParameters) {
+        this.resourceParameters = resourceParameters;
+    }
+
+    
+    /**
+     * @return Returns the operationType.
+     */
+    @JsonProperty("operationType")
+    public String getOperationType() {
+        return operationType;
+    }
+
+    
+    /**
+     * @param operationType The operationType to set.
+     */
+    @JsonProperty("operationType")
+    public void setOperationType(String operationType) {
+        this.operationType = operationType;
+    }
+
+
+    
+    /**
+     * @return Returns the resourceInstancenUuid.
+     */
+    @JsonProperty("resourceInstancenUuid")
+    public String getResourceInstancenUuid() {
+        return resourceInstancenUuid;
+    }
+
+
+    
+    /**
+     * @param resourceInstancenUuid The resourceInstancenUuid to set.
+     */
+    @JsonProperty("resourceInstancenUuid")
+    public void setResourceInstancenUuid(String resourceInstancenUuid) {
+        this.resourceInstancenUuid = resourceInstancenUuid;
+    }
+    
+    @Override
+    public String toString() {
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
+        String jsonStr = "";
+        try {
+            jsonStr = mapper.writeValueAsString(this);
+        } catch(JsonProcessingException e) {
+               msoLogger.debug("JsonProcessingException", e);
+            e.printStackTrace();
+        }
+        return jsonStr;
+    }
+}
index 5bf5a02..a1809fe 100644 (file)
@@ -20,6 +20,8 @@
 
 package org.openecomp.mso.bpmn.common.recipe;
 
+import org.openecomp.mso.logger.MsoLogger;
+
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 import com.fasterxml.jackson.annotation.JsonRootName;
@@ -35,6 +37,8 @@ import com.fasterxml.jackson.databind.SerializationFeature;
 @JsonRootName("variables")
 public class ResourceRecipeRequest {
 
+       private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
+       
     @JsonProperty("resourceInput")
     private BpmnParam resourceInput;
 
@@ -56,6 +60,9 @@ public class ResourceRecipeRequest {
     @JsonProperty("recipeParams")
     private BpmnParam recipeParams;
 
+    @JsonProperty("recipeTimeout")
+    private BpmnIntegerParam recipeTimeout;
+    
     @JsonProperty("resourceInput")
     public BpmnParam getResourceInput() {
         return resourceInput;
@@ -126,7 +133,17 @@ public class ResourceRecipeRequest {
         this.recipeParams = recipeParams;
     }
 
-    @Override
+    @JsonProperty("recipeTimeout")
+    public BpmnIntegerParam getRecipeTimeout() {
+               return recipeTimeout;
+       }
+    
+    @JsonProperty("recipeTimeout")
+       public void setRecipeTimeout(BpmnIntegerParam recipeTimeout) {
+               this.recipeTimeout = recipeTimeout;
+       }
+
+       @Override
     public String toString() {
         ObjectMapper mapper = new ObjectMapper();
         mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
@@ -134,7 +151,7 @@ public class ResourceRecipeRequest {
         try {
             jsonStr = mapper.writeValueAsString(this);
         } catch(JsonProcessingException e) {
-
+               msoLogger.debug("JsonProcessingException", e);
             e.printStackTrace();
         }
         return jsonStr;
index 9aa1793..c888002 100644 (file)
@@ -22,6 +22,7 @@ package org.openecomp.mso.bpmn.common.resource;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -34,9 +35,6 @@ import org.camunda.bpm.engine.runtime.Execution;
 import org.jboss.resteasy.client.jaxrs.ResteasyClient;
 import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
 import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
-import org.openecomp.mso.bpmn.core.json.JsonUtils;
-import org.openecomp.mso.logger.MessageEnum;
-import org.openecomp.mso.logger.MsoLogger;
 import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
 import org.onap.sdc.tosca.parser.exceptions.SdcToscaParserException;
 import org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory;
@@ -44,6 +42,10 @@ import org.onap.sdc.toscaparser.api.NodeTemplate;
 import org.onap.sdc.toscaparser.api.Property;
 import org.onap.sdc.toscaparser.api.functions.GetInput;
 import org.onap.sdc.toscaparser.api.parameters.Input;
+import org.openecomp.mso.bpmn.core.PropertyConfiguration;
+import org.openecomp.mso.bpmn.core.json.JsonUtils;
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoLogger;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -55,10 +57,11 @@ public class ResourceRequestBuilder {
 
     public static String CUSTOMIZATION_UUID = "customizationUUID";
 
-    public static String SERVICE_URL_TOSCA_CSAR = "http://mso:8080/ecomp/mso/catalog/v3/serviceToscaCsar?serviceModelUuid=";
+    public static String SERVICE_URL_TOSCA_CSAR = "/v3/serviceToscaCsar?serviceModelUuid=";
 
     private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
 
+   
     static JsonUtils jsonUtil = new JsonUtils();
 
         /**
@@ -106,6 +109,7 @@ public class ResourceRequestBuilder {
             Map<String, Object> resourceInputsFromServiceDeclaredLevel = buildResouceRequest(serviceUuid, resourceCustomizationUuid, serviceInput);
             resourceInputsFromUuiMap.putAll(resourceInputsFromServiceDeclaredLevel);
         } catch(SdcToscaParserException e) {
+               LOGGER.debug("SdcToscaParserException", e);
             e.printStackTrace();
         }
         String resourceInputsStr = getJsonString(resourceInputsFromUuiMap);
@@ -120,7 +124,6 @@ public class ResourceRequestBuilder {
             throws SdcToscaParserException {
 
         Map<String, Object> resouceRequest = new HashMap<>();
-
         String csarpath = null;
         try {
             csarpath = getCsarFromUuid(serviceUuid);
@@ -179,7 +182,9 @@ public class ResourceRequestBuilder {
     private static String getCsarFromUuid(String uuid) throws Exception {
 
         ResteasyClient client = new ResteasyClientBuilder().build();
-        ResteasyWebTarget target = client.target(SERVICE_URL_TOSCA_CSAR + uuid);
+               Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
+               String catalogEndPoint = properties.get("mso.catalog.db.endpoint");
+               ResteasyWebTarget target = client.target(catalogEndPoint + SERVICE_URL_TOSCA_CSAR + uuid);
         Response response = target.request().get();
         String value = response.readEntity(String.class);
 
@@ -212,7 +217,7 @@ public class ResourceRequestBuilder {
         try {
             jsonStr = mapper.writeValueAsString(srcObj);
         } catch(JsonProcessingException e) {
-
+               LOGGER.debug("SdcToscaParserException", e);
             e.printStackTrace();
         }
         return jsonStr;
index 8126614..ede76c0 100644 (file)
  * ============LICENSE_END=========================================================\r
  */\r
 \r
-package org.openecomp.mso.bpmn.infrastructure.scripts;\r
+package org.openecomp.mso.bpmn.infrastructure.scripts\r
+\r
+import org.json.JSONObject\r
+import org.json.XML;\r
 \r
 import static org.apache.commons.lang3.StringUtils.*;\r
 import groovy.xml.XmlUtil\r
@@ -117,7 +120,23 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)\r
         }\r
     }\r
-    \r
+\r
+    String customizeResourceParam(String netowrkInputParametersJson) {\r
+        List<Map<String, Object>> paramList = new ArrayList();\r
+        JSONObject jsonObject = new JSONObject(netowrkInputParametersJson);\r
+        Iterator iterator = jsonObject.keys();\r
+        while (iterator.hasNext()) {\r
+            String key = iterator.next();\r
+            HashMap<String, String> hashMap = new HashMap();\r
+            hashMap.put("name", key);\r
+            hashMap.put("value", jsonObject.get(key))\r
+            paramList.add(hashMap)\r
+        }\r
+        Map<String, List<Map<String, Object>>> paramMap = new HashMap();\r
+        paramMap.put("param", paramList);\r
+\r
+        return  new JSONObject(paramMap).toString();\r
+    }\r
     \r
     /**\r
      * Pre Process the BPMN Flow Request\r
@@ -144,8 +163,8 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
             String serviceType = resourceInputObj.getServiceType()\r
             String serviceModelInvariantUuid = resourceInputObj.getServiceModelInfo().getModelInvariantUuid()\r
             String serviceModelUuid = resourceInputObj.getServiceModelInfo().getModelUuid()\r
-            String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelName()\r
-            String serviceModelName = resourceInputObj.getServiceModelInfo().getModelVersion()\r
+            String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelVersion()\r
+            String serviceModelName = resourceInputObj.getServiceModelInfo().getModelName()\r
             String globalCustomerId = resourceInputObj.getGlobalSubscriberId()\r
             String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid();\r
             String modelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()\r
@@ -155,7 +174,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
             String resourceInputPrameters = resourceInputObj.getResourceParameters()\r
             String netowrkInputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")\r
             //here convert json string to xml string\r
-            String netowrkInputParameters = jsonUtil.json2xml(netowrkInputParametersJson)\r
+            String netowrkInputParameters = XML.toString(new JSONObject(customizeResourceParam(netowrkInputParametersJson)))\r
             // 1. prepare assign topology via SDNC Adapter SUBFLOW call\r
             String sndcTopologyCreateRequest =\r
                     """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"\r
@@ -179,14 +198,14 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
                                         <order-version></order-version>\r
                                      </request-information>\r
                                      <service-information>\r
-                                        <service-id>${sdnc_service_id}</service-id>\r
+                                        <service-id>${serviceInstanceId}</service-id>\r
                                         <subscription-service-type>${serviceType}</subscription-service-type>\r
-                                        <ecomp-model-information>\r
+                                        <onap-model-information>\r
                                              <model-invariant-uuid>${serviceModelInvariantUuid}</model-invariant-uuid>\r
                                              <model-uuid>${serviceModelUuid}</model-uuid>\r
                                              <model-version>${serviceModelVersion}</model-version>\r
                                              <model-name>${serviceModelName}</model-name>\r
-                                        </ecomp-model-information>\r
+                                        </onap-model-information>\r
                                         <service-instance-id>${serviceInstanceId}</service-instance-id>\r
                                         <global-customer-id>${globalCustomerId}</global-customer-id>\r
                                      </service-information>\r
@@ -219,6 +238,77 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
        utils.log("INFO"," ***** Exit prepareSDNCRequest *****",  isDebugEnabled)\r
        }\r
 \r
+    private void setProgressUpdateVariables(DelegateExecution execution, String body) {\r
+        def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")\r
+        execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)\r
+        execution.setVariable("CVFMI_updateResOperStatusRequest", body)\r
+    }\r
+\r
+    public void prepareUpdateBeforeCreateSDNCResource(DelegateExecution execution) {\r
+        ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput")\r
+        String operType = resourceInputObj.getOperationType()\r
+        String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()\r
+        String ServiceInstanceId = resourceInputObj.getServiceInstanceId()\r
+        String operationId = resourceInputObj.getOperationId()\r
+        String progress = "20"\r
+        String status = "processing"\r
+        String statusDescription = "SDCN resource creation invoked"\r
+\r
+        execution.getVariable("operationId")\r
+\r
+        String body = """\r
+                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\r
+                        xmlns:ns="http://org.openecomp.mso/requestsdb">\r
+                        <soapenv:Header/>\r
+                <soapenv:Body>\r
+                    <ns:updateResourceOperationStatus>\r
+                               <operType>${operType}</operType>\r
+                               <operationId>${operationId}</operationId>\r
+                               <progress>${progress}</progress>\r
+                               <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID>\r
+                               <serviceId>${ServiceInstanceId}</serviceId>\r
+                               <status>${status}</status>\r
+                               <statusDescription>${statusDescription}</statusDescription>\r
+                    </ns:updateResourceOperationStatus>\r
+                </soapenv:Body>\r
+                </soapenv:Envelope>""";\r
+\r
+        setProgressUpdateVariables(execution, body)\r
+\r
+    }\r
+\r
+    public void prepareUpdateAfterCreateSDNCResource(execution) {\r
+        ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput")\r
+        String operType = resourceInputObj.getOperationType()\r
+        String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()\r
+        String ServiceInstanceId = resourceInputObj.getServiceInstanceId()\r
+        String operationId = resourceInputObj.getOperationId()\r
+        String progress = "100"\r
+        String status = "Created"\r
+        String statusDescription = "SDCN resource creation completed"\r
+\r
+        execution.getVariable("operationId")\r
+\r
+        String body = """\r
+                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\r
+                        xmlns:ns="http://org.openecomp.mso/requestsdb">\r
+                        <soapenv:Header/>\r
+                <soapenv:Body>\r
+                    <ns:updateResourceOperationStatus>\r
+                               <operType>${operType}</operType>\r
+                               <operationId>${operationId}</operationId>\r
+                               <progress>${progress}</progress>\r
+                               <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID>\r
+                               <serviceId>${ServiceInstanceId}</serviceId>\r
+                               <status>${status}</status>\r
+                               <statusDescription>${statusDescription}</statusDescription>\r
+                    </ns:updateResourceOperationStatus>\r
+                </soapenv:Body>\r
+                </soapenv:Envelope>""";\r
+\r
+        setProgressUpdateVariables(execution, body)\r
+    }\r
+\r
     public void postCreateSDNCCall(DelegateExecution execution){\r
         def isDebugEnabled = execution.getVariable("isDebugLogEnabled")\r
         utils.log("INFO"," ***** Started prepareSDNCRequest *****",  isDebugEnabled)\r
index 9456007..9f3910b 100644 (file)
@@ -80,6 +80,8 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
            //deal with operation key\r
            String globalSubscriberId = jsonUtil.getJsonValue(resourceInput, "globalSubscriberId")\r
            utils.log("INFO", "globalSubscriberId:" + globalSubscriberId, isDebugEnabled)\r
+           //set local globalSubscriberId variable\r
+           execution.setVariable("globalSubscriberId", globalSubscriberId);\r
 \r
            String serviceType = execution.getVariable("serviceType")\r
            utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled)\r
@@ -87,10 +89,11 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
            String serviceId = execution.getVariable("serviceInstanceId")\r
            utils.log("INFO", "serviceId:" + serviceId, isDebugEnabled)\r
 \r
-           String operationId = execution.getVariable("requestId")\r
+           String operationId = jsonUtil.getJsonValue(resourceInput, "operationId")\r
            utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled)\r
 \r
-           String nodeTemplateUUID = jsonUtil.getJsonValue(resourceParameters, "requestInputs.nsd0_providing_service_uuid")\r
+           String nodeTemplateUUID = jsonUtil.getJsonValue(resourceInput, "resourceModelInfo.modelCustomizationUuid")\r
+           String nsServiceModelUUID = jsonUtil.getJsonValue(resourceParameters, "requestInputs.nsd0_providing_service_uuid")\r
            utils.log("INFO", "nodeTemplateUUID:" + nodeTemplateUUID, isDebugEnabled)\r
            /*\r
             * segmentInformation needed as a object of segment\r
@@ -114,6 +117,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
                     }"""\r
            execution.setVariable("nsOperationKey", nsOperationKey);\r
            execution.setVariable("nsParameters", nsParameters)\r
+           execution.setVariable("nsServiceModelUUID", nsServiceModelUUID);\r
            \r
 \r
        } catch (BpmnError e) {\r
@@ -133,6 +137,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
         utils.log("INFO"," *****  createNetworkService *****",  isDebugEnabled)\r
         String nsOperationKey = execution.getVariable("nsOperationKey");\r
+        String nsServiceModelUUID = execution.getVariable("nsServiceModelUUID");\r
         String nsParameters = execution.getVariable("nsParameters");\r
         String nsServiceName = execution.getVariable("nsServiceName")\r
         String nsServiceDescription = execution.getVariable("nsServiceDescription")\r
@@ -141,6 +146,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
         String reqBody ="""{\r
                 "nsServiceName":"${nsServiceName}",\r
                 "nsServiceDescription":"${nsServiceDescription}",\r
+                "nsServiceModelUUID":"${nsServiceModelUUID}",\r
                 "nsOperationKey":${nsOperationKey},\r
                 "nsParameters":{\r
                      "locationConstraints":${locationConstraints},\r
@@ -305,4 +311,26 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
         }        \r
         return apiResponse\r
     }\r
+    \r
+       public void sendSyncResponse (DelegateExecution execution) {\r
+               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
+               utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)\r
+\r
+               try {\r
+                       String nsInstanceId = execution.getVariable("nsInstanceId")\r
+                       String operationStatus = execution.getVariable("operationStatus")\r
+                       // RESTResponse for main flow\r
+                       String createVFCResourceRestRsp = """{"nsInstanceId":"${nsInstanceId}","operationStatus":"${operationStatus}"}""".trim()\r
+                       utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + createVFCResourceRestRsp, isDebugEnabled)\r
+                       sendWorkflowResponse(execution, 202, createVFCResourceRestRsp)\r
+                       execution.setVariable("sentSyncResponse", true)\r
+\r
+               } catch (Exception ex) {\r
+                       String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()\r
+                       utils.log("DEBUG", msg, isDebugEnabled)\r
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)\r
+               }\r
+               utils.log("DEBUG"," ***** Exit sendSyncResopnse *****",  isDebugEnabled)\r
+       }\r
+\r
 }\r
index d218adc..ebf9ae7 100644 (file)
@@ -73,9 +73,9 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                        \r
 \r
                        String requestId = execution.getVariable("mso-request-id")\r
-                       execution.setVariable("msoRequestId", requestId)\r
+                       execution.setVariable("msoRequestId", requestId)                        \r
                        utils.log("INFO", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)\r
-                       \r
+               \r
                        String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
                        if (isBlank(serviceInstanceId)) {\r
                                msg = "Input serviceInstanceId' is null"\r
@@ -114,7 +114,9 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                        } else {\r
                                execution.setVariable("subscriptionServiceType", subscriptionServiceType)\r
                        }\r
-\r
+                       String operationId = jsonUtil.getJsonValue(siRequest, "operationId")\r
+                       execution.setVariable("operationId", operationId)\r
+                                       \r
                        execution.setVariable("operationType", "DELETE")\r
                } catch (BpmnError e) {\r
                        throw e;\r
@@ -129,13 +131,9 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
        public void sendSyncResponse (DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                utils.log("INFO", " *** sendSyncResponse  *** ", isDebugEnabled)\r
-\r
                try {\r
-                       String requestId = execution.getVariable("msoRequestId")\r
-                       String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
-\r
-                       // RESTResponse (for API Handler (APIH) Reply Task)\r
-                       String syncResponse = """{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()\r
+                       String operationId = execution.getVariable("operationId")\r
+                       String syncResponse = """{"operationId":"${operationId}"}""".trim()\r
                        utils.log("INFO", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)\r
                        sendWorkflowResponse(execution, 202, syncResponse)\r
 \r
index 267673d..73d51c9 100644 (file)
@@ -396,7 +396,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
         utils.log("INFO", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
         try{
             String serviceId = execution.getVariable("serviceInstanceId")
-            String operationId = execution.getVariable("msoRequestId")
+            String operationId = execution.getVariable("operationId")
             String operationType = execution.getVariable("operationType")
             String resourceTemplateUUIDs = ""
             String result = "processing"
index 7ccc1b0..ae75d54 100644 (file)
@@ -20,6 +20,7 @@
  
 package org.openecomp.mso.bpmn.infrastructure.scripts
 
+import org.codehaus.jackson.map.ObjectMapper
 import org.openecomp.mso.bpmn.infrastructure.properties.BPMNProperties
 
 import java.util.ArrayList
@@ -146,7 +147,28 @@ public class DoCreateResources extends AbstractServiceTaskProcessor
         execution.setVariable("sequencedResourceList", sequencedResourceList)
         utils.log("INFO", "sequencedResourceList: " + sequencedResourceList, isDebugEnabled) 
         utils.log("INFO", "======== COMPLETED sequenceResoure Process ======== ", isDebugEnabled)
-    }   
+    }
+
+    public prepareServiceTopologyRequest(DelegateExecution execution) {
+
+        def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+        utils.log("INFO", "======== Start prepareServiceTopologyRequest Process ======== ", isDebugEnabled)
+
+        String serviceDecompose = execution.getVariable("serviceDecomposition")
+
+        execution.setVariable("operationType", "create")
+        execution.setVariable("resourceType", "")
+
+        String serviceInvariantUuid = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelInvariantUuid")
+        String serviceUuid = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelUuid")
+        String serviceModelName = jsonUtil.getJsonValue(serviceDecompose, "serviceResources.modelInfo.modelName")
+
+        execution.setVariable("modelInvariantUuid", serviceInvariantUuid)
+        execution.setVariable("modelUuid", serviceUuid)
+        execution.setVariable("serviceModelName", serviceModelName)
+
+        utils.log("INFO", "======== End prepareServiceTopologyRequest Process ======== ", isDebugEnabled)
+    }
    
     public void getCurrentResoure(DelegateExecution execution){
            def isDebugEnabled=execution.getVariable("isDebugLogEnabled")   
@@ -187,7 +209,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor
                 String serviceType = execution.getVariable("serviceType")
                 String serviceInstanceId = execution.getVariable("serviceInstanceId")
                 String operationId = execution.getVariable("operationId")
-                String operationType = execution.getVariable("operationType")
+                String operationType = "createInstance"
                 resourceInput.setGlobalSubscriberId(globalSubscriberId)
                 resourceInput.setServiceType(serviceType)
                 resourceInput.setServiceInstanceId(serviceInstanceId)
index 98a1a43..d44de7c 100644 (file)
@@ -316,7 +316,7 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
         utils.log("INFO"," *** Exit postProcessAAIGET *** ", isDebugEnabled)
     }
 
-   public void getCurrentNS(execution){
+   public void getCurrentNS(DelegateExecution execution){
        def isDebugEnabled=execution.getVariable("isDebugLogEnabled")   
        utils.log("INFO", "======== Start getCurrentNS Process ======== ", isDebugEnabled)    
        
index 6e19a34..63ecb45 100644 (file)
@@ -43,8 +43,6 @@ import org.openecomp.mso.bpmn.core.json.JsonUtils
 import org.openecomp.mso.bpmn.infrastructure.properties.BPMNProperties
 
 import static org.apache.commons.lang3.StringUtils.isBlank
-import static org.apache.commons.lang3.StringUtils.isBlank
-
 
 /**
  * input for script :
@@ -144,7 +142,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
         utils.log("INFO"," ***** Exit preProcessRequest *****",  isDebugEnabled)
     }
 
-    public void sequenceResource(execution){
+    public void sequenceResource(DelegateExecution execution){
         def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
 
         utils.log("INFO", " ======== STARTED sequenceResource Process ======== ", isDebugEnabled)
@@ -175,6 +173,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
             //this is defaule sequence
             List<VnfResource> vnfResourceList = new ArrayList<VnfResource>()
             List<AllottedResource> arResourceList = new ArrayList<AllottedResource>()
+                       List<NetworkResource> networkResourceList = new ArrayList<NetworkResource>()
 
             for (Resource rc : delResourceList) {
                 if (rc instanceof VnfResource) {
@@ -203,7 +202,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
     /**
      * prepare delete parameters
      */
-    public void preResourceDelete(execution, resourceName){
+    public void preResourceDelete(DelegateExecution execution, String resourceName){
 
         def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
 
@@ -230,7 +229,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
     /**
      * Execute delete workflow for resource
      */
-    public void executeResourceDelete(execution, resourceName) {
+    public void executeResourceDelete(DelegateExecution execution, String resourceName) {
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
         utils.log("INFO", "======== Start executeResourceDelete Process ======== ", isDebugEnabled)
         String requestId = execution.getVariable("msoRequestId")
@@ -266,7 +265,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
     }
 
 
-    public void parseNextResource(execution){
+    public void parseNextResource(DelegateExecution execution){
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
         utils.log("INFO", "======== Start parseNextResource Process ======== ", isDebugEnabled)
         def currentIndex = execution.getVariable("currentResourceIndex")
index 9540508..f29db92 100644 (file)
@@ -58,24 +58,21 @@ import org.springframework.web.util.UriUtils;
  * Inputs:\r
  * @param - msoRequestId\r
  * @param - globalSubscriberId\r
- * @param - subscriptionServiceType\r
+ * @param - serviceType\r
  * @param - serviceInstanceId\r
- * @param - serviceInstanceName - O\r
+ * @param - serviceInstanceName\r
  * @param - serviceModelInfo\r
  * @param - productFamilyId\r
- * @param - disableRollback\r
- * @param - failExists - TODO\r
- * @param - serviceInputParams (should contain aic_zone for serviceTypes TRANSPORT,ATM)\r
- * @param - sdncVersion ("1610")\r
- * @param - serviceDecomposition - Decomposition for R1710 \r
- * (if macro provides serviceDecompsition then serviceModelInfo, serviceInstanceId & serviceInstanceName will be ignored)\r
- *\r
+ * @param - uuiRequest\r
+ * @param - serviceDecomposition_Target\r
+ * @param - serviceDecomposition_Original\r
+ * @param - addResourceList\r
+ * @param - delResourceList\r
+ * \r
  * Outputs:\r
  * @param - rollbackData (localRB->null)\r
  * @param - rolledBack (no localRB->null, localRB F->false, localRB S->true)\r
  * @param - WorkflowException\r
- * @param - serviceInstanceName - (GET from AAI if null in input)\r
- *\r
  */\r
 public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {\r
 \r
@@ -87,24 +84,22 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
 \r
        public void preProcessRequest (DelegateExecution execution) {\r
                def isDebugEnabled = execution.getVariable("isDebugLogEnabled")\r
-               \r
-               def method = getClass().getSimpleName() + '.preProcessRequest(' +'execution=' + execution.getId() +')'          \r
-               utils.log("INFO","Entered " + method, isDebugEnabled)\r
-               String msg = ""\r
                utils.log("INFO"," ***** Enter DoUpdateE2EServiceInstance preProcessRequest *****",  isDebugEnabled)\r
+               \r
+               String msg = "" \r
 \r
                try {\r
                        execution.setVariable("prefix", Prefix)\r
                        //Inputs\r
-                       //requestDetails.subscriberInfo. for AAI GET & PUT & SDNC assignToplology\r
+                       //for AAI GET & PUT & SDNC assignToplology\r
                        String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId\r
                        utils.log("INFO"," ***** globalSubscriberId *****" + globalSubscriberId,  isDebugEnabled)\r
                        \r
-                       //requestDetails.requestParameters. for AAI PUT & SDNC assignTopology\r
+                       //for AAI PUT & SDNC assignTopology\r
                        String serviceType = execution.getVariable("serviceType")\r
                        utils.log("INFO"," ***** serviceType *****" + serviceType,  isDebugEnabled)\r
                        \r
-                       //requestDetails.requestParameters. for SDNC assignTopology\r
+                       //for SDNC assignTopology\r
                        String productFamilyId = execution.getVariable("productFamilyId") //AAI productFamilyId\r
 \r
                        if (isBlank(globalSubscriberId)) {\r
@@ -126,31 +121,16 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
                                utils.log("INFO", msg, isDebugEnabled)\r
                                exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)\r
                        }\r
-                       \r
-                       if (productFamilyId == null) {\r
-                               execution.setVariable("productFamilyId", "")\r
-                       }\r
 \r
                        String serviceInstanceName = execution.getVariable("serviceInstanceName")\r
-                       String uuiRequest = execution.getVariable("uuiRequest")\r
-                       utils.log("INFO","uuiRequest: " + uuiRequest, isDebugEnabled)\r
-                       \r
-                       String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")\r
-                       utils.log("INFO","modelInvariantUuid: " + modelInvariantUuid, isDebugEnabled)\r
-                       execution.setVariable("modelInvariantUuid", modelInvariantUuid)\r
-                       execution.setVariable("model-invariant-id-target", modelInvariantUuid)\r
                        \r
+                       // user params\r
+                       String uuiRequest = execution.getVariable("uuiRequest")\r
+                       // target model uuid\r
                        String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")\r
-                       utils.log("INFO","modelUuid: " + modelUuid, isDebugEnabled)\r
                        execution.setVariable("modelUuid", modelUuid)\r
-                       execution.setVariable("model-version-id-target", modelUuid)\r
                        \r
-                       String serviceModelName = jsonUtil.getJsonValue(uuiRequest, "service.parameters.templateName")\r
-                       utils.log("INFO","serviceModelName: " + serviceModelName, isDebugEnabled)\r
-                       if(serviceModelName == null) {\r
-                               serviceModelName = ""\r
-                       }\r
-                       execution.setVariable("serviceModelName", serviceModelName)\r
+                       utils.log("INFO","modelUuid: " + modelUuid, isDebugEnabled)\r
                                \r
                } catch (BpmnError e) {\r
                        throw e;\r
@@ -159,128 +139,9 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
                        utils.log("INFO", msg, isDebugEnabled)\r
                        exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)\r
                }\r
-               utils.log("INFO", "Exited " + method, isDebugEnabled)\r
+               utils.log("INFO", "======== COMPLETED preProcessRequest Process ======== ", isDebugEnabled)  \r
        }\r
-       \r
-       public void postProcessAAIGET(DelegateExecution execution) {\r
-               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
-               utils.log("INFO"," ***** postProcessAAIGET ***** ", isDebugEnabled)\r
-               String msg = ""\r
-\r
-               try {\r
-                       String serviceInstanceId = execution.getVariable("serviceInstanceId")\r
-                       boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")\r
-                       String serviceType = ""\r
-\r
-                       if(foundInAAI){\r
-                               utils.log("INFO","Found Service-instance in AAI", isDebugEnabled)\r
-\r
-                               String siData = execution.getVariable("GENGS_service")\r
-                               utils.log("INFO", "SI Data", isDebugEnabled)\r
-                               if (isBlank(siData))\r
-                               {\r
-                                       msg = "Could not retrive ServiceInstance data from AAI, Id:" + serviceInstanceId\r
-                                       utils.log("INFO", msg, isDebugEnabled)\r
-                                       exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)\r
-                               }\r
-\r
-                               utils.log("INFO", "SI Data" + siData, isDebugEnabled)                           \r
-\r
-                               // Get Template uuid and version\r
-                               if (utils.nodeExists(siData, "model-invariant-id") && utils.nodeExists(siData, "model-version-id") ) {\r
-                                       utils.log("INFO", "SI Data model-invariant-id and model-version-id exist:", isDebugEnabled)\r
-\r
-                                       def modelInvariantId  = utils.getNodeText1(siData, "model-invariant-id")\r
-                                       def modelVersionId  = utils.getNodeText1(siData, "model-version-id")\r
-\r
-                                       // Set Original Template info\r
-                                       execution.setVariable("model-invariant-id-original", modelInvariantId)\r
-                                       execution.setVariable("model-version-id-original", modelVersionId)\r
-                               }\r
-                               \r
-                               //get related service instances (vnf/network or volume) for delete\r
-                               if (utils.nodeExists(siData, "relationship-list")) {\r
-                                       utils.log("INFO", "SI Data relationship-list exists:", isDebugEnabled)\r
-\r
-                                       JSONArray jArray = new JSONArray()\r
 \r
-                                       XmlParser xmlParser = new XmlParser()\r
-                                       Node root = xmlParser.parseText(siData)\r
-                                       def relation_list = utils.getChildNode(root, 'relationship-list')\r
-                                       def relationships = utils.getIdenticalChildren(relation_list, 'relationship')                                   \r
-\r
-                                       for (def relation: relationships) {\r
-                                               def jObj = getRelationShipData(relation, isDebugEnabled)\r
-                                               jArray.put(jObj)\r
-                                       }\r
-\r
-                                       execution.setVariable("serviceRelationShip", jArray.toString())\r
-                               }\r
-                       }else{\r
-                               boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")\r
-                               if(!succInAAI){\r
-                                       utils.log("INFO","Error getting Service-instance from AAI", + serviceInstanceId, isDebugEnabled)\r
-                                       WorkflowException workflowException = execution.getVariable("WorkflowException")\r
-                                       utils.logAudit("workflowException: " + workflowException)\r
-                                       if(workflowException != null){\r
-                                               exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI\r
-                                               utils.log("INFO", msg, isDebugEnabled)\r
-                                               exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)\r
-                                       }\r
-                               }\r
-\r
-                               utils.log("INFO","Service-instance NOT found in AAI. Silent Success", isDebugEnabled)\r
-                       }\r
-               }catch (BpmnError e) {\r
-                       throw e;\r
-               } catch (Exception ex) {\r
-                       msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIGET. " + ex.getMessage()\r
-                       utils.log("INFO", msg, isDebugEnabled)\r
-                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)\r
-               }\r
-               utils.log("INFO"," *** Exit postProcessAAIGET *** ", isDebugEnabled)\r
-       }\r
-       \r
-       private JSONObject getRelationShipData(node, isDebugEnabled){           \r
-               JSONObject jObj = new JSONObject()\r
-               \r
-               def relation  = utils.nodeToString(node)\r
-               def rt  = utils.getNodeText1(relation, "related-to")\r
-               \r
-               def rl  = utils.getNodeText1(relation, "related-link")\r
-               utils.log("INFO", "ServiceInstance Related NS/Configuration :" + rl, isDebugEnabled)\r
-               \r
-               def rl_datas = utils.getIdenticalChildren(node, "relationship-data")    \r
-               for(def rl_data : rl_datas) {\r
-                       def eKey =  utils.getChildNodeText(rl_data, "relationship-key")\r
-                       def eValue = utils.getChildNodeText(rl_data, "relationship-value")\r
-\r
-                       if ((rt == "service-instance" && eKey.equals("service-instance.service-instance-id"))\r
-                       //for overlay/underlay\r
-                       || (rt == "configuration" && eKey.equals("configuration.configuration-id"))){\r
-                               jObj.put("resourceInstanceId", eValue)\r
-                       }\r
-               }\r
-\r
-               def rl_props = utils.getIdenticalChildren(node, "related-to-property")\r
-               for(def rl_prop : rl_props) {\r
-                       def eKey =  utils.getChildNodeText(rl_prop, "property-key")\r
-                       def eValue = utils.getChildNodeText(rl_prop, "property-value")\r
-                       if((rt == "service-instance" && eKey.equals("service-instance.service-instance-name"))\r
-                       //for overlay/underlay\r
-                       || (rt == "configuration" && eKey.equals("configuration.configuration-type"))){\r
-                               jObj.put("resourceType", eValue)\r
-                       }\r
-               }\r
-\r
-               utils.log("INFO", "Relationship related to Resource:" + jObj.toString(), isDebugEnabled)                \r
-\r
-               return jObj\r
-       }\r
        \r
        public void preInitResourcesOperStatus(DelegateExecution execution){\r
         def isDebugEnabled = execution.getVariable("isDebugLogEnabled")\r
@@ -292,7 +153,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
             String operationType = execution.getVariable("operationType")\r
             String resourceTemplateUUIDs = ""\r
             String result = "processing"\r
-            String progress = "10"\r
+            String progress = "0"\r
             String reason = ""\r
             String operationContent = "Prepare service updating"\r
             utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType, isDebugEnabled)\r
@@ -340,92 +201,18 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
         utils.log("INFO", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled)  \r
     }\r
     \r
-    /**\r
-        * Init the service Operation Status\r
-        */\r
-       public void preUpdateServiceOperationStatus(DelegateExecution execution){\r
-        def method = getClass().getSimpleName() + '.preUpdateServiceOperationStatus(' +'execution=' + execution.getId() +')'\r
-               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")\r
-               utils.log("INFO","Entered " + method, isDebugEnabled)\r
-        \r
-        try{\r
-            String serviceId = execution.getVariable("serviceInstanceId")\r
-            String operationId = execution.getVariable("operationId")\r
-                       String operationType = execution.getVariable("operationType")\r
-            String serviceName = execution.getVariable("serviceInstanceName")\r
-            String userId = ""\r
-            String result = "processing"\r
-            String progress = execution.getVariable("progress")\r
-                       utils.log("INFO", "progress: " + progress , isDebugEnabled)\r
-                       if ("100".equalsIgnoreCase(progress))\r
-                       {\r
-                               result = "finished"\r
-                       }\r
-            String reason = ""\r
-            String operationContent = "Prepare service : " + execution.getVariable("operationStatus")\r
-                       \r
-            utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)\r
-            serviceId = UriUtils.encode(serviceId,"UTF-8")\r
-            execution.setVariable("serviceInstanceId", serviceId)\r
-            execution.setVariable("operationId", operationId)\r
-            execution.setVariable("operationType", operationType)\r
-\r
-            def dbAdapterEndpoint = "http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter"\r
-            execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)\r
-            utils.log("INFO", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)\r
 \r
-            execution.setVariable("URN_mso_openecomp_adapters_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")\r
-                       String payload =\r
-                """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\r
-                        xmlns:ns="http://org.openecomp.mso/requestsdb">\r
-                        <soapenv:Header/>\r
-                        <soapenv:Body>\r
-                            <ns:updateServiceOperationStatus xmlns:ns="http://org.openecomp.mso/requestsdb">\r
-                            <serviceId>${serviceId}</serviceId>\r
-                            <operationId>${operationId}</operationId>\r
-                            <serviceName>${serviceName}</serviceName>\r
-                            <operationType>${operationType}</operationType>\r
-                            <userId>${userId}</userId>\r
-                            <result>${result}</result>\r
-                            <operationContent>${operationContent}</operationContent>\r
-                            <progress>${progress}</progress>\r
-                            <reason>${reason}</reason>\r
-                        </ns:updateServiceOperationStatus>\r
-                    </soapenv:Body>\r
-                </soapenv:Envelope>"""\r
-\r
-            payload = utils.formatXml(payload)\r
-            execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)\r
-            utils.log("INFO", "Outgoing preUpdateServiceOperationStatus: \n" + payload, isDebugEnabled)\r
-           \r
-\r
-        }catch(Exception e){\r
-            utils.log("ERROR", "Exception Occured Processing preUpdateServiceOperationStatus. Exception is:\n" + e, isDebugEnabled)\r
-            execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preUpdateServiceOperationStatus Method:\n" + e.getMessage())\r
-        }\r
-        utils.log("INFO", "======== COMPLETED preUpdateServiceOperationStatus Process ======== ", isDebugEnabled)  \r
-        utils.log("INFO", "Exited " + method, isDebugEnabled)\r
-       }\r
-    \r
-    public void postResourcesOperStatus(DelegateExecution execution) {\r
-        def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
-    \r
-    }\r
-    \r
-    public void preCompareModelVersions(DelegateExecution execution) {\r
-        def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
-\r
-    }\r
-\r
-    public void postCompareModelVersions(DelegateExecution execution) {\r
-        def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
-    }\r
-    \r
     public void preProcessForAddResource(DelegateExecution execution) {\r
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
                utils.log("INFO"," ***** preProcessForAddResource ***** ", isDebugEnabled)\r
                \r
            execution.setVariable("operationType", "create")\r
+               \r
+               execution.setVariable("hasResourcetoAdd", false)\r
+               List<Resource> addResourceList =  execution.getVariable("addResourceList")\r
+               if(addResourceList != null && !addResourceList.isEmpty()) {\r
+                       execution.setVariable("hasResourcetoAdd", true)                 \r
+               }\r
        \r
                utils.log("INFO"," *** Exit preProcessForAddResource *** ", isDebugEnabled)\r
     }\r
@@ -445,6 +232,14 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
                \r
                execution.setVariable("operationType", "delete")\r
                \r
+               execution.setVariable("hasResourcetoDelete", false)\r
+               List<Resource> delResourceList =  execution.getVariable("delResourceList")\r
+               if(delResourceList != null && !delResourceList.isEmpty()) {\r
+                       execution.setVariable("hasResourcetoDelete", true)\r
+               }                       \r
+               \r
+               execution.setVariable("resourceInstanceIDs", execution.getVariable("serviceRelationShip"))\r
+               \r
                utils.log("INFO"," *** Exit preProcessForDeleteResource *** ", isDebugEnabled)\r
 \r
     }\r
@@ -458,20 +253,20 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
                utils.log("INFO"," *** Exit postProcessForDeleteResource *** ", isDebugEnabled)\r
     } \r
     \r
-       public void preProcessAAIGET2(DelegateExecution execution) {\r
+       public void preProcessAAIGET(DelegateExecution execution) {\r
         def isDebugEnabled=execution.getVariable("isDebugLogEnabled")  \r
        }\r
        \r
-       public void postProcessAAIGET2(DelegateExecution execution) {\r
+       public void postProcessAAIGET(DelegateExecution execution) {\r
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")\r
-               utils.log("INFO"," ***** postProcessAAIGET2 ***** ", isDebugEnabled)\r
+               utils.log("INFO"," ***** postProcessAAIGET ***** ", isDebugEnabled)\r
                String msg = ""\r
 \r
                try {\r
                        String serviceInstanceName = execution.getVariable("serviceInstanceName")\r
                        boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")\r
                        if(!succInAAI){\r
-                               utils.log("INFO","Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName, isDebugEnabled)\r
+                               utils.log("INFO","Error getting Service-instance from AAI in postProcessAAIGET", + serviceInstanceName, isDebugEnabled)\r
                                WorkflowException workflowException = execution.getVariable("WorkflowException")\r
                                utils.logAudit("workflowException: " + workflowException)\r
                                if(workflowException != null){\r
@@ -479,7 +274,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
                                }\r
                                else\r
                                {\r
-                                       msg = "Failure in postProcessAAIGET2 GENGS_SuccessIndicator:" + succInAAI\r
+                                       msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI\r
                                        utils.log("INFO", msg, isDebugEnabled)\r
                                        exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)\r
                                }\r
@@ -498,11 +293,11 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
                } catch (BpmnError e) {\r
                        throw e;\r
                } catch (Exception ex) {\r
-                       msg = "Exception in DoCreateServiceInstance.postProcessAAIGET2 " + ex.getMessage()\r
+                       msg = "Exception in DoUpdateE2EServiceInstance.postProcessAAIGET " + ex.getMessage()\r
                        utils.log("INFO", msg, isDebugEnabled)\r
                        exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)\r
                }\r
-               utils.log("INFO"," *** Exit postProcessAAIGET2 *** ", isDebugEnabled)\r
+               utils.log("INFO"," *** Exit postProcessAAIGET *** ", isDebugEnabled)\r
        }\r
 \r
        public void preProcessAAIPUT(DelegateExecution execution) {             \r
@@ -510,7 +305,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
                def isDebugEnabled = execution.getVariable("isDebugLogEnabled")\r
                utils.log("INFO","Entered " + method, isDebugEnabled)\r
                String msg = ""\r
-               utils.log("INFO"," ***** preProcessAAIPUTt *****",  isDebugEnabled)\r
+               utils.log("INFO"," ***** preProcessAAIPUT *****",  isDebugEnabled)\r
 \r
                String modelUuid = execution.getVariable("modelUuid")\r
                String serviceInstanceVersion = execution.getVariable("serviceInstanceVersion")\r
@@ -523,6 +318,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
                String namespace = aaiUriUtil.getNamespaceFromUri(aai_uri)\r
                utils.log("INFO","namespace: " + namespace, isDebugEnabled)\r
 \r
+               //update target model to aai\r
                String serviceInstanceData =\r
                                """<service-instance xmlns=\"${namespace}\">\r
                               <model-version-id">${modelUuid}</model-version-id>\r
@@ -560,7 +356,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
                                rollbackData.put("SERVICEINSTANCE", "disableRollback", disableRollback.toString())\r
                                rollbackData.put("SERVICEINSTANCE", "rollbackAAI", "true")\r
                                rollbackData.put("SERVICEINSTANCE", "serviceInstanceId", serviceInstanceId)\r
-                               rollbackData.put("SERVICEINSTANCE", "subscriptionServiceType", execution.getVariable("subscriptionServiceType"))\r
+                               rollbackData.put("SERVICEINSTANCE", "serviceType", execution.getVariable("serviceType"))\r
                                rollbackData.put("SERVICEINSTANCE", "globalSubscriberId", execution.getVariable("globalSubscriberId"))\r
                                execution.setVariable("rollbackData", rollbackData)\r
                        }\r
index adea23a..0ad2da4 100644 (file)
@@ -28,6 +28,7 @@ import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
 
 import org.openecomp.mso.bpmn.core.WorkflowException
 import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.openecomp.mso.bpmn.core.domain.Resource
 import org.openecomp.mso.rest.APIResponse
 
 import java.util.List;
@@ -35,6 +36,8 @@ import java.util.UUID;
 
 import org.camunda.bpm.engine.delegate.BpmnError
 import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.json.JSONObject
+import org.json.JSONArray
 import org.apache.commons.lang3.*
 import org.apache.commons.codec.binary.Base64;
 import org.springframework.web.util.UriUtils
@@ -71,7 +74,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                                exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
                        }
                                                
-                       //subscriberInfo
+                       //subscriberInfo for aai
                        String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "requestDetails.subscriberInfo.globalSubscriberId")
                        if (isBlank(globalSubscriberId)) {
                                msg = "Input globalSubscriberId' is null"
@@ -80,7 +83,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                                execution.setVariable("globalSubscriberId", globalSubscriberId)
                        }
 
-                       //requestInfo
+                       //requestDetails
                        execution.setVariable("source", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.source"))
                        execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.instanceName"))
                        execution.setVariable("disableRollback", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.suppressRollback"))
@@ -88,16 +91,16 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                        if (isBlank(productFamilyId))
                        {
                                msg = "Input productFamilyId is null"
-                               utils.log("INFO", msg, isDebugEnabled)
-                               //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               utils.log("INFO", msg, isDebugEnabled)                          
                        } else {
                                execution.setVariable("productFamilyId", productFamilyId)
                        }
+                       
+                        //user params
                 String userParams = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams")      
              utils.log("INFO", "userParams:" + userParams, isDebugEnabled)
                 List<String> paramList = jsonUtil.StringArrayToList(execution, userParams)
-                String uuiRequest = jsonUtil.getJsonValue(paramList.get(0), "UUIRequest")
-                       //modelInfo
+                String uuiRequest = jsonUtil.getJsonValue(paramList.get(0), "UUIRequest")                      
                        if (isBlank(uuiRequest)) {
                                msg = "Input uuiRequest is null"
                                utils.log("INFO", msg, isDebugEnabled)
@@ -119,28 +122,23 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                                execution.setVariable("serviceType", serviceType)
                        }
                        
-                       /*
-                        * Extracting User Parameters from incoming Request and converting into a Map
-                        */
-                       def jsonSlurper = new JsonSlurper()
-                       def jsonOutput = new JsonOutput()
-
-                       Map reqMap = jsonSlurper.parseText(siRequest)
-
-                       //InputParams
-                       def userParamsList = reqMap.requestDetails?.requestParameters?.userParams
-
-                       Map<String, String> inputMap = [:]
-                       if (userParamsList) {
-                               for (def i=0; i<userParamsList.size(); i++) {
-                                       def userParams1 = userParamsList.get(i)
-                                       userParams1.each { param -> inputMap.put(param.key, param.value)}
-                               }
-                       }
+                       // target model info
+                       String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
+                       utils.log("INFO","modelInvariantUuid: " + modelInvariantUuid, isDebugEnabled)
+                       execution.setVariable("modelInvariantUuid", modelInvariantUuid)
+                       execution.setVariable("model-invariant-id-target", modelInvariantUuid)
                        
-                       utils.log("DEBUG", "User Input Parameters map: " + inputMap.toString(), isDebugEnabled)
-                       execution.setVariable("serviceInputParams", inputMap)
-                       execution.setVariable("uuiRequest", inputMap.get("UUIRequest"))
+                       String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")
+                       utils.log("INFO","modelUuid: " + modelUuid, isDebugEnabled)
+                       execution.setVariable("modelUuid", modelUuid)
+                       execution.setVariable("model-version-id-target", modelUuid)
+                       
+                       String serviceModelName = jsonUtil.getJsonValue(uuiRequest, "service.parameters.templateName")
+                       utils.log("INFO","serviceModelName: " + serviceModelName, isDebugEnabled)
+                       if(serviceModelName == null) {
+                               serviceModelName = ""
+                       }
+                       execution.setVariable("serviceModelName", serviceModelName)                     
                        
                        //operationId
                        String operationId = jsonUtil.getJsonValue(siRequest, "operationId")
@@ -148,7 +146,8 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                                operationId = UUID.randomUUID().toString()
                         }   
                        execution.setVariable("operationId", operationId) 
-                       execution.setVariable("operationType", "UPDATE")
+                       execution.setVariable("operationType", "update")
+                       execution.setVariable("hasResourcetoUpdate", false)
                        
                        execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
 
@@ -162,6 +161,163 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                utils.log("INFO"," ***** Exit preProcessRequest *****",  isDebugEnabled)
        }
        
+       
+       public void postProcessAAIGET(DelegateExecution execution) {
+               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+               utils.log("INFO"," ***** postProcessAAIGET ***** ", isDebugEnabled)
+               String msg = ""
+
+               try {
+                       String serviceInstanceId = execution.getVariable("serviceInstanceId")
+                       boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
+                       String serviceType = ""
+
+                       if(foundInAAI){
+                               utils.log("INFO","Found Service-instance in AAI", isDebugEnabled)
+
+                               String siData = execution.getVariable("GENGS_service")
+                               utils.log("INFO", "SI Data", isDebugEnabled)
+                               if (isBlank(siData))
+                               {
+                                       msg = "Could not retrive ServiceInstance data from AAI, Id:" + serviceInstanceId
+                                       utils.log("INFO", msg, isDebugEnabled)
+                                       exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+                               }
+
+                               utils.log("INFO", "SI Data" + siData, isDebugEnabled)
+                               
+                               // serviceInstanceName
+                               String serviceInstanceName = execution.getVariable("serviceInstanceName")
+                               if(isBlank(serviceInstanceName) && utils.nodeExists(siData, "service-instance-name")) {
+                                       serviceInstanceName =  utils.getNodeText1(siData, "service-instance-name")
+                                       execution.setVariable("serviceInstanceName", serviceInstanceName)
+                               }
+
+                               // Get Template uuid and version
+                               if (utils.nodeExists(siData, "model-invariant-id") && utils.nodeExists(siData, "model-version-id") ) {
+                                       utils.log("INFO", "SI Data model-invariant-id and model-version-id exist:", isDebugEnabled)
+
+                                       def modelInvariantId  = utils.getNodeText1(siData, "model-invariant-id")
+                                       def modelVersionId  = utils.getNodeText1(siData, "model-version-id")
+
+                                       // Set Original Template info
+                                       execution.setVariable("model-invariant-id-original", modelInvariantId)
+                                       execution.setVariable("model-version-id-original", modelVersionId)
+                               }
+                               
+                               //get related service instances (vnf/network or volume) for delete
+                               if (utils.nodeExists(siData, "relationship-list")) {
+                                       utils.log("INFO", "SI Data relationship-list exists:", isDebugEnabled)
+
+                                       JSONArray jArray = new JSONArray()
+
+                                       XmlParser xmlParser = new XmlParser()
+                                       Node root = xmlParser.parseText(siData)
+                                       def relation_list = utils.getChildNode(root, 'relationship-list')
+                                       def relationships = utils.getIdenticalChildren(relation_list, 'relationship')
+
+                                       for (def relation: relationships) {
+                                               def jObj = getRelationShipData(relation, isDebugEnabled)
+                                               jArray.put(jObj)
+                                       }
+
+                                       execution.setVariable("serviceRelationShip", jArray.toString())
+                               }
+                       }else{
+                               boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
+                               if(!succInAAI){
+                                       utils.log("INFO","Error getting Service-instance from AAI", + serviceInstanceId, isDebugEnabled)
+                                       WorkflowException workflowException = execution.getVariable("WorkflowException")
+                                       utils.logAudit("workflowException: " + workflowException)
+                                       if(workflowException != null){
+                                               exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
+                                       }
+                                       else
+                                       {
+                                               msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
+                                               utils.log("INFO", msg, isDebugEnabled)
+                                               exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
+                                       }
+                               }
+
+                               utils.log("INFO","Service-instance NOT found in AAI. Silent Success", isDebugEnabled)
+                       }
+               }catch (BpmnError e) {
+                       throw e;
+               } catch (Exception ex) {
+                       msg = "Exception in DoDeleteE2EServiceInstance.postProcessAAIGET. " + ex.getMessage()
+                       utils.log("INFO", msg, isDebugEnabled)
+                       exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+               }
+               utils.log("INFO"," *** Exit postProcessAAIGET *** ", isDebugEnabled)
+       }
+       
+       private JSONObject getRelationShipData(node, isDebugEnabled){
+               JSONObject jObj = new JSONObject()
+               
+               def relation  = utils.nodeToString(node)
+               def rt  = utils.getNodeText1(relation, "related-to")
+               
+               def rl  = utils.getNodeText1(relation, "related-link")
+               utils.log("INFO", "ServiceInstance Related NS/Configuration :" + rl, isDebugEnabled)
+               
+               def rl_datas = utils.getIdenticalChildren(node, "relationship-data")
+               for(def rl_data : rl_datas) {
+                       def eKey =  utils.getChildNodeText(rl_data, "relationship-key")
+                       def eValue = utils.getChildNodeText(rl_data, "relationship-value")
+
+                       if ((rt == "service-instance" && eKey.equals("service-instance.service-instance-id"))
+                       //for overlay/underlay
+                       || (rt == "configuration" && eKey.equals("configuration.configuration-id"))){
+                               jObj.put("resourceInstanceId", eValue)
+                       }
+               }
+
+               def rl_props = utils.getIdenticalChildren(node, "related-to-property")
+               for(def rl_prop : rl_props) {
+                       def eKey =  utils.getChildNodeText(rl_prop, "property-key")
+                       def eValue = utils.getChildNodeText(rl_prop, "property-value")
+                       if((rt == "service-instance" && eKey.equals("service-instance.service-instance-name"))
+                       //for overlay/underlay
+                       || (rt == "configuration" && eKey.equals("configuration.configuration-type"))){
+                               jObj.put("resourceType", eValue)
+                       }
+               }
+
+               utils.log("INFO", "Relationship related to Resource:" + jObj.toString(), isDebugEnabled)
+
+               return jObj
+       }
+       
+       
+       public void preCompareModelVersions(DelegateExecution execution) {
+               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+       }
+
+       public void postCompareModelVersions(DelegateExecution execution) {             
+               def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+               utils.log("DEBUG", " ======== STARTED postCompareModelVersions Process ======== ", isDebugEnabled)
+               
+               def hasResourcetoUpdate = false
+               def hasResourcetoAdd = false
+               def hasResourcetoDelete = false
+               List<Resource> addResourceList =  execution.getVariable("addResourceList")
+               List<Resource> delResourceList =  execution.getVariable("delResourceList")
+               
+               if(addResourceList != null && !addResourceList.isEmpty()) {
+                       hasResourcetoAdd = true
+               }
+                               
+               if(delResourceList != null && !delResourceList.isEmpty()) {
+                       hasResourcetoDelete = true
+               }
+               
+               hasResourcetoUpdate = hasResourcetoAdd || hasResourcetoDelete
+               execution.setVariable("hasResourcetoUpdate", hasResourcetoUpdate)
+               
+               utils.log("DEBUG", "======== COMPLETED postCompareModelVersions Process ======== ", isDebugEnabled)             
+       }
+       
        /**
         * Init the service Operation Status
         */
@@ -216,6 +372,70 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                }
                utils.log("DEBUG", "======== COMPLETED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
        }
+       
+       /**
+        * Update the service Operation Status
+        */
+       public void preUpdateServiceOperationStatus(DelegateExecution execution){               
+               def method = getClass().getSimpleName() + '.preUpdateServiceOperationStatus(' +'execution=' + execution.getId() +')'
+               def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+               utils.log("INFO","Entered " + method, isDebugEnabled)
+               
+               try{
+                       String serviceId = execution.getVariable("serviceInstanceId")
+                       String operationId = execution.getVariable("operationId")
+                       String operationType = execution.getVariable("operationType")
+                       String serviceName = execution.getVariable("serviceInstanceName")
+                       String result = execution.getVariable("operationResult")                                                
+                       String progress = execution.getVariable("progress")
+                       String reason = execution.getVariable("operationReason")
+                       String userId = ""
+                       utils.log("INFO", "progress: " + progress , isDebugEnabled)
+
+                       String operationContent = "Prepare service : " + execution.getVariable("operationStatus")
+                       
+                       utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)
+                       serviceId = UriUtils.encode(serviceId,"UTF-8")
+                       execution.setVariable("serviceInstanceId", serviceId)
+                       execution.setVariable("operationId", operationId)
+                       execution.setVariable("operationType", operationType)
+
+                       def dbAdapterEndpoint = "http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter"
+                       execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
+                       utils.log("INFO", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
+
+                       execution.setVariable("URN_mso_openecomp_adapters_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
+                       String payload =
+                               """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+                        xmlns:ns="http://org.openecomp.mso/requestsdb">
+                        <soapenv:Header/>
+                        <soapenv:Body>
+                            <ns:updateServiceOperationStatus xmlns:ns="http://org.openecomp.mso/requestsdb">
+                            <serviceId>${serviceId}</serviceId>
+                            <operationId>${operationId}</operationId>
+                            <serviceName>${serviceName}</serviceName>
+                            <operationType>${operationType}</operationType>
+                            <userId>${userId}</userId>
+                            <result>${result}</result>
+                            <operationContent>${operationContent}</operationContent>
+                            <progress>${progress}</progress>
+                            <reason>${reason}</reason>
+                        </ns:updateServiceOperationStatus>
+                    </soapenv:Body>
+                </soapenv:Envelope>"""
+
+                       payload = utils.formatXml(payload)
+                       execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
+                       utils.log("INFO", "Outgoing preUpdateServiceOperationStatus: \n" + payload, isDebugEnabled)
+                  
+
+               }catch(Exception e){
+                       utils.log("ERROR", "Exception Occured Processing preUpdateServiceOperationStatus. Exception is:\n" + e, isDebugEnabled)
+                       execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preUpdateServiceOperationStatus Method:\n" + e.getMessage())
+               }
+               utils.log("INFO", "======== COMPLETED preUpdateServiceOperationStatus Process ======== ", isDebugEnabled)
+               utils.log("INFO", "Exited " + method, isDebugEnabled)
+       }               
 
        public void sendSyncResponse (DelegateExecution execution) {
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
@@ -223,9 +443,17 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
 
                try {
                        String operationId = execution.getVariable("operationId")
-                       String serviceInstanceId = execution.getVariable("serviceInstanceId")
-                       // RESTResponse for API Handler (APIH) Reply Task
-                       String updateServiceResp = """{"operationId":"${operationId}"}""".trim()
+                       def hasResourcetoUpdate = execution.getVariable("hasResourcetoUpdate")
+                       
+                       String updateServiceResp = ""
+                       if(hasResourcetoUpdate) {
+                               // RESTResponse for API Handler (APIH) Reply Task
+                               updateServiceResp = """{"operationId":"${operationId}"}""".trim()
+                       }
+                       else {
+                               updateServiceResp =  """{"OperationResult":"No Resource to Add or Delete"}"""
+                       }
+                       
                        utils.log("INFO", " sendSyncResponse to APIH:" + "\n" + updateServiceResp, isDebugEnabled)
                        sendWorkflowResponse(execution, 202, updateServiceResp)
                        execution.setVariable("sentSyncResponse", true)
@@ -238,16 +466,17 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                utils.log("INFO"," ***** Exit sendSyncResopnse *****",  isDebugEnabled)
        }
 
-
        public void sendSyncError (DelegateExecution execution) {
                def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
                utils.log("INFO", " *** sendSyncError *** ", isDebugEnabled)
 
                try {
                        String errorMessage = ""
+                       int errorCode = 7000
                        if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
                                WorkflowException wfe = execution.getVariable("WorkflowException")
                                errorMessage = wfe.getErrorMessage()
+                               errorCode = wfe.getErrorCode()
                        } else {
                                errorMessage = "Sending Sync Error."
                        }
@@ -255,7 +484,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                        String buildworkflowException =
                                        """<aetgt:WorkflowException xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1">\r
                                        <aetgt:ErrorMessage>${errorMessage}</aetgt:ErrorMessage>
-                                       <aetgt:ErrorCode>7000</aetgt:ErrorCode>
+                                       <aetgt:ErrorCode>${errorCode}</aetgt:ErrorCode>
                                   </aetgt:WorkflowException>"""
 
                        utils.logAudit(buildworkflowException)
@@ -286,7 +515,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                                                </request-info>
                                                <status-message>Service Instance was updated successfully.</status-message>
                                                <serviceInstanceId>${serviceInstanceId}</serviceInstanceId>
-                                               <mso-bpel-name>UpdateGenericALaCarteServiceInstance</mso-bpel-name>
+                                               <mso-bpel-name>UpdateCustomE2EServiceInstance</mso-bpel-name>
                                        </aetgt:MsoCompletionRequest>"""
 
                        // Format Response
@@ -323,7 +552,7 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor
                        execution.setVariable("falloutRequest", falloutRequest)
                } catch (Exception ex) {
                        utils.log("INFO", "Exception prepareFalloutRequest:" + ex.getMessage(), isDebugEnabled)
-                       String errorException = "  Bpmn error encountered in UpdateGenericALaCarteServiceInstance flow. FalloutHandlerRequest,  buildErrorResponse() - " + ex.getMessage()
+                       String errorException = "  Bpmn error encountered in UpdateCustomE2EServiceInstance flow. FalloutHandlerRequest,  buildErrorResponse() - " + ex.getMessage()
                        String requestId = execution.getVariable("msoRequestId")
                        String falloutRequest =
                                        """<aetgt:FalloutHandlerRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"\r
index e2dfedb..0e65dd7 100644 (file)
@@ -32,6 +32,7 @@ import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
 import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.AaiConnection;
 import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.AaiResponse;
 import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.CheckAaiForCorrelationIdImplementation;
+import org.openecomp.mso.logger.MsoLogger;
 import org.springframework.beans.factory.annotation.Autowired;
 
 /**
@@ -46,7 +47,7 @@ import org.springframework.beans.factory.annotation.Autowired;
  */
 
 public class CheckAaiForCorrelationIdDelegate implements JavaDelegate {
-
+       private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
     private CheckAaiForCorrelationIdImplementation implementation = new CheckAaiForCorrelationIdImplementation();
     private AaiConnection aaiConnection;
 
@@ -68,6 +69,7 @@ public class CheckAaiForCorrelationIdDelegate implements JavaDelegate {
             execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_PNF, aaiResponse.getContainsInfoAboutPnf());
             execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_IP, aaiResponse.getContainsInfoAboutIp());
         } catch (IOException e) {
+               LOGGER.error("IOException",e);
             new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, e.getMessage());
         }
     }
index 0aeb0c6..ee047c9 100644 (file)
@@ -84,13 +84,14 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
 
     private void updateResOperStatus(ResourceOperationStatus resourceOperationStatus) throws RouteException {
         logger.info("AbstractSdncOperationTask.updateResOperStatus begin!");
-        String url = "http://mso:8080/dbadapters/RequestsDbAdapter";
-        HttpPost httpPost = new HttpPost(url);
+               Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
+               String requestsdbEndPoint = properties.get("mso.adapters.openecomp.db.endpoint");
+        HttpPost httpPost = new HttpPost(requestsdbEndPoint);
         httpPost.addHeader("Authorization", "Basic QlBFTENsaWVudDpwYXNzd29yZDEk");
         httpPost.addHeader("Content-type", "application/soap+xml");
         String postBody = getPostStringBody(resourceOperationStatus);
         httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML));
-        httpPost(url, httpPost);
+        httpPost(requestsdbEndPoint, httpPost);
         logger.info("AbstractSdncOperationTask.updateResOperStatus end!");
     }
 
@@ -165,13 +166,14 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
 
     private ResourceOperationStatus getResourceOperationStatus(String serviceId, String operationId, String resourceTemplateUUID) throws RouteException {
         logger.info("AbstractSdncOperationTask.getResourceOperationStatus begin!");
-        String url = "http://mso:8080/dbadapters/RequestsDbAdapter";
-        HttpPost httpPost = new HttpPost(url);
+               Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
+               String requestsdbEndPoint = properties.get("mso.adapters.openecomp.db.endpoint");
+        HttpPost httpPost = new HttpPost(requestsdbEndPoint);
         httpPost.addHeader("Authorization", "Basic QlBFTENsaWVudDpwYXNzd29yZDEk");
         httpPost.addHeader("Content-type", "application/soap+xml");
         String getBody = getGetStringBody(serviceId, operationId, resourceTemplateUUID);
         httpPost.setEntity(new StringEntity(getBody, ContentType.APPLICATION_XML));
-        String result = httpPost(url, httpPost);
+        String result = httpPost(requestsdbEndPoint, httpPost);
         ResourceOperationStatus resourceOperationStatus = getResourceOperationStatusFromXmlString(result);
         logger.info("AbstractSdncOperationTask.getResourceOperationStatus end!");
         return resourceOperationStatus;
@@ -357,7 +359,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
                 return vlaue;
             }
         } catch (Exception e) {
-            msoLogger.error(MessageEnum.GENERAL_EXCEPTION, " getMsbIp catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, e.getClass().toString());
+            msoLogger.error(MessageEnum.GENERAL_EXCEPTION, " getMsbIp catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, e.getClass().toString(),e);
         }
         return defaultValue;
     }
index de50fe1..09561a6 100644 (file)
@@ -110,7 +110,7 @@ public abstract class AbstractBuilder<IN, OUT> {
      protected String getRequestActoin(DelegateExecution execution) {
           String action = /*RequestInformation.*/RequestAction.CreateNetworkInstance.getName();
           String operType = (String) execution.getVariable(OPERATION_TYPE);
-          String resourceType = ((String) execution.getVariable(RESOURCE_TYPE)).toLowerCase();
+          String resourceType = (String)execution.getVariable(RESOURCE_TYPE);
           if (!StringUtils.isBlank(operType)) {
                if (RequestsDbConstant.OperationType.DELETE.equalsIgnoreCase(operType)) {
                     if (isOverlay(resourceType)) {
@@ -134,17 +134,17 @@ public abstract class AbstractBuilder<IN, OUT> {
      }
 
      private boolean isOverlay(String resourceType) {
-          return !StringUtils.isBlank(resourceType) && resourceType.contains("overlay");
+          return !StringUtils.isBlank(resourceType) && resourceType.toLowerCase().contains("overlay");
      }
 
      private boolean isUnderlay(String resourceType) {
-          return !StringUtils.isBlank(resourceType) && resourceType.contains("underlay");
+          return !StringUtils.isBlank(resourceType) && resourceType.toLowerCase().contains("underlay");
      }
 
      protected String getSvcAction(DelegateExecution execution) {
           String action = /*SdncRequestHeader.*/SvcAction.Create.getName();
           String operType = (String) execution.getVariable(OPERATION_TYPE);
-          String resourceType = ((String) execution.getVariable(RESOURCE_TYPE)).toLowerCase();
+          String resourceType = (String)execution.getVariable(RESOURCE_TYPE);
           if (!StringUtils.isBlank(operType)) {
                if (RequestsDbConstant.OperationType.DELETE.equalsIgnoreCase(operType)) {
                     if (isOverlay(resourceType)) {
index c0637a3..71f4a28 100644 (file)
@@ -43,6 +43,7 @@ ex.processJavaException(execution)]]></bpmn:script>
         <camunda:in source="serviceType" target="serviceType" />
         <camunda:in source="uuiRequest" target="uuiRequest" />
         <camunda:in source="requestAction" target="operationType" />
+        <camunda:in source="operationId" target="operationId" />
       </bpmn:extensionElements>
       <bpmn:incoming>SequenceFlow_19eilro</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0klbpxx</bpmn:outgoing>
index fd7a27c..dcd0b56 100644 (file)
@@ -5,7 +5,7 @@
       <bpmn:outgoing>SequenceFlow_1qo2pln</bpmn:outgoing>
     </bpmn:startEvent>
     <bpmn:sequenceFlow id="SequenceFlow_1qo2pln" sourceRef="createNS_StartEvent" targetRef="Task_1dlrfiw" />
-    <bpmn:sequenceFlow id="SequenceFlow_0khtova" sourceRef="PreprocessIncomingRequest_task" targetRef="CallActivity_1600xlj" />
+    <bpmn:sequenceFlow id="SequenceFlow_0khtova" sourceRef="PreprocessIncomingRequest_task" targetRef="Task_0tezqd4" />
     <bpmn:scriptTask id="PreprocessIncomingRequest_task" name="prepare SDNC Request" scriptFormat="groovy">
       <bpmn:incoming>SequenceFlow_18l3crb</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0khtova</bpmn:outgoing>
@@ -27,13 +27,13 @@ dcsi.prepareSDNCRequest(execution)]]></bpmn:script>
         <camunda:out source="WorkflowException" target="WorkflowException" />
         <camunda:in source="sdncAdapterWorkflowRequest" target="sdncAdapterWorkflowRequest" />
       </bpmn:extensionElements>
-      <bpmn:incoming>SequenceFlow_0khtova</bpmn:incoming>
+      <bpmn:incoming>SequenceFlow_15mvedq</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1xk5xed</bpmn:outgoing>
     </bpmn:callActivity>
-    <bpmn:sequenceFlow id="SequenceFlow_1xk5xed" sourceRef="CallActivity_1600xlj" targetRef="Task_023hred" />
+    <bpmn:sequenceFlow id="SequenceFlow_1xk5xed" sourceRef="CallActivity_1600xlj" targetRef="Task_0uwlr22" />
     <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred" targetRef="EndEvent_1x6k78c" />
     <bpmn:scriptTask id="Task_023hred" name="post SDNC create call">
-      <bpmn:incoming>SequenceFlow_1xk5xed</bpmn:incoming>
+      <bpmn:incoming>SequenceFlow_1vnx1pp</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0ow44q0</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def dcsi = new CreateSDNCNetworkResource()
@@ -55,78 +55,186 @@ execution.setVariable("recipeParamXsd", recipeParamXsd)]]></bpmn:script>
 def dcsi = new CreateSDNCNetworkResource()
 dcsi.preProcessRequest(execution)]]></bpmn:script>
     </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="SequenceFlow_1mz0vdx" sourceRef="Task_0tezqd4" targetRef="Task_18tomkl" />
+    <bpmn:sequenceFlow id="SequenceFlow_15mvedq" sourceRef="Task_18tomkl" targetRef="CallActivity_1600xlj" />
+    <bpmn:scriptTask id="Task_0tezqd4" name="Create progress update parameters before create" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_0khtova</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1mz0vdx</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new CreateSDNCNetworkResource()
+dcsi.prepareUpdateBeforeCreateSDNCResource(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:scriptTask id="Task_0uwlr22" name="Create progress update parameters After create" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_1xk5xed</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1jr6zi0</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new CreateSDNCNetworkResource()
+dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:serviceTask id="Task_18tomkl" name="update 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_1mz0vdx</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_15mvedq</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:serviceTask id="ServiceTask_1cm8iwr" name="update 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_1jr6zi0</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1vnx1pp</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:sequenceFlow id="SequenceFlow_1jr6zi0" sourceRef="Task_0uwlr22" targetRef="ServiceTask_1cm8iwr" />
+    <bpmn:sequenceFlow id="SequenceFlow_1vnx1pp" sourceRef="ServiceTask_1cm8iwr" targetRef="Task_023hred" />
   </bpmn:process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateSDNCNetworkResource">
       <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="createNS_StartEvent">
-        <dc:Bounds x="80" y="111" width="36" height="36" />
+        <dc:Bounds x="-111" y="111" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="57" y="147" width="83" height="24" />
+          <dc:Bounds x="-135" y="147" width="85" height="24" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1qo2pln_di" bpmnElement="SequenceFlow_1qo2pln">
-        <di:waypoint xsi:type="dc:Point" x="116" y="129" />
-        <di:waypoint xsi:type="dc:Point" x="185" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="-75" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="-10" y="129" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="105.5" y="108" width="90" height="12" />
+          <dc:Bounds x="-87.5" y="108" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0khtova_di" bpmnElement="SequenceFlow_0khtova">
-        <di:waypoint xsi:type="dc:Point" x="677" y="129" />
-        <di:waypoint xsi:type="dc:Point" x="739" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="413" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="460" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="500" y="129" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="663" y="108" width="90" height="12" />
+          <dc:Bounds x="391.5" y="108" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_03j6ogo_di" bpmnElement="PreprocessIncomingRequest_task">
-        <dc:Bounds x="577" y="89" width="100" height="80" />
+        <dc:Bounds x="313" y="89" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
-        <dc:Bounds x="1079" y="111" width="36" height="36" />
+        <dc:Bounds x="875" y="317" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1040" y="153" width="85" height="24" />
+          <dc:Bounds x="836" y="359" width="86" height="24" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="CallActivity_1600xlj_di" bpmnElement="CallActivity_1600xlj">
-        <dc:Bounds x="739" y="89" width="100" height="80" />
+        <dc:Bounds x="109" y="295" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1xk5xed_di" bpmnElement="SequenceFlow_1xk5xed">
-        <di:waypoint xsi:type="dc:Point" x="839" y="129" />
-        <di:waypoint xsi:type="dc:Point" x="902" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="209" y="335" />
+        <di:waypoint xsi:type="dc:Point" x="302" y="335" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="825.5" y="108" width="90" height="12" />
+          <dc:Bounds x="210.5" y="314" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0ow44q0_di" bpmnElement="SequenceFlow_0ow44q0">
-        <di:waypoint xsi:type="dc:Point" x="1002" y="129" />
-        <di:waypoint xsi:type="dc:Point" x="1079" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="795" y="335" />
+        <di:waypoint xsi:type="dc:Point" x="875" y="335" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="995.5" y="108" width="90" height="12" />
+          <dc:Bounds x="790" y="314" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_0gyej62_di" bpmnElement="Task_023hred">
-        <dc:Bounds x="902" y="89" width="100" height="80" />
+        <dc:Bounds x="695" y="295" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_0w2es8j_di" bpmnElement="SequenceFlow_0w2es8j">
-        <di:waypoint xsi:type="dc:Point" x="285" y="129" />
-        <di:waypoint xsi:type="dc:Point" x="385" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="90" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="148" y="129" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="335" y="108" width="0" height="12" />
+          <dc:Bounds x="74" y="108" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_18l3crb_di" bpmnElement="SequenceFlow_18l3crb">
-        <di:waypoint xsi:type="dc:Point" x="485" y="129" />
-        <di:waypoint xsi:type="dc:Point" x="577" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="248" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="313" y="129" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="531" y="108" width="0" height="12" />
+          <dc:Bounds x="235.5" y="108" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_0lc6l7a_di" bpmnElement="Task_1dlrfiw">
-        <dc:Bounds x="185" y="89" width="100" height="80" />
+        <dc:Bounds x="-10" y="89" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_14l9mlv_di" bpmnElement="Task_13sx2bp">
-        <dc:Bounds x="385" y="89" width="100" height="80" />
+        <dc:Bounds x="148" y="89" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1mz0vdx_di" bpmnElement="SequenceFlow_1mz0vdx">
+        <di:waypoint xsi:type="dc:Point" x="606" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="638" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="638" y="129" />
+        <di:waypoint xsi:type="dc:Point" x="738" y="129" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="608" y="123" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_15mvedq_di" bpmnElement="SequenceFlow_15mvedq">
+        <di:waypoint xsi:type="dc:Point" x="788" y="169" />
+        <di:waypoint xsi:type="dc:Point" x="788" y="218" />
+        <di:waypoint xsi:type="dc:Point" x="0" y="218" />
+        <di:waypoint xsi:type="dc:Point" x="0" y="335" />
+        <di:waypoint xsi:type="dc:Point" x="109" y="335" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="349" y="197" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_1kqf4ge_di" bpmnElement="Task_0tezqd4">
+        <dc:Bounds x="506" y="89" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ScriptTask_0hu4lhm_di" bpmnElement="Task_0uwlr22">
+        <dc:Bounds x="302" y="295" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_1q6ssz7_di" bpmnElement="Task_18tomkl">
+        <dc:Bounds x="738" y="89" width="100" height="80" />
       </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_1cm8iwr_di" bpmnElement="ServiceTask_1cm8iwr">
+        <dc:Bounds x="487" y="295" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1jr6zi0_di" bpmnElement="SequenceFlow_1jr6zi0">
+        <di:waypoint xsi:type="dc:Point" x="402" y="335" />
+        <di:waypoint xsi:type="dc:Point" x="487" y="335" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="444.5" y="314" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1vnx1pp_di" bpmnElement="SequenceFlow_1vnx1pp">
+        <di:waypoint xsi:type="dc:Point" x="587" y="335" />
+        <di:waypoint xsi:type="dc:Point" x="695" y="335" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="641" y="314" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>
index e4254f2..2370165 100644 (file)
@@ -34,10 +34,10 @@ dcsi.instantiateNetworkService(execution)]]></bpmn:script>
       <bpmn:outgoing>createNSFailed_SequenceFlow</bpmn:outgoing>
     </bpmn:exclusiveGateway>
     <bpmn:sequenceFlow id="createNSSuccess_SequenceFlow" name="yes" sourceRef="ExclusiveGateway_0zfksms" targetRef="instantiate_NSTask">
-      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("nsInstanceName" )  != null && execution.getVariable("nsInstanceName" )  != "" )}]]></bpmn:conditionExpression>
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("nsInstanceId" )  != null && execution.getVariable("nsInstanceId" )  != "" )}]]></bpmn:conditionExpression>
     </bpmn:sequenceFlow>
     <bpmn:sequenceFlow id="createNSFailed_SequenceFlow" name="no" sourceRef="ExclusiveGateway_0zfksms" targetRef="createNSFailed_EndEvent">
-      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("nsInstanceName" )  == null || execution.getVariable("nsInstanceName" )  == "" )}]]></bpmn:conditionExpression>
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("nsInstanceId" )  == null || execution.getVariable("nsInstanceId" )  == "" )}]]></bpmn:conditionExpression>
     </bpmn:sequenceFlow>
     <bpmn:exclusiveGateway id="ExclusiveGateway_1is7zys" name="Instantiate NS Success?">
       <bpmn:incoming>SequenceFlow_1ywe21t</bpmn:incoming>
@@ -62,7 +62,7 @@ dcsi.instantiateNetworkService(execution)]]></bpmn:script>
     <bpmn:sequenceFlow id="operationProcessing_SequenceFlow" name="no" sourceRef="ExclusiveGateway_15492gl" targetRef="timeDelay_Task">
       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("operationStatus" )  == "processing" )}]]></bpmn:conditionExpression>
     </bpmn:sequenceFlow>
-    <bpmn:sequenceFlow id="SequenceFlow_0cq2q6g" sourceRef="finishNSCreate_Task" targetRef="EndEvent_1x6k78c" />
+    <bpmn:sequenceFlow id="SequenceFlow_0cq2q6g" sourceRef="finishNSCreate_Task" targetRef="ScriptTask_1890l78" />
     <bpmn:endEvent id="createNSFailed_EndEvent" name="createNSFailed">
       <bpmn:incoming>createNSFailed_SequenceFlow</bpmn:incoming>
     </bpmn:endEvent>
@@ -70,7 +70,7 @@ dcsi.instantiateNetworkService(execution)]]></bpmn:script>
       <bpmn:incoming>instantiateFailed_SequenceFlow</bpmn:incoming>
     </bpmn:endEvent>
     <bpmn:endEvent id="EndEvent_1x6k78c">
-      <bpmn:incoming>SequenceFlow_0cq2q6g</bpmn:incoming>
+      <bpmn:incoming>SequenceFlow_1lwqmo9</bpmn:incoming>
     </bpmn:endEvent>
     <bpmn:scriptTask id="queryJob_Task" name="Query NS Progress" scriptFormat="groovy">
       <bpmn:incoming>instantiateSuccess_SequenceFlow</bpmn:incoming>
@@ -80,7 +80,7 @@ dcsi.instantiateNetworkService(execution)]]></bpmn:script>
 def dcsi = new CreateVFCNSResource()
 dcsi.queryNSProgress(execution)]]></bpmn:script>
     </bpmn:scriptTask>
-    <bpmn:scriptTask id="finishNSCreate_Task" name="Finish NS Create">
+    <bpmn:scriptTask id="finishNSCreate_Task" name="Add NS Relationship" scriptFormat="groovy">
       <bpmn:incoming>operationFinished_SequenceFlow</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0cq2q6g</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
@@ -96,6 +96,14 @@ def dcsi = new CreateVFCNSResource()
 dcsi.timeDelay(execution)]]></bpmn:script>
     </bpmn:scriptTask>
     <bpmn:sequenceFlow id="SequenceFlow_1gsbpxj" sourceRef="timeDelay_Task" targetRef="queryJob_Task" />
+    <bpmn:scriptTask id="ScriptTask_1890l78" name="Send Sync Ack Response" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_0cq2q6g</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1lwqmo9</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new  CreateVFCNSResource()
+csi.sendSyncResponse(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="SequenceFlow_1lwqmo9" sourceRef="ScriptTask_1890l78" targetRef="EndEvent_1x6k78c" />
   </bpmn:process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateVFCNSResource">
@@ -192,11 +200,9 @@ dcsi.timeDelay(execution)]]></bpmn:script>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_0hftgi6_di" bpmnElement="operationFinished_SequenceFlow">
         <di:waypoint xsi:type="dc:Point" x="1034" y="595" />
-        <di:waypoint xsi:type="dc:Point" x="909" y="595" />
-        <di:waypoint xsi:type="dc:Point" x="909" y="595" />
-        <di:waypoint xsi:type="dc:Point" x="783" y="595" />
+        <di:waypoint xsi:type="dc:Point" x="902" y="595" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="963" y="574" width="19" height="12" />
+          <dc:Bounds x="929.1428571428571" y="574" width="18" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0omec46_di" bpmnElement="operationProcessing_SequenceFlow">
@@ -208,10 +214,10 @@ dcsi.timeDelay(execution)]]></bpmn:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0cq2q6g_di" bpmnElement="SequenceFlow_0cq2q6g">
-        <di:waypoint xsi:type="dc:Point" x="683" y="595" />
-        <di:waypoint xsi:type="dc:Point" x="520" y="595" />
+        <di:waypoint xsi:type="dc:Point" x="802" y="595" />
+        <di:waypoint xsi:type="dc:Point" x="690" y="595" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="556.5" y="574" width="90" height="12" />
+          <dc:Bounds x="701" y="574" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="EndEvent_1ido9wi_di" bpmnElement="createNSFailed_EndEvent">
@@ -236,7 +242,7 @@ dcsi.timeDelay(execution)]]></bpmn:script>
         <dc:Bounds x="1009" y="271" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_0xxyfku_di" bpmnElement="finishNSCreate_Task">
-        <dc:Bounds x="683" y="555" width="100" height="80" />
+        <dc:Bounds x="802" y="555" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_0xqo13p_di" bpmnElement="SequenceFlow_0xqo13p">
         <di:waypoint xsi:type="dc:Point" x="1059" y="351" />
@@ -256,6 +262,16 @@ dcsi.timeDelay(execution)]]></bpmn:script>
           <dc:Bounds x="1227" y="352.5" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_1890l78_di" bpmnElement="ScriptTask_1890l78">
+        <dc:Bounds x="590" y="555" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1lwqmo9_di" bpmnElement="SequenceFlow_1lwqmo9">
+        <di:waypoint xsi:type="dc:Point" x="590" y="595" />
+        <di:waypoint xsi:type="dc:Point" x="520" y="595" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="555" y="573" width="0" height="14" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>
index 3071d1c..ae84d89 100644 (file)
@@ -8,8 +8,8 @@
       <bpmn:scriptTask id="ScriptTask_0u3lw39" name="Handle Unexpected Error" scriptFormat="groovy">
         <bpmn:incoming>SequenceFlow_1dsbjjb</bpmn:incoming>
         <bpmn:outgoing>SequenceFlow_1yay321</bpmn:outgoing>
-        <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.common.scripts.*\r
-ExceptionUtil ex = new ExceptionUtil()\r
+        <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.common.scripts.*
+ExceptionUtil ex = new ExceptionUtil()
 ex.processJavaException(execution)]]></bpmn:script>
       </bpmn:scriptTask>
       <bpmn:startEvent id="StartEvent_0v1ffn4">
@@ -33,7 +33,6 @@ ex.processJavaException(execution)]]></bpmn:script>
         <camunda:in source="disableRollback" target="disableRollback" />
         <camunda:in source="uuiRequest" target="uuiRequest" />
         <camunda:out source="rolledBack" target="rolledBack" />
-        <camunda:out source="serviceInstanceName" target="serviceInstanceName" />
         <camunda:in source="failIfExists" target="failIfExists" />
         <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
         <camunda:in source="serviceType" target="serviceType" />
@@ -41,8 +40,12 @@ ex.processJavaException(execution)]]></bpmn:script>
         <camunda:in source="operationId" target="operationId" />
         <camunda:in source="operationType" target="operationType" />
         <camunda:in source="URN_mso_adapters_openecomp_db_endpoint" target="URN_mso_adapters_openecomp_db_endpoint" />
+        <camunda:in source="serviceDecomposition_Target" target="serviceDecomposition_Target" />
+        <camunda:in source="serviceDecomposition_Original" target="serviceDecomposition_Original" />
+        <camunda:in source="addResourceList" target="addResourceList" />
+        <camunda:in source="delResourceList" target="delResourceList" />
       </bpmn:extensionElements>
-      <bpmn:incoming>SequenceFlow_19eilro</bpmn:incoming>
+      <bpmn:incoming>SequenceFlow_04qwbbf</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0klbpxx</bpmn:outgoing>
     </bpmn:callActivity>
     <bpmn:endEvent id="EndEvent_0bpd6c0" name="End">
@@ -50,16 +53,16 @@ ex.processJavaException(execution)]]></bpmn:script>
     </bpmn:endEvent>
     <bpmn:scriptTask id="ScriptTask_1s09c7d" name="Pre Process Incoming Request" scriptFormat="groovy">
       <bpmn:incoming>SequenceFlow_0s2spoq</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_0z4faf9</bpmn:outgoing>
-      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
-def csi= new UpdateCustomE2EServiceInstance()\r
+      <bpmn:outgoing>SequenceFlow_0az1n4y</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi= new UpdateCustomE2EServiceInstance()
 csi.preProcessRequest(execution)]]></bpmn:script>
     </bpmn:scriptTask>
     <bpmn:scriptTask id="ScriptTask_0ttvn8r" name="Prepare Completion Request" scriptFormat="groovy">
       <bpmn:incoming>SequenceFlow_14zu6wr</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0je30si</bpmn:outgoing>
-      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
-def csi = new UpdateCustomE2EServiceInstance()\r
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new UpdateCustomE2EServiceInstance()
 csi.prepareCompletionRequest(execution)]]></bpmn:script>
     </bpmn:scriptTask>
     <bpmn:callActivity id="CallActivity_02fyxz0" name="Call CompleteMsoProcess" calledElement="CompleteMsoProcess">
@@ -85,8 +88,8 @@ csi.prepareCompletionRequest(execution)]]></bpmn:script>
       <bpmn:scriptTask id="ScriptTask_0u8o9p2" name="Prepare Fallout Request" scriptFormat="groovy">
         <bpmn:incoming>SequenceFlow_0n9pexp</bpmn:incoming>
         <bpmn:outgoing>SequenceFlow_01umodj</bpmn:outgoing>
-        <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
-def csi = new UpdateCustomE2EServiceInstance()\r
+        <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new UpdateCustomE2EServiceInstance()
 csi.prepareFalloutRequest(execution)]]></bpmn:script>
       </bpmn:scriptTask>
       <bpmn:callActivity id="CallActivity_1ang7q8" name="Call FalloutHandler" calledElement="FalloutHandler">
@@ -102,25 +105,60 @@ csi.prepareFalloutRequest(execution)]]></bpmn:script>
         <bpmn:outgoing>SequenceFlow_1ysapam</bpmn:outgoing>
       </bpmn:callActivity>
       <bpmn:scriptTask id="ScriptTask_1rn6nqi" name="Send Error Response">
-        <bpmn:incoming>SequenceFlow_0e1r62n</bpmn:incoming>
+        <bpmn:incoming>SequenceFlow_06o383f</bpmn:incoming>
         <bpmn:outgoing>SequenceFlow_0n9pexp</bpmn:outgoing>
-        <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
-def csi = new  UpdateCustomE2EServiceInstance()\r
+        <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new  UpdateCustomE2EServiceInstance()
 csi.sendSyncError(execution)]]></bpmn:script>
       </bpmn:scriptTask>
-      <bpmn:sequenceFlow id="SequenceFlow_0e1r62n" sourceRef="StartEvent_0dug28e" targetRef="ScriptTask_1rn6nqi" />
+      <bpmn:sequenceFlow id="SequenceFlow_0e1r62n" sourceRef="StartEvent_0dug28e" targetRef="ScriptTask_14kqo0r" />
       <bpmn:sequenceFlow id="SequenceFlow_1ysapam" sourceRef="CallActivity_1ang7q8" targetRef="EndEvent_03wysuk" />
       <bpmn:sequenceFlow id="SequenceFlow_0n9pexp" sourceRef="ScriptTask_1rn6nqi" targetRef="ScriptTask_0u8o9p2" />
       <bpmn:sequenceFlow id="SequenceFlow_01umodj" sourceRef="ScriptTask_0u8o9p2" targetRef="CallActivity_1ang7q8" />
+      <bpmn:scriptTask id="ScriptTask_14kqo0r" name="Prepare Update Service Oper Status(error)" scriptFormat="groovy">
+        <bpmn:incoming>SequenceFlow_0e1r62n</bpmn:incoming>
+        <bpmn:outgoing>SequenceFlow_0t4nds2</bpmn:outgoing>
+        <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*           
+               execution.setVariable("progress", "100")
+               execution.setVariable("operationStatus", "Finished")
+               execution.setVariable("operationResult", "Error")
+               execution.setVariable("operationReason", "Exception happened")
+               def ddsi = new UpdateCustomE2EServiceInstance()
+               ddsi.preUpdateServiceOperationStatus(execution)]]></bpmn:script>
+      </bpmn:scriptTask>
+      <bpmn:sequenceFlow id="SequenceFlow_0t4nds2" sourceRef="ScriptTask_14kqo0r" targetRef="ServiceTask_1af6rwh" />
+      <bpmn:serviceTask id="ServiceTask_1af6rwh" name="Update Service Oper Status">
+        <bpmn:extensionElements>
+          <camunda:connector>
+            <camunda:inputOutput>
+              <camunda:inputParameter name="url">${URN_mso_openecomp_adapters_db_endpoint}</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_updateServiceOperStatusRequest}</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_0t4nds2</bpmn:incoming>
+        <bpmn:outgoing>SequenceFlow_06o383f</bpmn:outgoing>
+      </bpmn:serviceTask>
+      <bpmn:sequenceFlow id="SequenceFlow_06o383f" sourceRef="ServiceTask_1af6rwh" targetRef="ScriptTask_1rn6nqi" />
     </bpmn:subProcess>
     <bpmn:scriptTask id="ScriptTask_0xupxj9" name="Send Sync Ack Response" scriptFormat="groovy">
-      <bpmn:incoming>SequenceFlow_1853xxi</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_19eilro</bpmn:outgoing>
-      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
-def csi = new  UpdateCustomE2EServiceInstance()\r
+      <bpmn:incoming>SequenceFlow_12dou7o</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0secadm</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new  UpdateCustomE2EServiceInstance()
 csi.sendSyncResponse(execution)]]></bpmn:script>
     </bpmn:scriptTask>
-    <bpmn:exclusiveGateway id="ExclusiveGateway_0aqn64l" name="Success?">
+    <bpmn:exclusiveGateway id="ExclusiveGateway_0aqn64l" name="Success?" default="SequenceFlow_1fueo69">
       <bpmn:incoming>SequenceFlow_0klbpxx</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_14zu6wr</bpmn:outgoing>
       <bpmn:outgoing>SequenceFlow_1fueo69</bpmn:outgoing>
@@ -130,25 +168,92 @@ csi.sendSyncResponse(execution)]]></bpmn:script>
       <bpmn:errorEventDefinition errorRef="Error_0nbdy47" />
     </bpmn:endEvent>
     <bpmn:sequenceFlow id="SequenceFlow_0s2spoq" sourceRef="StartEvent_00qj6ro" targetRef="ScriptTask_1s09c7d" />
-    <bpmn:sequenceFlow id="SequenceFlow_19eilro" sourceRef="ScriptTask_0xupxj9" targetRef="DoUpdateE2EServiceInstance" />
     <bpmn:sequenceFlow id="SequenceFlow_0klbpxx" sourceRef="DoUpdateE2EServiceInstance" targetRef="ExclusiveGateway_0aqn64l" />
     <bpmn:sequenceFlow id="SequenceFlow_0yayvrf" sourceRef="CallActivity_02fyxz0" targetRef="EndEvent_0bpd6c0" />
-    <bpmn:sequenceFlow id="SequenceFlow_0z4faf9" sourceRef="ScriptTask_1s09c7d" targetRef="ScriptTask_09rx901" />
     <bpmn:sequenceFlow id="SequenceFlow_14zu6wr" name="yes" sourceRef="ExclusiveGateway_0aqn64l" targetRef="ScriptTask_0ttvn8r">
       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("WorkflowException") == null}]]></bpmn:conditionExpression>
     </bpmn:sequenceFlow>
     <bpmn:sequenceFlow id="SequenceFlow_0je30si" sourceRef="ScriptTask_0ttvn8r" targetRef="CallActivity_02fyxz0" />
-    <bpmn:sequenceFlow id="SequenceFlow_1fueo69" name="no" sourceRef="ExclusiveGateway_0aqn64l" targetRef="EndEvent_07uk5iy">
-      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("WorkflowException") != null}]]></bpmn:conditionExpression>
-    </bpmn:sequenceFlow>
-    <bpmn:scriptTask id="ScriptTask_09rx901" name="Init Service Operation Status" scriptFormat="groovy">
-      <bpmn:incoming>SequenceFlow_0z4faf9</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_0utlsnd</bpmn:outgoing>
+    <bpmn:sequenceFlow id="SequenceFlow_1fueo69" name="no" sourceRef="ExclusiveGateway_0aqn64l" targetRef="EndEvent_07uk5iy" />
+    <bpmn:callActivity id="CallActivity_1vejucv" name="Call AAI Generic GetService" calledElement="GenericGetService">
+      <bpmn:extensionElements>
+        <camunda:in source="serviceInstanceId" target="GENGS_serviceInstanceId" />
+        <camunda:in sourceExpression="service-instance" target="GENGS_type" />
+        <camunda:out source="GENGS_FoundIndicator" target="GENGS_FoundIndicator" />
+        <camunda:out source="GENGS_SuccessIndicator" target="GENGS_SuccessIndicator" />
+        <camunda:out source="WorkflowException" target="WorkflowException" />
+        <camunda:out source="GENGS_siResourceLink" target="GENGS_siResourceLink" />
+        <camunda:out source="GENGS_service" target="GENGS_service" />
+        <camunda:in source="globalSubscriberId" target="GENGS_globalCustomerId" />
+        <camunda:in source="serviceType" target="GENGS_serviceType" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>SequenceFlow_0az1n4y</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1bd4711</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:scriptTask id="ScriptTask_0cx1y0g" name="Post Process AAI GET" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_1bd4711</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_03i6zhx</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new UpdateCustomE2EServiceInstance()
+dcsi.postProcessAAIGET(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="SequenceFlow_1bd4711" sourceRef="CallActivity_1vejucv" targetRef="ScriptTask_0cx1y0g" />
+    <bpmn:scriptTask id="ScriptTask_11y3uq6" name="Post for Compare Model Versions" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_0xhbobd</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0t7zinj</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new UpdateCustomE2EServiceInstance()
+csi.postCompareModelVersions(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:scriptTask id="ScriptTask_0hixtxc" name="Prepare for Compare Model Versions" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_03i6zhx</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1pdv4qj</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def ddsi = new UpdateCustomE2EServiceInstance()
+ddsi.preCompareModelVersions(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:callActivity id="CallActivity_1rkoyc5" name="Call DoCompareModelVersions" calledElement="DoCompareModelVersions">
+      <bpmn:extensionElements>
+        <camunda:in source="msoRequestId" target="msoRequestId" />
+        <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
+        <camunda:in source="model-invariant-id-target" target="model-invariant-id-target" />
+        <camunda:in source="model-version-id-target" target="model-version-id-target" />
+        <camunda:in source="model-invariant-id-original" target="model-invariant-id-original" />
+        <camunda:in source="model-version-id-original" target="model-version-id-original" />
+        <camunda:out source="serviceDecomposition_Target" target="serviceDecomposition_Target" />
+        <camunda:out source="serviceDecomposition_Original" target="serviceDecomposition_Original" />
+        <camunda:out source="addResourceList" target="addResourceList" />
+        <camunda:out source="delResourceList" target="delResourceList" />
+      </bpmn:extensionElements>
+      <bpmn:incoming>SequenceFlow_1pdv4qj</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0xhbobd</bpmn:outgoing>
+    </bpmn:callActivity>
+    <bpmn:sequenceFlow id="SequenceFlow_03i6zhx" sourceRef="ScriptTask_0cx1y0g" targetRef="ScriptTask_0hixtxc" />
+    <bpmn:sequenceFlow id="SequenceFlow_1pdv4qj" sourceRef="ScriptTask_0hixtxc" targetRef="CallActivity_1rkoyc5" />
+    <bpmn:sequenceFlow id="SequenceFlow_0xhbobd" sourceRef="CallActivity_1rkoyc5" targetRef="ScriptTask_11y3uq6" />
+    <bpmn:exclusiveGateway id="ExclusiveGateway_0mc34qe" name="HasResourcetoUpdate?" default="SequenceFlow_1n8h3zt">
+      <bpmn:incoming>SequenceFlow_0secadm</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0zmd4rt</bpmn:outgoing>
+      <bpmn:outgoing>SequenceFlow_1n8h3zt</bpmn:outgoing>
+    </bpmn:exclusiveGateway>
+    <bpmn:sequenceFlow id="SequenceFlow_0az1n4y" sourceRef="ScriptTask_1s09c7d" targetRef="CallActivity_1vejucv" />
+    <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_0m01dm3" name="StartDoUpdate">
+      <bpmn:outgoing>SequenceFlow_04qwbbf</bpmn:outgoing>
+      <bpmn:linkEventDefinition name="StartDoUpdate" />
+    </bpmn:intermediateCatchEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_0secadm" sourceRef="ScriptTask_0xupxj9" targetRef="ExclusiveGateway_0mc34qe" />
+    <bpmn:sequenceFlow id="SequenceFlow_04qwbbf" sourceRef="IntermediateCatchEvent_0m01dm3" targetRef="DoUpdateE2EServiceInstance" />
+    <bpmn:endEvent id="EndEvent_1jvqhkf" name="End">
+      <bpmn:incoming>SequenceFlow_0kvl23y</bpmn:incoming>
+    </bpmn:endEvent>
+    <bpmn:scriptTask id="ScriptTask_16sgdqw" name="Init Service Operation Status" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_1bddzne</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1e3vtyq</bpmn:outgoing>
       <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def csi= new UpdateCustomE2EServiceInstance()
 csi.prepareInitServiceOperationStatus(execution)]]></bpmn:script>
     </bpmn:scriptTask>
-    <bpmn:serviceTask id="ServiceTask_0mr5k9q" name="Update Service Operation Status">
+    <bpmn:serviceTask id="ServiceTask_0qjpd5v" name="Update Service Operation Status">
       <bpmn:extensionElements>
         <camunda:connector>
           <camunda:inputOutput>
@@ -167,11 +272,64 @@ csi.prepareInitServiceOperationStatus(execution)]]></bpmn:script>
           <camunda:connectorId>http-connector</camunda:connectorId>
         </camunda:connector>
       </bpmn:extensionElements>
-      <bpmn:incoming>SequenceFlow_0utlsnd</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_1853xxi</bpmn:outgoing>
+      <bpmn:incoming>SequenceFlow_1e3vtyq</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_12dou7o</bpmn:outgoing>
     </bpmn:serviceTask>
-    <bpmn:sequenceFlow id="SequenceFlow_0utlsnd" sourceRef="ScriptTask_09rx901" targetRef="ServiceTask_0mr5k9q" />
-    <bpmn:sequenceFlow id="SequenceFlow_1853xxi" sourceRef="ServiceTask_0mr5k9q" targetRef="ScriptTask_0xupxj9" />
+    <bpmn:sequenceFlow id="SequenceFlow_1e3vtyq" sourceRef="ScriptTask_16sgdqw" targetRef="ServiceTask_0qjpd5v" />
+    <bpmn:sequenceFlow id="SequenceFlow_12dou7o" sourceRef="ServiceTask_0qjpd5v" targetRef="ScriptTask_0xupxj9" />
+    <bpmn:serviceTask id="ServiceTask_0mj3kf2" name="Update Service Operation Status">
+      <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_updateServiceOperStatusRequest}</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_1wzk6tu</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_0kvl23y</bpmn:outgoing>
+    </bpmn:serviceTask>
+    <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_08mk8h9" name="GoToOperStatusInit">
+      <bpmn:incoming>SequenceFlow_0t7zinj</bpmn:incoming>
+      <bpmn:linkEventDefinition name="StartOperStatusInit" />
+    </bpmn:intermediateThrowEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_0t7zinj" sourceRef="ScriptTask_11y3uq6" targetRef="IntermediateThrowEvent_08mk8h9" />
+    <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_14w7v9s" name="StartOperStatusInit">
+      <bpmn:outgoing>SequenceFlow_1bddzne</bpmn:outgoing>
+      <bpmn:linkEventDefinition name="StartOperStatusInit" />
+    </bpmn:intermediateCatchEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_1bddzne" sourceRef="IntermediateCatchEvent_14w7v9s" targetRef="ScriptTask_16sgdqw" />
+    <bpmn:scriptTask id="ScriptTask_04a0t3p" name="Prepare Update Service Oper Status(100%)" scriptFormat="groovy">
+      <bpmn:incoming>SequenceFlow_1n8h3zt</bpmn:incoming>
+      <bpmn:outgoing>SequenceFlow_1wzk6tu</bpmn:outgoing>
+      <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+execution.setVariable("progress", "100")
+execution.setVariable("operationStatus", "Finished")
+execution.setVariable("operationResult", "End")
+execution.setVariable("operationReason", "No resource to add or delete")
+def ddsi = new UpdateCustomE2EServiceInstance()
+ddsi.preUpdateServiceOperationStatus(execution)]]></bpmn:script>
+    </bpmn:scriptTask>
+    <bpmn:sequenceFlow id="SequenceFlow_1wzk6tu" sourceRef="ScriptTask_04a0t3p" targetRef="ServiceTask_0mj3kf2" />
+    <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1k72hze" name="GoToDoUpdate">
+      <bpmn:incoming>SequenceFlow_0zmd4rt</bpmn:incoming>
+      <bpmn:linkEventDefinition name="StartDoUpdate" />
+    </bpmn:intermediateThrowEvent>
+    <bpmn:sequenceFlow id="SequenceFlow_0kvl23y" sourceRef="ServiceTask_0mj3kf2" targetRef="EndEvent_1jvqhkf" />
+    <bpmn:sequenceFlow id="SequenceFlow_0zmd4rt" name="Yes" sourceRef="ExclusiveGateway_0mc34qe" targetRef="IntermediateThrowEvent_1k72hze">
+      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{execution.getVariable("hasResourcetoUpdate") == true}]]></bpmn:conditionExpression>
+    </bpmn:sequenceFlow>
+    <bpmn:sequenceFlow id="SequenceFlow_1n8h3zt" name="No" sourceRef="ExclusiveGateway_0mc34qe" targetRef="ScriptTask_04a0t3p" />
   </bpmn:process>
   <bpmn:error id="Error_0nbdy47" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
@@ -183,42 +341,42 @@ csi.prepareInitServiceOperationStatus(execution)]]></bpmn:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="SubProcess_0ka59nc_di" bpmnElement="SubProcess_0ka59nc" isExpanded="true">
-        <dc:Bounds x="463" y="632" width="394" height="188" />
+        <dc:Bounds x="439" y="1170" width="394" height="188" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="CallActivity_0rhljy8_di" bpmnElement="DoUpdateE2EServiceInstance">
-        <dc:Bounds x="767" y="158" width="100" height="80" />
+        <dc:Bounds x="284" y="585" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="EndEvent_0bpd6c0_di" bpmnElement="EndEvent_0bpd6c0">
-        <dc:Bounds x="1258" y="286" width="36" height="36" />
+        <dc:Bounds x="1192" y="607" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1268" y="322" width="22" height="12" />
+          <dc:Bounds x="1204" y="643" width="19" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_1s09c7d_di" bpmnElement="ScriptTask_1s09c7d">
         <dc:Bounds x="105" y="158" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_0ttvn8r_di" bpmnElement="ScriptTask_0ttvn8r">
-        <dc:Bounds x="1073" y="158" width="100" height="80" />
+        <dc:Bounds x="782" y="585" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="CallActivity_02fyxz0_di" bpmnElement="CallActivity_02fyxz0">
-        <dc:Bounds x="1226" y="158" width="100" height="80" />
+        <dc:Bounds x="959" y="585" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="SubProcess_0vaws86_di" bpmnElement="SubProcess_0vaws86" isExpanded="true">
-        <dc:Bounds x="348" y="370" width="679" height="194" />
+        <dc:Bounds x="-61" y="908" width="1322" height="164" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_0xupxj9_di" bpmnElement="ScriptTask_0xupxj9">
-        <dc:Bounds x="600" y="158" width="100" height="80" />
+        <dc:Bounds x="451" y="337" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ExclusiveGateway_0aqn64l_di" bpmnElement="ExclusiveGateway_0aqn64l" isMarkerVisible="true">
-        <dc:Bounds x="942" y="173" width="50" height="50" />
+        <dc:Bounds x="639" y="600" width="50" height="50" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="943" y="145" width="49" height="12" />
+          <dc:Bounds x="640" y="572" width="49" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="EndEvent_07uk5iy_di" bpmnElement="EndEvent_07uk5iy">
-        <dc:Bounds x="949" y="286" width="36" height="36" />
+        <dc:Bounds x="646" y="713" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="877" y="322" width="90" height="12" />
+          <dc:Bounds x="527" y="1016" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_0s2spoq_di" bpmnElement="SequenceFlow_0s2spoq">
@@ -228,157 +386,305 @@ csi.prepareInitServiceOperationStatus(execution)]]></bpmn:script>
           <dc:Bounds x="22.5" y="177" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_19eilro_di" bpmnElement="SequenceFlow_19eilro">
-        <di:waypoint xsi:type="dc:Point" x="700" y="198" />
-        <di:waypoint xsi:type="dc:Point" x="767" y="198" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="688.5" y="177" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0klbpxx_di" bpmnElement="SequenceFlow_0klbpxx">
-        <di:waypoint xsi:type="dc:Point" x="867" y="198" />
-        <di:waypoint xsi:type="dc:Point" x="942" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="384" y="625" />
+        <di:waypoint xsi:type="dc:Point" x="639" y="625" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="859.5" y="177" width="90" height="12" />
+          <dc:Bounds x="466.5" y="604" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0yayvrf_di" bpmnElement="SequenceFlow_0yayvrf">
-        <di:waypoint xsi:type="dc:Point" x="1276" y="238" />
-        <di:waypoint xsi:type="dc:Point" x="1276" y="286" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="1246" y="262" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_0z4faf9_di" bpmnElement="SequenceFlow_0z4faf9">
-        <di:waypoint xsi:type="dc:Point" x="205" y="198" />
-        <di:waypoint xsi:type="dc:Point" x="274" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="1059" y="625" />
+        <di:waypoint xsi:type="dc:Point" x="1192" y="625" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="194.5" y="177" width="90" height="12" />
+          <dc:Bounds x="1080.5" y="604" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_14zu6wr_di" bpmnElement="SequenceFlow_14zu6wr">
-        <di:waypoint xsi:type="dc:Point" x="992" y="198" />
-        <di:waypoint xsi:type="dc:Point" x="1073" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="689" y="625" />
+        <di:waypoint xsi:type="dc:Point" x="782" y="625" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1023.5062499999999" y="195" width="19" height="12" />
+          <dc:Bounds x="727.1481481481482" y="622" width="19" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0je30si_di" bpmnElement="SequenceFlow_0je30si">
-        <di:waypoint xsi:type="dc:Point" x="1173" y="198" />
-        <di:waypoint xsi:type="dc:Point" x="1226" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="882" y="625" />
+        <di:waypoint xsi:type="dc:Point" x="959" y="625" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1154.5" y="177" width="90" height="12" />
+          <dc:Bounds x="875.5" y="604" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1fueo69_di" bpmnElement="SequenceFlow_1fueo69">
-        <di:waypoint xsi:type="dc:Point" x="967" y="223" />
-        <di:waypoint xsi:type="dc:Point" x="967" y="250" />
-        <di:waypoint xsi:type="dc:Point" x="967" y="250" />
-        <di:waypoint xsi:type="dc:Point" x="967" y="286" />
+        <di:waypoint xsi:type="dc:Point" x="664" y="650" />
+        <di:waypoint xsi:type="dc:Point" x="664" y="713" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="942" y="228" width="12" height="12" />
+          <dc:Bounds x="639" y="677" width="12" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_0u3lw39_di" bpmnElement="ScriptTask_0u3lw39">
-        <dc:Bounds x="611" y="687" width="100" height="80" />
+        <dc:Bounds x="587" y="1225" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="StartEvent_0v1ffn4_di" bpmnElement="StartEvent_0v1ffn4">
-        <dc:Bounds x="496" y="709" width="36" height="36" />
+        <dc:Bounds x="472" y="1247" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="469" y="750" width="0" height="12" />
+          <dc:Bounds x="400" y="1288" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="EndEvent_0eznq6x_di" bpmnElement="EndEvent_0eznq6x">
-        <dc:Bounds x="772" y="709" width="36" height="36" />
+        <dc:Bounds x="748" y="1247" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="745" y="750" width="0" height="12" />
+          <dc:Bounds x="676" y="1288" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="StartEvent_0dug28e_di" bpmnElement="StartEvent_0dug28e">
-        <dc:Bounds x="363" y="456" width="36" height="36" />
+        <dc:Bounds x="-20" y="994" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="336" y="497" width="0" height="12" />
+          <dc:Bounds x="-92" y="1035" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="EndEvent_03wysuk_di" bpmnElement="EndEvent_03wysuk">
-        <dc:Bounds x="942" y="456" width="36" height="36" />
+        <dc:Bounds x="1194" y="994" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="915" y="497" width="0" height="12" />
+          <dc:Bounds x="1122" y="1035" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_0u8o9p2_di" bpmnElement="ScriptTask_0u8o9p2">
-        <dc:Bounds x="621" y="434" width="100" height="80" />
+        <dc:Bounds x="777" y="972" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="CallActivity_1ang7q8_di" bpmnElement="CallActivity_1ang7q8">
-        <dc:Bounds x="798" y="434" width="100" height="80" />
+        <dc:Bounds x="963" y="972" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_1rn6nqi_di" bpmnElement="ScriptTask_1rn6nqi">
-        <dc:Bounds x="443" y="434" width="100" height="80" />
+        <dc:Bounds x="577" y="972" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1dsbjjb_di" bpmnElement="SequenceFlow_1dsbjjb">
-        <di:waypoint xsi:type="dc:Point" x="532" y="727" />
-        <di:waypoint xsi:type="dc:Point" x="611" y="727" />
+        <di:waypoint xsi:type="dc:Point" x="508" y="1265" />
+        <di:waypoint xsi:type="dc:Point" x="587" y="1265" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="529.5" y="727" width="0" height="12" />
+          <dc:Bounds x="461" y="1265" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1yay321_di" bpmnElement="SequenceFlow_1yay321">
-        <di:waypoint xsi:type="dc:Point" x="711" y="727" />
-        <di:waypoint xsi:type="dc:Point" x="772" y="727" />
+        <di:waypoint xsi:type="dc:Point" x="687" y="1265" />
+        <di:waypoint xsi:type="dc:Point" x="748" y="1265" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="701.5" y="727" width="0" height="12" />
+          <dc:Bounds x="633" y="1265" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0e1r62n_di" bpmnElement="SequenceFlow_0e1r62n">
-        <di:waypoint xsi:type="dc:Point" x="399" y="474" />
-        <di:waypoint xsi:type="dc:Point" x="421" y="474" />
-        <di:waypoint xsi:type="dc:Point" x="421" y="474" />
-        <di:waypoint xsi:type="dc:Point" x="442" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="16" y="1012" />
+        <di:waypoint xsi:type="dc:Point" x="122" y="1012" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="391" y="474" width="0" height="12" />
+          <dc:Bounds x="24" y="991" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1ysapam_di" bpmnElement="SequenceFlow_1ysapam">
-        <di:waypoint xsi:type="dc:Point" x="898" y="474" />
-        <di:waypoint xsi:type="dc:Point" x="942" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="1063" y="1012" />
+        <di:waypoint xsi:type="dc:Point" x="1194" y="1012" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="875" y="459" width="0" height="12" />
+          <dc:Bounds x="1083.5" y="991" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0n9pexp_di" bpmnElement="SequenceFlow_0n9pexp">
-        <di:waypoint xsi:type="dc:Point" x="543" y="474" />
-        <di:waypoint xsi:type="dc:Point" x="570" y="474" />
-        <di:waypoint xsi:type="dc:Point" x="570" y="474" />
-        <di:waypoint xsi:type="dc:Point" x="621" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="677" y="1012" />
+        <di:waypoint xsi:type="dc:Point" x="777" y="1012" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="540" y="474" width="0" height="12" />
+          <dc:Bounds x="682" y="991" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_01umodj_di" bpmnElement="SequenceFlow_01umodj">
-        <di:waypoint xsi:type="dc:Point" x="721" y="474" />
-        <di:waypoint xsi:type="dc:Point" x="798" y="474" />
+        <di:waypoint xsi:type="dc:Point" x="877" y="1012" />
+        <di:waypoint xsi:type="dc:Point" x="963" y="1012" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="715.5" y="459" width="0" height="12" />
+          <dc:Bounds x="875" y="991" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ScriptTask_09rx901_di" bpmnElement="ScriptTask_09rx901">
+      <bpmndi:BPMNShape id="CallActivity_1vejucv_di" bpmnElement="CallActivity_1vejucv">
         <dc:Bounds x="274" y="158" width="100" height="80" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ServiceTask_0mr5k9q_di" bpmnElement="ServiceTask_0mr5k9q">
-        <dc:Bounds x="444" y="158" width="100" height="80" />
+      <bpmndi:BPMNShape id="ScriptTask_0cx1y0g_di" bpmnElement="ScriptTask_0cx1y0g">
+        <dc:Bounds x="451" y="158" width="100" height="80" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_0utlsnd_di" bpmnElement="SequenceFlow_0utlsnd">
+      <bpmndi:BPMNEdge id="SequenceFlow_1bd4711_di" bpmnElement="SequenceFlow_1bd4711">
         <di:waypoint xsi:type="dc:Point" x="374" y="198" />
-        <di:waypoint xsi:type="dc:Point" x="444" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="451" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="367.5" y="177" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_11y3uq6_di" bpmnElement="ScriptTask_11y3uq6">
+        <dc:Bounds x="959" y="158" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ScriptTask_0hixtxc_di" bpmnElement="ScriptTask_0hixtxc">
+        <dc:Bounds x="614" y="158" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="CallActivity_1rkoyc5_di" bpmnElement="CallActivity_1rkoyc5">
+        <dc:Bounds x="782" y="158" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_03i6zhx_di" bpmnElement="SequenceFlow_03i6zhx">
+        <di:waypoint xsi:type="dc:Point" x="551" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="614" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="537.5" y="177" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1pdv4qj_di" bpmnElement="SequenceFlow_1pdv4qj">
+        <di:waypoint xsi:type="dc:Point" x="714" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="782" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="703" y="177" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_0xhbobd_di" bpmnElement="SequenceFlow_0xhbobd">
+        <di:waypoint xsi:type="dc:Point" x="882" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="959" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="875.5" y="177" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ExclusiveGateway_0mc34qe_di" bpmnElement="ExclusiveGateway_0mc34qe" isMarkerVisible="true">
+        <dc:Bounds x="639" y="352" width="50" height="50" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="622" y="324" width="85" height="24" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0az1n4y_di" bpmnElement="SequenceFlow_0az1n4y">
+        <di:waypoint xsi:type="dc:Point" x="205" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="274" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="239.5" y="177" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="IntermediateCatchEvent_0m01dm3_di" bpmnElement="IntermediateCatchEvent_0m01dm3">
+        <dc:Bounds x="-6" y="607" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="-21" y="669" width="72" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0secadm_di" bpmnElement="SequenceFlow_0secadm">
+        <di:waypoint xsi:type="dc:Point" x="551" y="377" />
+        <di:waypoint xsi:type="dc:Point" x="639" y="377" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="550" y="356" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_04qwbbf_di" bpmnElement="SequenceFlow_04qwbbf">
+        <di:waypoint xsi:type="dc:Point" x="30" y="625" />
+        <di:waypoint xsi:type="dc:Point" x="284" y="625" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="112" y="604" width="90" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="EndEvent_1jvqhkf_di" bpmnElement="EndEvent_1jvqhkf">
+        <dc:Bounds x="1192" y="359" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1200" y="404" width="19" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ScriptTask_16sgdqw_di" bpmnElement="ScriptTask_16sgdqw">
+        <dc:Bounds x="97" y="337" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_0qjpd5v_di" bpmnElement="ServiceTask_0qjpd5v">
+        <dc:Bounds x="274" y="337" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1e3vtyq_di" bpmnElement="SequenceFlow_1e3vtyq">
+        <di:waypoint xsi:type="dc:Point" x="197" y="377" />
+        <di:waypoint xsi:type="dc:Point" x="274" y="377" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="235.5" y="356" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_12dou7o_di" bpmnElement="SequenceFlow_12dou7o">
+        <di:waypoint xsi:type="dc:Point" x="374" y="377" />
+        <di:waypoint xsi:type="dc:Point" x="451" y="377" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="412.5" y="356" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ServiceTask_0mj3kf2_di" bpmnElement="ServiceTask_0mj3kf2">
+        <dc:Bounds x="959" y="337" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="IntermediateThrowEvent_08mk8h9_di" bpmnElement="IntermediateThrowEvent_08mk8h9">
+        <dc:Bounds x="1192" y="180" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1175" y="220" width="86" height="24" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0t7zinj_di" bpmnElement="SequenceFlow_0t7zinj">
+        <di:waypoint xsi:type="dc:Point" x="1059" y="198" />
+        <di:waypoint xsi:type="dc:Point" x="1192" y="198" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1125.5" y="177" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="IntermediateCatchEvent_14w7v9s_di" bpmnElement="IntermediateCatchEvent_14w7v9s">
+        <dc:Bounds x="-6" y="359" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="-29" y="421" width="88" height="24" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1bddzne_di" bpmnElement="SequenceFlow_1bddzne">
+        <di:waypoint xsi:type="dc:Point" x="30" y="377" />
+        <di:waypoint xsi:type="dc:Point" x="97" y="377" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="63.5" y="356" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_14kqo0r_di" bpmnElement="ScriptTask_14kqo0r">
+        <dc:Bounds x="122" y="972" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_1af6rwh_di" bpmnElement="ServiceTask_1af6rwh">
+        <dc:Bounds x="350" y="972" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0t4nds2_di" bpmnElement="SequenceFlow_0t4nds2">
+        <di:waypoint xsi:type="dc:Point" x="222" y="1012" />
+        <di:waypoint xsi:type="dc:Point" x="350" y="1012" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="286" y="991" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_06o383f_di" bpmnElement="SequenceFlow_06o383f">
+        <di:waypoint xsi:type="dc:Point" x="450" y="1012" />
+        <di:waypoint xsi:type="dc:Point" x="577" y="1012" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="513.5" y="991" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_04a0t3p_di" bpmnElement="ScriptTask_04a0t3p">
+        <dc:Bounds x="782" y="337" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1wzk6tu_di" bpmnElement="SequenceFlow_1wzk6tu">
+        <di:waypoint xsi:type="dc:Point" x="882" y="377" />
+        <di:waypoint xsi:type="dc:Point" x="959" y="377" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="920.5" y="356" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="IntermediateThrowEvent_1k72hze_di" bpmnElement="IntermediateThrowEvent_1k72hze">
+        <dc:Bounds x="646" y="447" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="631" y="487" width="76" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0kvl23y_di" bpmnElement="SequenceFlow_0kvl23y">
+        <di:waypoint xsi:type="dc:Point" x="1059" y="377" />
+        <di:waypoint xsi:type="dc:Point" x="1192" y="377" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1125.5" y="356" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_0zmd4rt_di" bpmnElement="SequenceFlow_0zmd4rt">
+        <di:waypoint xsi:type="dc:Point" x="664" y="402" />
+        <di:waypoint xsi:type="dc:Point" x="664" y="447" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="409" y="177" width="0" height="12" />
+          <dc:Bounds x="670" y="419" width="19" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1853xxi_di" bpmnElement="SequenceFlow_1853xxi">
-        <di:waypoint xsi:type="dc:Point" x="544" y="198" />
-        <di:waypoint xsi:type="dc:Point" x="600" y="198" />
+      <bpmndi:BPMNEdge id="SequenceFlow_1n8h3zt_di" bpmnElement="SequenceFlow_1n8h3zt">
+        <di:waypoint xsi:type="dc:Point" x="689" y="377" />
+        <di:waypoint xsi:type="dc:Point" x="782" y="377" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="572" y="177" width="0" height="12" />
+          <dc:Bounds x="729" y="356" width="14" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
index 9ed1431..5bb3d31 100644 (file)
@@ -20,7 +20,7 @@ def csi = new  DoCreateResources()
 csi.postConfigRequest(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:serviceTask id="Task_0io5qby" name="Call Sync SDNC service Create " camunda:class="org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.SdncServiceTopologyOperationTask">
-      <bpmn2:incoming>SequenceFlow_1vprtt9</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_0k0f7lm</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_11f2zuu</bpmn2:outgoing>
     </bpmn2:serviceTask>
     <bpmn2:sequenceFlow id="SequenceFlow_11f2zuu" sourceRef="Task_0io5qby" targetRef="IntermediateThrowEvent_0f2w7aj" />
@@ -85,7 +85,7 @@ ddsi.executeResourceRecipe(execution)]]></bpmn2:script>
       <bpmn2:incoming>SequenceFlow_11f2zuu</bpmn2:incoming>
       <bpmn2:linkEventDefinition name="ResourceLoop" />
     </bpmn2:intermediateThrowEvent>
-    <bpmn2:sequenceFlow id="SequenceFlow_1vprtt9" name="yes" sourceRef="ExclusiveGateway_07rr3wp" targetRef="Task_0io5qby">
+    <bpmn2:sequenceFlow id="SequenceFlow_1vprtt9" name="yes" sourceRef="ExclusiveGateway_07rr3wp" targetRef="Task_1blaq0f">
       <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{(execution.getVariable("isContainsWanResource" )  == "true" )}]]></bpmn2:conditionExpression>
     </bpmn2:sequenceFlow>
     <bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_05dus9b" name="StartPrepareResource">
@@ -126,6 +126,14 @@ ex.processJavaException(execution)]]></bpmn2:script>
       <bpmn2:sequenceFlow id="SequenceFlow_0gr9xqj" name="" sourceRef="StartEvent_0x7o2ug" targetRef="ScriptTask_1648adp" />
       <bpmn2:sequenceFlow id="SequenceFlow_0a6l29p" name="" sourceRef="ScriptTask_1648adp" targetRef="EndEvent_0lgdyyb" />
     </bpmn2:subProcess>
+    <bpmn2:scriptTask id="Task_1blaq0f" name="Prepare SDNC service Create" scriptFormat="groovy">
+      <bpmn2:incoming>SequenceFlow_1vprtt9</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_0k0f7lm</bpmn2:outgoing>
+      <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def ddsi = new DoCreateResources()
+ddsi.prepareServiceTopologyRequest(execution)]]></bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:sequenceFlow id="SequenceFlow_0k0f7lm" sourceRef="Task_1blaq0f" targetRef="Task_0io5qby" />
   </bpmn2:process>
   <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
   <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" />
@@ -144,15 +152,15 @@ ex.processJavaException(execution)]]></bpmn2:script>
         <dc:Bounds x="1119" y="485" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_0qi8cgg_di" bpmnElement="Task_0io5qby">
-        <dc:Bounds x="944" y="353" width="100" height="80" />
+        <dc:Bounds x="1047" y="353" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_11f2zuu_di" bpmnElement="SequenceFlow_11f2zuu">
-        <di:waypoint xsi:type="dc:Point" x="1044" y="393" />
-        <di:waypoint xsi:type="dc:Point" x="1090" y="393" />
-        <di:waypoint xsi:type="dc:Point" x="1090" y="300" />
+        <di:waypoint xsi:type="dc:Point" x="1147" y="393" />
+        <di:waypoint xsi:type="dc:Point" x="1219" y="393" />
+        <di:waypoint xsi:type="dc:Point" x="1219" y="300" />
         <di:waypoint xsi:type="dc:Point" x="1315" y="300" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1060" y="340.5" width="90" height="12" />
+          <dc:Bounds x="1189" y="340.5" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_1y0los4_di" bpmnElement="ScriptTask_1y0los4">
@@ -243,7 +251,7 @@ ex.processJavaException(execution)]]></bpmn2:script>
       <bpmndi:BPMNEdge id="SequenceFlow_1vprtt9_di" bpmnElement="SequenceFlow_1vprtt9">
         <di:waypoint xsi:type="dc:Point" x="778" y="325" />
         <di:waypoint xsi:type="dc:Point" x="778" y="393" />
-        <di:waypoint xsi:type="dc:Point" x="944" y="393" />
+        <di:waypoint xsi:type="dc:Point" x="861" y="394" />
         <bpmndi:BPMNLabel>
           <dc:Bounds x="784" y="353" width="20" height="12" />
         </bpmndi:BPMNLabel>
@@ -347,6 +355,16 @@ ex.processJavaException(execution)]]></bpmn2:script>
           <dc:Bounds x="567.5" y="888" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_0dh2mj1_di" bpmnElement="Task_1blaq0f">
+        <dc:Bounds x="861" y="354" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0k0f7lm_di" bpmnElement="SequenceFlow_0k0f7lm">
+        <di:waypoint xsi:type="dc:Point" x="961" y="394" />
+        <di:waypoint xsi:type="dc:Point" x="1047" y="393" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1004" y="372.5" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn2:definitions>
index 2068625..8a3d441 100644 (file)
@@ -1,5 +1,5 @@
 <?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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.11.3">
+<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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0">
   <bpmn:process id="DoDeleteE2EServiceInstance" name="All Resources Deleted" isExecutable="true">
     <bpmn:startEvent id="StartEvent_0212h2r" name="Start Flow">
       <bpmn:outgoing>SequenceFlow_0vz7cd9</bpmn:outgoing>
@@ -165,6 +165,7 @@ dcsi.postDecomposeService(execution)]]></bpmn:script>
         <camunda:in source="deleteResourceList" target="deleteResourceList" />
         <camunda:in source="resourceInstanceIDs" target="resourceInstanceIDs" />
         <camunda:in source="operationType" target="operationType" />
+        <camunda:in source="operationId" target="operationId" />
       </bpmn:extensionElements>
       <bpmn:incoming>SequenceFlow_1j08ko3</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1cevtpy</bpmn:outgoing>
@@ -180,6 +181,10 @@ dcsi.postDecomposeService(execution)]]></bpmn:script>
       <bpmn:linkEventDefinition name="DecomposeService" />
     </bpmn:intermediateThrowEvent>
     <bpmn:sequenceFlow id="SequenceFlow_0vi0sv6" sourceRef="ScriptTask_1rtnsh8" targetRef="StartEvent_1qh5a34" />
+    <bpmn:scriptTask id="ScriptTask_08a4vhm" name="Send Sync Ack Response" scriptFormat="groovy">    <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new  CompareModelofE2EServiceInstance()
+csi.sendSyncResponse(execution)]]></bpmn:script>
+</bpmn:scriptTask>
   </bpmn:process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoDeleteE2EServiceInstance">
@@ -398,6 +403,9 @@ dcsi.postDecomposeService(execution)]]></bpmn:script>
           <dc:Bounds x="-16" y="-39" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ScriptTask_08a4vhm_di" bpmnElement="ScriptTask_08a4vhm">
+        <dc:Bounds x="494" y="260" width="100" height="80" />
+      </bpmndi:BPMNShape>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>
index 7735b19..5e00358 100644 (file)
@@ -7,19 +7,11 @@
     <bpmn2:sequenceFlow id="SequenceFlow_1" name="" sourceRef="createSI_startEvent" targetRef="preProcessRequest_ScriptTask" />
     <bpmn2:scriptTask id="preProcessRequest_ScriptTask" name="PreProcess Incoming Request" scriptFormat="groovy">
       <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_04xlw7s</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def dcsi = new DoUpdateE2EServiceInstance()
 dcsi.preProcessRequest(execution)
 ]]></bpmn2:script>
-    </bpmn2:scriptTask>
-    <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="preProcessRequest_ScriptTask" targetRef="CallActivity_18nvmnn" />
-    <bpmn2:scriptTask id="ScriptTask_0i8cqdy_PostProcessAAIGET" name="Post Process AAI GET" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_0qg0uyn</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_167wc99</bpmn2:outgoing>
-      <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def dcsi = new DoUpdateE2EServiceInstance()
-dcsi.postProcessAAIGET(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:scriptTask id="Task_09laxun" name="PreProcess for Add Resources" scriptFormat="groovy">
       <bpmn2:incoming>SequenceFlow_115mdln</bpmn2:incoming>
@@ -28,67 +20,28 @@ dcsi.postProcessAAIGET(execution)]]></bpmn2:script>
 def csi = new  DoUpdateE2EServiceInstance()
 csi.preProcessForAddResource(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
-    <bpmn2:callActivity id="Task_1wyyy33" name="Call DoCreateResources" calledElement="DoCreateResources">
-      <bpmn2:extensionElements>
-        <camunda:in source="serviceInstanceName" target="serviceInstanceName" />
-        <camunda:in source="serviceDescription" target="nsServiceDescription" />
-        <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
-        <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
-        <camunda:in source="serviceType" target="serviceType" />
-        <camunda:in source="msoRequestId" target="msoRequestId" />
-        <camunda:in source="operationId" target="operationId" />
-        <camunda:in source="resourceType" target="resourceType" />
-        <camunda:in source="uuiRequest" target="uuiRequest" />
-        <camunda:in source="serviceDecomposition_Target" target="serviceDecomposition" />
-        <camunda:in source="operationType" target="operationType" />
-        <camunda:in source="addResourceList" target="addResourceList" />
-      </bpmn2:extensionElements>
-      <bpmn2:incoming>SequenceFlow_0yztz2p</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_0lblyhi</bpmn2:outgoing>
-    </bpmn2:callActivity>
     <bpmn2:scriptTask id="Task_0ag30bf" name="PostProcess for Add Resource" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_0lblyhi</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_1nqfgvs</bpmn2:outgoing>
+      <bpmn2:incoming>SequenceFlow_1wwjugw</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_177wo8z</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def csi = new  DoUpdateE2EServiceInstance()
 csi.postProcessForAddResource(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:intermediateCatchEvent id="StartEvent_StartResource" name="StartAddResources">
       <bpmn2:outgoing>SequenceFlow_115mdln</bpmn2:outgoing>
-      <bpmn2:linkEventDefinition name="StartAddResource" />
+      <bpmn2:linkEventDefinition name="StartAddResources" />
     </bpmn2:intermediateCatchEvent>
-    <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_1dwg5lz" name="GoToStartCompareModelVersions">
-      <bpmn2:incoming>SequenceFlow_167wc99</bpmn2:incoming>
-      <bpmn2:linkEventDefinition name="StartCompareModelVersions" />
-    </bpmn2:intermediateThrowEvent>
     <bpmn2:sequenceFlow id="SequenceFlow_115mdln" sourceRef="StartEvent_StartResource" targetRef="Task_09laxun" />
-    <bpmn2:sequenceFlow id="SequenceFlow_0yztz2p" sourceRef="Task_09laxun" targetRef="Task_1wyyy33" />
-    <bpmn2:sequenceFlow id="SequenceFlow_0lblyhi" sourceRef="Task_1wyyy33" targetRef="Task_0ag30bf" />
+    <bpmn2:sequenceFlow id="SequenceFlow_0yztz2p" sourceRef="Task_09laxun" targetRef="ExclusiveGateway_06gj84t" />
     <bpmn2:scriptTask id="ScriptTask_1xxvnst" name="PreProcess for Delete Resources" scriptFormat="groovy">
       <bpmn2:incoming>SequenceFlow_1qn0865</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_14rubz2</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_1s799cp</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def csi = new  DoUpdateE2EServiceInstance()
 csi.preProcessForDeleteResource(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
-    <bpmn2:callActivity id="CallActivity_0yphqzk" name="Call DoDeleteResources" calledElement="DoDeleteResources">
-      <bpmn2:extensionElements>
-        <camunda:in source="serviceInstanceName" target="serviceInstanceName" />
-        <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
-        <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
-        <camunda:in source="serviceType" target="serviceType" />
-        <camunda:in source="serviceId" target="serviceId" />
-        <camunda:in source="operationId" target="operationId" />
-        <camunda:in source="serviceDecomposition_Original" target="serviceDecomposition" />
-        <camunda:in source="operationType" target="operationType" />
-        <camunda:in source="delResourceList" target="delResourceList" />
-        <camunda:in source="serviceRelationShip" target="serviceRelationShip" />
-      </bpmn2:extensionElements>
-      <bpmn2:incoming>SequenceFlow_14rubz2</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_0tm9bw9</bpmn2:outgoing>
-    </bpmn2:callActivity>
     <bpmn2:scriptTask id="ScriptTask_00wgfrc" name="PostProcess for Delete Resource" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_0tm9bw9</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_0w4t4ao</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_1uu6uiu</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def csi = new  DoUpdateE2EServiceInstance()
@@ -99,63 +52,8 @@ csi.postProcessForDeleteResource(execution)]]></bpmn2:script>
       <bpmn2:linkEventDefinition name="StartDeleteResources" />
     </bpmn2:intermediateCatchEvent>
     <bpmn2:sequenceFlow id="SequenceFlow_1qn0865" sourceRef="IntermediateCatchEvent_0h6d9jb" targetRef="ScriptTask_1xxvnst" />
-    <bpmn2:sequenceFlow id="SequenceFlow_14rubz2" sourceRef="ScriptTask_1xxvnst" targetRef="CallActivity_0yphqzk" />
-    <bpmn2:sequenceFlow id="SequenceFlow_0tm9bw9" sourceRef="CallActivity_0yphqzk" targetRef="ScriptTask_00wgfrc" />
-    <bpmn2:scriptTask id="ScriptTask_0wl77h6" name="Post for Compare Model Versions" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_02d5ibj</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_0l4gosl</bpmn2:outgoing>
-      <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def csi = new  DoUpdateE2EServiceInstance()
-csi.postCompareModelVersions(execution)]]></bpmn2:script>
-    </bpmn2:scriptTask>
-    <bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_0gk8ige" name="StartCompareModelVersions">
-      <bpmn2:outgoing>SequenceFlow_1vtlt1v</bpmn2:outgoing>
-      <bpmn2:linkEventDefinition name="StartCompareModelVersions" />
-    </bpmn2:intermediateCatchEvent>
-    <bpmn2:scriptTask id="ScriptTask_1afvv50" name="Prepare for Compare Model Versions" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_1vtlt1v</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_0h40pn8</bpmn2:outgoing>
-      <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def ddsi = new DoUpdateE2EServiceInstance()
-ddsi.preCompareModelVersions(execution)]]></bpmn2:script>
-    </bpmn2:scriptTask>
-    <bpmn2:sequenceFlow id="SequenceFlow_02d5ibj" sourceRef="ServiceTask_02u5iza" targetRef="ScriptTask_0wl77h6" />
-    <bpmn2:sequenceFlow id="SequenceFlow_1vtlt1v" sourceRef="IntermediateCatchEvent_0gk8ige" targetRef="ScriptTask_1afvv50" />
-    <bpmn2:sequenceFlow id="SequenceFlow_0h40pn8" sourceRef="ScriptTask_1afvv50" targetRef="ServiceTask_02u5iza" />
-    <bpmn2:callActivity id="ServiceTask_02u5iza" name="Call DoCompareModelVersions" calledElement="DoCompareModelVersions">
-      <bpmn2:extensionElements>
-        <camunda:in source="msoRequestId" target="msoRequestId" />
-        <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
-        <camunda:in source="model-invariant-id-target" target="model-invariant-id-target" />
-        <camunda:in source="model-version-id-target" target="model-version-id-target" />
-        <camunda:in source="model-invariant-id-original" target="model-invariant-id-original" />
-        <camunda:in source="model-version-id-original" target="model-version-id-original" />
-        <camunda:out source="serviceDecomposition_Target" target="serviceDecomposition_Target" />
-        <camunda:out source="serviceDecomposition_Original" target="serviceDecomposition_Original" />
-        <camunda:out source="addResourceList" target="addResourceList" />
-        <camunda:out source="delResourceList" target="delResourceList" />
-      </bpmn2:extensionElements>
-      <bpmn2:incoming>SequenceFlow_0h40pn8</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_02d5ibj</bpmn2:outgoing>
-    </bpmn2:callActivity>
-    <bpmn2:callActivity id="CallActivity_18nvmnn" name="Call AAI Generic GetService" calledElement="GenericGetService">
-      <bpmn2:extensionElements>
-        <camunda:in source="serviceInstanceId" target="GENGS_serviceInstanceId" />
-        <camunda:in sourceExpression="service-instance" target="GENGS_type" />
-        <camunda:out source="GENGS_FoundIndicator" target="GENGS_FoundIndicator" />
-        <camunda:out source="GENGS_SuccessIndicator" target="GENGS_SuccessIndicator" />
-        <camunda:out source="WorkflowException" target="WorkflowException" />
-        <camunda:out source="GENGS_siResourceLink" target="GENGS_siResourceLink" />
-        <camunda:out source="GENGS_service" target="GENGS_service" />
-        <camunda:in source="globalSubscriberId" target="GENGS_globalCustomerId" />
-        <camunda:in source="serviceType" target="GENGS_serviceType" />
-      </bpmn2:extensionElements>
-      <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_0qg0uyn</bpmn2:outgoing>
-    </bpmn2:callActivity>
-    <bpmn2:sequenceFlow id="SequenceFlow_0qg0uyn" sourceRef="CallActivity_18nvmnn" targetRef="ScriptTask_0i8cqdy_PostProcessAAIGET" />
     <bpmn2:scriptTask id="ScriptTask_0acnvkp" name="Prepare Resource Oper Status" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_0l4gosl</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_04xlw7s</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_0r6c0ci</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def ddsi = new DoUpdateE2EServiceInstance()
@@ -183,17 +81,10 @@ ddsi.preInitResourcesOperStatus(execution)]]></bpmn2:script>
       <bpmn2:incoming>SequenceFlow_0r6c0ci</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_1muxopq</bpmn2:outgoing>
     </bpmn2:serviceTask>
-    <bpmn2:scriptTask id="ScriptTask_0r74c3c" name="Post Resource Oper Status" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_1muxopq</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_1sgsysh</bpmn2:outgoing>
-      <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def dcsi = new DoUpdateE2EServiceInstance()
-dcsi.postResourcesOperStatus(execution)]]></bpmn2:script>
-    </bpmn2:scriptTask>
     <bpmn2:sequenceFlow id="SequenceFlow_0r6c0ci" sourceRef="ScriptTask_0acnvkp" targetRef="ServiceTask_17u9q9u" />
-    <bpmn2:sequenceFlow id="SequenceFlow_1muxopq" sourceRef="ServiceTask_17u9q9u" targetRef="ScriptTask_0r74c3c" />
+    <bpmn2:sequenceFlow id="SequenceFlow_1muxopq" sourceRef="ServiceTask_17u9q9u" targetRef="IntermediateThrowEvent_09ur9ds" />
     <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_0vneaao" name="GoTo StartDeleteResources">
-      <bpmn2:incoming>SequenceFlow_1nqfgvs</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_177wo8z</bpmn2:incoming>
       <bpmn2:linkEventDefinition name="StartDeleteResources" />
     </bpmn2:intermediateThrowEvent>
     <bpmn2:callActivity id="CallActivity_1nm9zq7" name="Call Custom E2E Put Service" calledElement="CustomE2EPutService">
@@ -206,6 +97,7 @@ dcsi.postResourcesOperStatus(execution)]]></bpmn2:script>
         <camunda:out source="GENPS_SuccessIndicator" target="GENPS_SuccessIndicator" />
         <camunda:in source="msoRequestId" target="GENPS_requesId" />
         <camunda:out source="WorkflowException" target="WorkflowException" />
+        <camunda:in source="GENPS_serviceResourceVersion" target="GENPS_serviceResourceVersion" />
       </bpmn2:extensionElements>
       <bpmn2:incoming>SequenceFlow_1kx5ke9</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_0f76thv</bpmn2:outgoing>
@@ -224,7 +116,7 @@ ddsi.postProcessAAIPUT(execution)]]></bpmn2:script>
     <bpmn2:sequenceFlow id="SequenceFlow_1demy08" sourceRef="IntermediateCatchEvent_0a9bdjw" targetRef="ScriptTask_195nptq" />
     <bpmn2:sequenceFlow id="SequenceFlow_0f76thv" sourceRef="CallActivity_1nm9zq7" targetRef="ScriptTask_0xtabf8" />
     <bpmn2:scriptTask id="ScriptTask_19v8l1w" name="Post Config Service Instance Update" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_0h3kdi2</bpmn2:incoming>
+      <bpmn2:incoming>SequenceFlow_0ku36oy</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_07aa121</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def csi = new  DoUpdateE2EServiceInstance()
@@ -237,41 +129,8 @@ csi.postConfigRequest(execution)]]></bpmn2:script>
     <bpmn2:endEvent id="EndEvent_0exzmfn">
       <bpmn2:incoming>SequenceFlow_07aa121</bpmn2:incoming>
     </bpmn2:endEvent>
-    <bpmn2:scriptTask id="ScriptTask_0jsblrq" name="Prepare Update Service Oper Status(100%)" scriptFormat="groovy">
-      <bpmn2:incoming>SequenceFlow_0ku36oy</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_0mwh16g</bpmn2:outgoing>
-      <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-execution.setVariable("progress", "100")
-execution.setVariable("operationStatus", "End")
-def ddsi = new DoUpdateE2EServiceInstance()
-ddsi.preUpdateServiceOperationStatus(execution)]]></bpmn2:script>
-    </bpmn2:scriptTask>
-    <bpmn2:serviceTask id="ServiceTask_1ydxyw0" name="Update Service Oper Status">
-      <bpmn2:extensionElements>
-        <camunda:connector>
-          <camunda:inputOutput>
-            <camunda:inputParameter name="url">${URN_mso_openecomp_adapters_db_endpoint}</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_updateServiceOperStatusRequest}</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>
-      </bpmn2:extensionElements>
-      <bpmn2:incoming>SequenceFlow_0mwh16g</bpmn2:incoming>
-      <bpmn2:outgoing>SequenceFlow_0h3kdi2</bpmn2:outgoing>
-    </bpmn2:serviceTask>
-    <bpmn2:sequenceFlow id="SequenceFlow_0h3kdi2" sourceRef="ServiceTask_1ydxyw0" targetRef="ScriptTask_19v8l1w" />
     <bpmn2:sequenceFlow id="SequenceFlow_07aa121" sourceRef="ScriptTask_19v8l1w" targetRef="EndEvent_0exzmfn" />
-    <bpmn2:sequenceFlow id="SequenceFlow_0ku36oy" sourceRef="IntermediateCatchEvent_0z04o3s" targetRef="ScriptTask_0jsblrq" />
-    <bpmn2:sequenceFlow id="SequenceFlow_0mwh16g" sourceRef="ScriptTask_0jsblrq" targetRef="ServiceTask_1ydxyw0" />
+    <bpmn2:sequenceFlow id="SequenceFlow_0ku36oy" sourceRef="IntermediateCatchEvent_0z04o3s" targetRef="ScriptTask_19v8l1w" />
     <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_06lo96a" name="GoTo UpdateAAI">
       <bpmn2:incoming>SequenceFlow_1uu6uiu</bpmn2:incoming>
       <bpmn2:linkEventDefinition name="UpdateAAI" />
@@ -281,14 +140,10 @@ ddsi.preUpdateServiceOperationStatus(execution)]]></bpmn2:script>
       <bpmn2:linkEventDefinition name="FinishProcess" />
     </bpmn2:intermediateThrowEvent>
     <bpmn2:sequenceFlow id="SequenceFlow_0x0mhlj" sourceRef="ScriptTask_0xtabf8" targetRef="IntermediateThrowEvent_0hucdtk" />
-    <bpmn2:sequenceFlow id="SequenceFlow_167wc99" sourceRef="ScriptTask_0i8cqdy_PostProcessAAIGET" targetRef="IntermediateThrowEvent_1dwg5lz" />
     <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_09ur9ds" name="GoTo StartAddResources">
-      <bpmn2:incoming>SequenceFlow_1sgsysh</bpmn2:incoming>
-      <bpmn2:linkEventDefinition name="StartAddResource" />
+      <bpmn2:incoming>SequenceFlow_1muxopq</bpmn2:incoming>
+      <bpmn2:linkEventDefinition name="StartAddResources" />
     </bpmn2:intermediateThrowEvent>
-    <bpmn2:sequenceFlow id="SequenceFlow_0l4gosl" sourceRef="ScriptTask_0wl77h6" targetRef="ScriptTask_0acnvkp" />
-    <bpmn2:sequenceFlow id="SequenceFlow_1sgsysh" sourceRef="ScriptTask_0r74c3c" targetRef="IntermediateThrowEvent_09ur9ds" />
-    <bpmn2:sequenceFlow id="SequenceFlow_1nqfgvs" sourceRef="Task_0ag30bf" targetRef="IntermediateThrowEvent_0vneaao" />
     <bpmn2:sequenceFlow id="SequenceFlow_1uu6uiu" sourceRef="ScriptTask_00wgfrc" targetRef="IntermediateThrowEvent_06lo96a" />
     <bpmn2:subProcess id="SubProcess_0jo0nms" name="Sub-process for Application Errors" triggeredByEvent="true">
       <bpmn2:startEvent id="StartEvent_06768u3">
@@ -298,7 +153,7 @@ ddsi.preUpdateServiceOperationStatus(execution)]]></bpmn2:script>
       <bpmn2:endEvent id="EndEvent_014jyvb">
         <bpmn2:incoming>SequenceFlow_02znk15</bpmn2:incoming>
       </bpmn2:endEvent>
-      <bpmn2:scriptTask id="ScriptTask_1awrp72" name="Pre Process Rollback" scriptFormat="groovy">
+      <bpmn2:scriptTask id="ScriptTask_1awrp72" name="Pre Process Exception" scriptFormat="groovy">
         <bpmn2:incoming>SequenceFlow_05j3sat</bpmn2:incoming>
         <bpmn2:outgoing>SequenceFlow_19ly8h7</bpmn2:outgoing>
         <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
@@ -306,8 +161,8 @@ def dcsi = new DoCreateResources()
 dcsi.preProcessRollback(execution)\r
 ]]></bpmn2:script>
       </bpmn2:scriptTask>
-      <bpmn2:scriptTask id="ScriptTask_0vc9jgo" name="Post Process Rollback" scriptFormat="groovy">
-        <bpmn2:incoming>SequenceFlow_0utvwkh</bpmn2:incoming>
+      <bpmn2:scriptTask id="ScriptTask_0vc9jgo" name="Post Process Exception" scriptFormat="groovy">
+        <bpmn2:incoming>SequenceFlow_19ly8h7</bpmn2:incoming>
         <bpmn2:outgoing>SequenceFlow_02znk15</bpmn2:outgoing>
         <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*\r
 def dcsi = new DoCreateResources()\r
@@ -316,46 +171,14 @@ dcsi.postProcessRollback(execution)
       </bpmn2:scriptTask>
       <bpmn2:sequenceFlow id="SequenceFlow_05j3sat" sourceRef="StartEvent_06768u3" targetRef="ScriptTask_1awrp72" />
       <bpmn2:sequenceFlow id="SequenceFlow_02znk15" sourceRef="ScriptTask_0vc9jgo" targetRef="EndEvent_014jyvb" />
-      <bpmn2:sequenceFlow id="SequenceFlow_19ly8h7" sourceRef="ScriptTask_1awrp72" targetRef="ScriptTask_1bb9adn" />
-      <bpmn2:serviceTask id="ServiceTask_1kw189j" name="Update Service Oper Status">
-        <bpmn2:extensionElements>
-          <camunda:connector>
-            <camunda:inputOutput>
-              <camunda:inputParameter name="url">${URN_mso_openecomp_adapters_db_endpoint}</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_updateServiceOperStatusRequest}</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>
-        </bpmn2:extensionElements>
-        <bpmn2:incoming>SequenceFlow_1lqzi94</bpmn2:incoming>
-        <bpmn2:outgoing>SequenceFlow_0utvwkh</bpmn2:outgoing>
-      </bpmn2:serviceTask>
-      <bpmn2:sequenceFlow id="SequenceFlow_0utvwkh" sourceRef="ServiceTask_1kw189j" targetRef="ScriptTask_0vc9jgo" />
-      <bpmn2:scriptTask id="ScriptTask_1bb9adn" name="Prepare Update Service Oper Status(error)" scriptFormat="groovy">
-        <bpmn2:incoming>SequenceFlow_19ly8h7</bpmn2:incoming>
-        <bpmn2:outgoing>SequenceFlow_1lqzi94</bpmn2:outgoing>
-        <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-execution.setVariable("operationStatus", "error")
-def ddsi = new DoUpdateE2EServiceInstance()
-ddsi.preUpdateServiceOperationStatus(execution)]]></bpmn2:script>
-      </bpmn2:scriptTask>
-      <bpmn2:sequenceFlow id="SequenceFlow_1lqzi94" sourceRef="ScriptTask_1bb9adn" targetRef="ServiceTask_1kw189j" />
+      <bpmn2:sequenceFlow id="SequenceFlow_19ly8h7" sourceRef="ScriptTask_1awrp72" targetRef="ScriptTask_0vc9jgo" />
     </bpmn2:subProcess>
-    <bpmn2:scriptTask id="ScriptTask_195nptq" name="Pre Process AAI GET 2" scriptFormat="groovy">
+    <bpmn2:scriptTask id="ScriptTask_195nptq" name="Pre Process AAI GET" scriptFormat="groovy">
       <bpmn2:incoming>SequenceFlow_1demy08</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_1cy5gq2</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def dcsi = new DoUpdateE2EServiceInstance()
-dcsi.preProcessAAIGET2(execution)]]></bpmn2:script>
+dcsi.preProcessAAIGET(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:sequenceFlow id="SequenceFlow_1cy5gq2" sourceRef="ScriptTask_195nptq" targetRef="CallActivity_069o6fn" />
     <bpmn2:callActivity id="CallActivity_069o6fn" name="Call AAI Generic GetService" calledElement="GenericGetService">
@@ -373,12 +196,12 @@ dcsi.preProcessAAIGET2(execution)]]></bpmn2:script>
       <bpmn2:incoming>SequenceFlow_1cy5gq2</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_1vy856f</bpmn2:outgoing>
     </bpmn2:callActivity>
-    <bpmn2:scriptTask id="ScriptTask_0lp9y03" name="Post Process AAI GET 2" scriptFormat="groovy">
+    <bpmn2:scriptTask id="ScriptTask_0lp9y03" name="Post Process AAI GET" scriptFormat="groovy">
       <bpmn2:incoming>SequenceFlow_1vy856f</bpmn2:incoming>
       <bpmn2:outgoing>SequenceFlow_14ggluy</bpmn2:outgoing>
       <bpmn2:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
 def dcsi = new DoUpdateE2EServiceInstance()
-dcsi.postProcessAAIGET2(execution)]]></bpmn2:script>
+dcsi.postProcessAAIGET(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:sequenceFlow id="SequenceFlow_1vy856f" sourceRef="CallActivity_069o6fn" targetRef="ScriptTask_0lp9y03" />
     <bpmn2:sequenceFlow id="SequenceFlow_14ggluy" sourceRef="ScriptTask_0lp9y03" targetRef="ScriptTask_0sis7k0" />
@@ -390,45 +213,100 @@ def dcsi = new DoUpdateE2EServiceInstance()
 dcsi.preProcessAAIPUT(execution)]]></bpmn2:script>
     </bpmn2:scriptTask>
     <bpmn2:sequenceFlow id="SequenceFlow_1kx5ke9" sourceRef="ScriptTask_0sis7k0" targetRef="CallActivity_1nm9zq7" />
+    <bpmn2:sequenceFlow id="SequenceFlow_04xlw7s" sourceRef="preProcessRequest_ScriptTask" targetRef="ScriptTask_0acnvkp" />
+    <bpmn2:exclusiveGateway id="ExclusiveGateway_06gj84t" name="HasResourcetoAdd?" default="SequenceFlow_01po987">
+      <bpmn2:incoming>SequenceFlow_0yztz2p</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_0ttlte0</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_01po987</bpmn2:outgoing>
+    </bpmn2:exclusiveGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_0ttlte0" name="Yes" sourceRef="ExclusiveGateway_06gj84t" targetRef="CallActivity_07pl1uw">
+      <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("hasResourcetoAdd") == true}]]></bpmn2:conditionExpression>
+    </bpmn2:sequenceFlow>
+    <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_0xny7on" name="GoTo StartDeleteResources">
+      <bpmn2:incoming>SequenceFlow_01po987</bpmn2:incoming>
+      <bpmn2:linkEventDefinition name="StartDeleteResources" />
+    </bpmn2:intermediateThrowEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_01po987" name="No" sourceRef="ExclusiveGateway_06gj84t" targetRef="IntermediateThrowEvent_0xny7on" />
+    <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_0y1ii4i" name="GoTo UpdateAAI">
+      <bpmn2:incoming>SequenceFlow_070o30v</bpmn2:incoming>
+      <bpmn2:linkEventDefinition name="UpdateAAI" />
+    </bpmn2:intermediateThrowEvent>
+    <bpmn2:sequenceFlow id="SequenceFlow_177wo8z" sourceRef="Task_0ag30bf" targetRef="IntermediateThrowEvent_0vneaao" />
+    <bpmn2:callActivity id="CallActivity_11obqi0" name="Call DoDeleteResources" calledElement="DoDeleteResourcesV1">
+      <bpmn2:extensionElements>
+        <camunda:in source="msoRequestId" target="msoRequestId" />
+        <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" />
+        <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
+        <camunda:in source="serviceType" target="serviceType" />
+        <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
+        <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
+        <camunda:in source="serviceInputParams" target="serviceInputParams" />
+        <camunda:in source="delResourceList" target="deleteResourceList" />
+        <camunda:in source="resourceInstanceIDs" target="resourceInstanceIDs" />
+        <camunda:in source="operationType" target="operationType" />
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_0ur34hv</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_0w4t4ao</bpmn2:outgoing>
+    </bpmn2:callActivity>
+    <bpmn2:sequenceFlow id="SequenceFlow_0w4t4ao" sourceRef="CallActivity_11obqi0" targetRef="ScriptTask_00wgfrc" />
+    <bpmn2:callActivity id="CallActivity_07pl1uw" name="Call DoCreateResources" calledElement="DoCreateResourcesV3">
+      <bpmn2:extensionElements>
+        <camunda:in source="nsServiceName" target="nsServiceName" />
+        <camunda:in source="serviceDescription" target="nsServiceDescription" />
+        <camunda:in source="globalSubscriberId" target="globalSubscriberId" />
+        <camunda:in source="serviceType" target="serviceType" />
+        <camunda:in source="serviceInstanceId" target="serviceInstanceId" />
+        <camunda:in source="operationId" target="operationId" />
+        <camunda:in source="resourceType" target="resourceType" />
+        <camunda:in source="resourceUUID" target="resourceUUID" />
+        <camunda:in source="resourceParameters" target="resourceParameters" />
+        <camunda:in source="operationType" target="operationType" />
+        <camunda:in source="addResourceList" target="addResourceList" />
+        <camunda:in source="serviceInstanceName" target="serviceInstanceName" />
+        <camunda:in source="serviceDecomposition_Target" target="serviceDecomposition" />
+        <camunda:in source="uuiRequest" target="uuiRequest" />
+        <camunda:in source="msoRequestId" target="msoRequestId" />
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>SequenceFlow_0ttlte0</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_1wwjugw</bpmn2:outgoing>
+    </bpmn2:callActivity>
+    <bpmn2:sequenceFlow id="SequenceFlow_1wwjugw" sourceRef="CallActivity_07pl1uw" targetRef="Task_0ag30bf" />
+    <bpmn2:exclusiveGateway id="ExclusiveGateway_1fcnq0g" name="HasResourcetoDelete?" default="SequenceFlow_070o30v">
+      <bpmn2:incoming>SequenceFlow_1s799cp</bpmn2:incoming>
+      <bpmn2:outgoing>SequenceFlow_0ur34hv</bpmn2:outgoing>
+      <bpmn2:outgoing>SequenceFlow_070o30v</bpmn2:outgoing>
+    </bpmn2:exclusiveGateway>
+    <bpmn2:sequenceFlow id="SequenceFlow_1s799cp" sourceRef="ScriptTask_1xxvnst" targetRef="ExclusiveGateway_1fcnq0g" />
+    <bpmn2:sequenceFlow id="SequenceFlow_0ur34hv" name="Yes" sourceRef="ExclusiveGateway_1fcnq0g" targetRef="CallActivity_11obqi0">
+      <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("hasResourcetoDelete") == true}]]></bpmn2:conditionExpression>
+    </bpmn2:sequenceFlow>
+    <bpmn2:sequenceFlow id="SequenceFlow_070o30v" sourceRef="ExclusiveGateway_1fcnq0g" targetRef="IntermediateThrowEvent_0y1ii4i" />
   </bpmn2:process>
   <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
   <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" />
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoUpdateE2EServiceInstance">
       <bpmndi:BPMNShape id="_BPMNShape_StartEvent_47" bpmnElement="createSI_startEvent">
-        <dc:Bounds x="74" y="404" width="36" height="36" />
+        <dc:Bounds x="74" y="622" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="68" y="445" width="50" height="12" />
+          <dc:Bounds x="68" y="663" width="50" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_61" bpmnElement="preProcessRequest_ScriptTask">
-        <dc:Bounds x="293" y="382" width="100" height="80" />
+        <dc:Bounds x="293" y="600" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_47" targetElement="_BPMNShape_ScriptTask_61">
-        <di:waypoint xsi:type="dc:Point" x="110" y="422" />
-        <di:waypoint xsi:type="dc:Point" x="293" y="422" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="156.5" y="407" width="90" height="0" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_61" targetElement="CallActivity_18nvmnn_di">
-        <di:waypoint xsi:type="dc:Point" x="393" y="422" />
-        <di:waypoint xsi:type="dc:Point" x="581" y="420" />
+        <di:waypoint xsi:type="dc:Point" x="110" y="640" />
+        <di:waypoint xsi:type="dc:Point" x="293" y="640" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="442" y="406" width="90" height="0" />
+          <dc:Bounds x="156.5" y="625" width="90" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ScriptTask_0i8cqdy_di" bpmnElement="ScriptTask_0i8cqdy_PostProcessAAIGET">
-        <dc:Bounds x="858" y="382" width="100" height="80" />
-      </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_1azssf7_di" bpmnElement="Task_09laxun">
         <dc:Bounds x="293" y="828" width="100" height="80" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="CallActivity_1v57nb9_di" bpmnElement="Task_1wyyy33">
-        <dc:Bounds x="589" y="828" width="100" height="80" />
-      </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_1fj89ew_di" bpmnElement="Task_0ag30bf">
-        <dc:Bounds x="858" y="828" width="100" height="80" />
+        <dc:Bounds x="1229" y="828" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="IntermediateCatchEvent_0jks7by_di" bpmnElement="StartEvent_StartResource">
         <dc:Bounds x="74" y="850" width="36" height="36" />
@@ -436,12 +314,6 @@ dcsi.preProcessAAIPUT(execution)]]></bpmn2:script>
           <dc:Bounds x="50" y="895" width="84" height="24" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="IntermediateThrowEvent_0ys6800_di" bpmnElement="IntermediateThrowEvent_1dwg5lz">
-        <dc:Bounds x="1951" y="404" width="36" height="36" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="1925" y="444" width="90" height="24" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_115mdln_di" bpmnElement="SequenceFlow_115mdln">
         <di:waypoint xsi:type="dc:Point" x="110" y="868" />
         <di:waypoint xsi:type="dc:Point" x="293" y="868" />
@@ -451,26 +323,16 @@ dcsi.preProcessAAIPUT(execution)]]></bpmn2:script>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0yztz2p_di" bpmnElement="SequenceFlow_0yztz2p">
         <di:waypoint xsi:type="dc:Point" x="393" y="868" />
-        <di:waypoint xsi:type="dc:Point" x="589" y="868" />
+        <di:waypoint xsi:type="dc:Point" x="590" y="868" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="446" y="847" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_0lblyhi_di" bpmnElement="SequenceFlow_0lblyhi">
-        <di:waypoint xsi:type="dc:Point" x="689" y="868" />
-        <di:waypoint xsi:type="dc:Point" x="858" y="868" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="728.5" y="847" width="90" height="12" />
+          <dc:Bounds x="446.5" y="847" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_1xxvnst_di" bpmnElement="ScriptTask_1xxvnst">
         <dc:Bounds x="293" y="1081" width="100" height="80" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="CallActivity_0yphqzk_di" bpmnElement="CallActivity_0yphqzk">
-        <dc:Bounds x="589" y="1081" width="100" height="80" />
-      </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_00wgfrc_di" bpmnElement="ScriptTask_00wgfrc">
-        <dc:Bounds x="858" y="1081" width="100" height="80" />
+        <dc:Bounds x="1240" y="1081" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="IntermediateCatchEvent_0h6d9jb_di" bpmnElement="IntermediateCatchEvent_0h6d9jb">
         <dc:Bounds x="74" y="1103" width="36" height="36" />
@@ -487,102 +349,39 @@ dcsi.preProcessAAIPUT(execution)]]></bpmn2:script>
           <dc:Bounds x="172" y="1115" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_14rubz2_di" bpmnElement="SequenceFlow_14rubz2">
-        <di:waypoint xsi:type="dc:Point" x="393" y="1121" />
-        <di:waypoint xsi:type="dc:Point" x="589" y="1121" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="446" y="1100" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_0tm9bw9_di" bpmnElement="SequenceFlow_0tm9bw9">
-        <di:waypoint xsi:type="dc:Point" x="689" y="1121" />
-        <di:waypoint xsi:type="dc:Point" x="858" y="1121" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="728.5" y="1100" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ScriptTask_0wl77h6_di" bpmnElement="ScriptTask_0wl77h6">
-        <dc:Bounds x="858" y="600" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="IntermediateCatchEvent_0gk8ige_di" bpmnElement="IntermediateCatchEvent_0gk8ige">
-        <dc:Bounds x="74" y="622" width="36" height="36" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="50" y="684" width="89" height="24" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ScriptTask_1afvv50_di" bpmnElement="ScriptTask_1afvv50">
-        <dc:Bounds x="293" y="600" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_02d5ibj_di" bpmnElement="SequenceFlow_02d5ibj">
-        <di:waypoint xsi:type="dc:Point" x="689" y="640" />
-        <di:waypoint xsi:type="dc:Point" x="774" y="640" />
-        <di:waypoint xsi:type="dc:Point" x="774" y="640" />
-        <di:waypoint xsi:type="dc:Point" x="858" y="640" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="744" y="593" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1vtlt1v_di" bpmnElement="SequenceFlow_1vtlt1v">
-        <di:waypoint xsi:type="dc:Point" x="110" y="640" />
-        <di:waypoint xsi:type="dc:Point" x="293" y="640" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="156.5" y="619" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_0h40pn8_di" bpmnElement="SequenceFlow_0h40pn8">
-        <di:waypoint xsi:type="dc:Point" x="393" y="640" />
-        <di:waypoint xsi:type="dc:Point" x="589" y="640" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="446" y="578" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="CallActivity_00ftzjj_di" bpmnElement="ServiceTask_02u5iza">
-        <dc:Bounds x="589" y="600" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="CallActivity_18nvmnn_di" bpmnElement="CallActivity_18nvmnn">
-        <dc:Bounds x="581" y="380" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_0qg0uyn_di" bpmnElement="SequenceFlow_0qg0uyn">
-        <di:waypoint xsi:type="dc:Point" x="681" y="420" />
-        <di:waypoint xsi:type="dc:Point" x="858" y="422" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="724.5" y="400" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_0acnvkp_di" bpmnElement="ScriptTask_0acnvkp">
-        <dc:Bounds x="1152" y="600" width="100" height="80" />
+        <dc:Bounds x="589" y="600" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ServiceTask_17u9q9u_di" bpmnElement="ServiceTask_17u9q9u">
-        <dc:Bounds x="1421" y="600" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ScriptTask_0r74c3c_di" bpmnElement="ScriptTask_0r74c3c">
-        <dc:Bounds x="1675" y="600" width="100" height="80" />
+        <dc:Bounds x="872" y="600" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_0r6c0ci_di" bpmnElement="SequenceFlow_0r6c0ci">
-        <di:waypoint xsi:type="dc:Point" x="1252" y="640" />
-        <di:waypoint xsi:type="dc:Point" x="1421" y="640" />
+        <di:waypoint xsi:type="dc:Point" x="689" y="640" />
+        <di:waypoint xsi:type="dc:Point" x="774" y="640" />
+        <di:waypoint xsi:type="dc:Point" x="774" y="640" />
+        <di:waypoint xsi:type="dc:Point" x="872" y="640" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1291.5" y="619" width="90" height="12" />
+          <dc:Bounds x="744" y="634" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1muxopq_di" bpmnElement="SequenceFlow_1muxopq">
-        <di:waypoint xsi:type="dc:Point" x="1521" y="640" />
-        <di:waypoint xsi:type="dc:Point" x="1675" y="640" />
+        <di:waypoint xsi:type="dc:Point" x="972" y="640" />
+        <di:waypoint xsi:type="dc:Point" x="1762" y="640" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1553" y="619" width="90" height="12" />
+          <dc:Bounds x="1322" y="619" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="IntermediateThrowEvent_0vneaao_di" bpmnElement="IntermediateThrowEvent_0vneaao">
-        <dc:Bounds x="1951" y="850" width="36" height="36" />
+        <dc:Bounds x="1762" y="850" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1925" y="890" width="90" height="24" />
+          <dc:Bounds x="1738" y="890" width="86" height="36" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="CallActivity_1nm9zq7_di" bpmnElement="CallActivity_1nm9zq7">
-        <dc:Bounds x="1410" y="1333" width="100" height="80" />
+        <dc:Bounds x="1229" y="1333" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_0xtabf8_di" bpmnElement="ScriptTask_0xtabf8">
-        <dc:Bounds x="1666" y="1333" width="100" height="80" />
+        <dc:Bounds x="1473" y="1333" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="IntermediateCatchEvent_0a9bdjw_di" bpmnElement="IntermediateCatchEvent_0a9bdjw">
         <dc:Bounds x="74" y="1355" width="36" height="36" />
@@ -600,123 +399,71 @@ dcsi.preProcessAAIPUT(execution)]]></bpmn2:script>
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0f76thv_di" bpmnElement="SequenceFlow_0f76thv">
-        <di:waypoint xsi:type="dc:Point" x="1510" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="1594" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="1594" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="1666" y="1373" />
+        <di:waypoint xsi:type="dc:Point" x="1329" y="1373" />
+        <di:waypoint xsi:type="dc:Point" x="1473" y="1373" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1609" y="1367" width="0" height="12" />
+          <dc:Bounds x="1356" y="1352" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_19v8l1w_di" bpmnElement="ScriptTask_19v8l1w">
-        <dc:Bounds x="1460" y="1474" width="100" height="80" />
+        <dc:Bounds x="858" y="1579" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="IntermediateCatchEvent_0z04o3s_di" bpmnElement="IntermediateCatchEvent_0z04o3s">
-        <dc:Bounds x="74" y="1496" width="36" height="36" />
+        <dc:Bounds x="74" y="1601" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="57" y="1536" width="70" height="12" />
+          <dc:Bounds x="57" y="1641" width="70" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="EndEvent_0exzmfn_di" bpmnElement="EndEvent_0exzmfn">
-        <dc:Bounds x="1951" y="1496" width="36" height="36" />
+        <dc:Bounds x="1772" y="1601" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1924" y="1536" width="0" height="12" />
+          <dc:Bounds x="1700" y="1641" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ScriptTask_0jsblrq_di" bpmnElement="ScriptTask_0jsblrq">
-        <dc:Bounds x="283" y="1474" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ServiceTask_1ydxyw0_di" bpmnElement="ServiceTask_1ydxyw0">
-        <dc:Bounds x="858" y="1474" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_0h3kdi2_di" bpmnElement="SequenceFlow_0h3kdi2">
-        <di:waypoint xsi:type="dc:Point" x="958" y="1514" />
-        <di:waypoint xsi:type="dc:Point" x="1460" y="1514" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="1209" y="1493" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_07aa121_di" bpmnElement="SequenceFlow_07aa121">
-        <di:waypoint xsi:type="dc:Point" x="1560" y="1514" />
-        <di:waypoint xsi:type="dc:Point" x="1951" y="1514" />
+        <di:waypoint xsi:type="dc:Point" x="958" y="1619" />
+        <di:waypoint xsi:type="dc:Point" x="1772" y="1619" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1755.5" y="1493" width="0" height="12" />
+          <dc:Bounds x="1320" y="1598" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_0ku36oy_di" bpmnElement="SequenceFlow_0ku36oy">
-        <di:waypoint xsi:type="dc:Point" x="110" y="1514" />
-        <di:waypoint xsi:type="dc:Point" x="283" y="1514" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="196.5" y="1493" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_0mwh16g_di" bpmnElement="SequenceFlow_0mwh16g">
-        <di:waypoint xsi:type="dc:Point" x="383" y="1514" />
-        <di:waypoint xsi:type="dc:Point" x="858" y="1514" />
+        <di:waypoint xsi:type="dc:Point" x="110" y="1619" />
+        <di:waypoint xsi:type="dc:Point" x="858" y="1619" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="620.5" y="1493" width="0" height="12" />
+          <dc:Bounds x="439" y="1598" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="IntermediateThrowEvent_06lo96a_di" bpmnElement="IntermediateThrowEvent_06lo96a">
-        <dc:Bounds x="1951" y="1103" width="36" height="36" />
+        <dc:Bounds x="1762" y="1103" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1939" y="1143" width="82" height="12" />
+          <dc:Bounds x="1750" y="1143" width="82" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="IntermediateThrowEvent_0hucdtk_di" bpmnElement="IntermediateThrowEvent_0hucdtk">
-        <dc:Bounds x="1951" y="1355" width="36" height="36" />
+        <dc:Bounds x="1762" y="1355" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1945" y="1395" width="70" height="24" />
+          <dc:Bounds x="1756" y="1395" width="70" height="24" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_0x0mhlj_di" bpmnElement="SequenceFlow_0x0mhlj">
-        <di:waypoint xsi:type="dc:Point" x="1766" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="1863" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="1863" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="1951" y="1373" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="1878" y="1367" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_167wc99_di" bpmnElement="SequenceFlow_167wc99">
-        <di:waypoint xsi:type="dc:Point" x="958" y="422" />
-        <di:waypoint xsi:type="dc:Point" x="1951" y="422" />
+        <di:waypoint xsi:type="dc:Point" x="1573" y="1373" />
+        <di:waypoint xsi:type="dc:Point" x="1762" y="1373" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1409.5" y="401" width="90" height="12" />
+          <dc:Bounds x="1622.5" y="1352" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="IntermediateThrowEvent_09ur9ds_di" bpmnElement="IntermediateThrowEvent_09ur9ds">
-        <dc:Bounds x="1951" y="622" width="36" height="36" />
+        <dc:Bounds x="1762" y="622" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1927" y="663" width="84" height="36" />
+          <dc:Bounds x="1738" y="663" width="84" height="36" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_0l4gosl_di" bpmnElement="SequenceFlow_0l4gosl">
-        <di:waypoint xsi:type="dc:Point" x="958" y="640" />
-        <di:waypoint xsi:type="dc:Point" x="1152" y="640" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="1010" y="619" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1sgsysh_di" bpmnElement="SequenceFlow_1sgsysh">
-        <di:waypoint xsi:type="dc:Point" x="1775" y="640" />
-        <di:waypoint xsi:type="dc:Point" x="1951" y="640" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="1863" y="619" width="0" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1nqfgvs_di" bpmnElement="SequenceFlow_1nqfgvs">
-        <di:waypoint xsi:type="dc:Point" x="958" y="868" />
-        <di:waypoint xsi:type="dc:Point" x="1951" y="868" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="1409.5" y="847" width="90" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_1uu6uiu_di" bpmnElement="SequenceFlow_1uu6uiu">
-        <di:waypoint xsi:type="dc:Point" x="958" y="1121" />
-        <di:waypoint xsi:type="dc:Point" x="1951" y="1121" />
+        <di:waypoint xsi:type="dc:Point" x="1340" y="1121" />
+        <di:waypoint xsi:type="dc:Point" x="1762" y="1121" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1409.5" y="1100" width="90" height="12" />
+          <dc:Bounds x="1506" y="1100" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="SubProcess_0jo0nms_di" bpmnElement="SubProcess_0jo0nms" isExpanded="true">
@@ -725,13 +472,13 @@ dcsi.preProcessAAIPUT(execution)]]></bpmn2:script>
       <bpmndi:BPMNShape id="StartEvent_06768u3_di" bpmnElement="StartEvent_06768u3">
         <dc:Bounds x="266" y="1895" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="239" y="1936" width="0" height="12" />
+          <dc:Bounds x="194" y="1936" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="EndEvent_014jyvb_di" bpmnElement="EndEvent_014jyvb">
         <dc:Bounds x="1581" y="1895" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1554" y="1936" width="0" height="12" />
+          <dc:Bounds x="1509" y="1936" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_1awrp72_di" bpmnElement="ScriptTask_1awrp72">
@@ -744,21 +491,21 @@ dcsi.preProcessAAIPUT(execution)]]></bpmn2:script>
         <di:waypoint xsi:type="dc:Point" x="302" y="1913" />
         <di:waypoint xsi:type="dc:Point" x="557" y="1913" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="384.5" y="1892" width="90" height="12" />
+          <dc:Bounds x="385" y="1892" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_02znk15_di" bpmnElement="SequenceFlow_02znk15">
         <di:waypoint xsi:type="dc:Point" x="1348" y="1913" />
         <di:waypoint xsi:type="dc:Point" x="1581" y="1913" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1420.5" y="1898" width="0" height="12" />
+          <dc:Bounds x="1376" y="1898" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_19ly8h7_di" bpmnElement="SequenceFlow_19ly8h7">
         <di:waypoint xsi:type="dc:Point" x="657" y="1913" />
-        <di:waypoint xsi:type="dc:Point" x="786" y="1913" />
+        <di:waypoint xsi:type="dc:Point" x="1248" y="1913" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="676.5" y="1892" width="90" height="12" />
+          <dc:Bounds x="907.5" y="1892" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_195nptq_di" bpmnElement="ScriptTask_195nptq">
@@ -766,63 +513,138 @@ dcsi.preProcessAAIPUT(execution)]]></bpmn2:script>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1cy5gq2_di" bpmnElement="SequenceFlow_1cy5gq2">
         <di:waypoint xsi:type="dc:Point" x="393" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="589" y="1373" />
+        <di:waypoint xsi:type="dc:Point" x="495" y="1373" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="491" y="1352" width="0" height="12" />
+          <dc:Bounds x="399" y="1352" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="CallActivity_069o6fn_di" bpmnElement="CallActivity_069o6fn">
-        <dc:Bounds x="589" y="1333" width="100" height="80" />
+        <dc:Bounds x="495" y="1333" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="ScriptTask_0lp9y03_di" bpmnElement="ScriptTask_0lp9y03">
-        <dc:Bounds x="858" y="1333" width="100" height="80" />
+        <dc:Bounds x="724" y="1333" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1vy856f_di" bpmnElement="SequenceFlow_1vy856f">
-        <di:waypoint xsi:type="dc:Point" x="689" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="806" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="806" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="858" y="1373" />
+        <di:waypoint xsi:type="dc:Point" x="595" y="1373" />
+        <di:waypoint xsi:type="dc:Point" x="724" y="1373" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="821" y="1367" width="0" height="12" />
+          <dc:Bounds x="614.5" y="1352" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge id="SequenceFlow_14ggluy_di" bpmnElement="SequenceFlow_14ggluy">
-        <di:waypoint xsi:type="dc:Point" x="958" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="1055" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="1055" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="1152" y="1373" />
+        <di:waypoint xsi:type="dc:Point" x="824" y="1373" />
+        <di:waypoint xsi:type="dc:Point" x="978" y="1373" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1070" y="1367" width="0" height="12" />
+          <dc:Bounds x="856" y="1352" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="ScriptTask_0sis7k0_di" bpmnElement="ScriptTask_0sis7k0">
-        <dc:Bounds x="1152" y="1333" width="100" height="80" />
+        <dc:Bounds x="978" y="1333" width="100" height="80" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1kx5ke9_di" bpmnElement="SequenceFlow_1kx5ke9">
-        <di:waypoint xsi:type="dc:Point" x="1252" y="1373" />
-        <di:waypoint xsi:type="dc:Point" x="1410" y="1373" />
+        <di:waypoint xsi:type="dc:Point" x="1078" y="1373" />
+        <di:waypoint xsi:type="dc:Point" x="1229" y="1373" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1331" y="1352" width="0" height="12" />
+          <dc:Bounds x="1108.5" y="1352" width="90" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ServiceTask_1kw189j_di" bpmnElement="ServiceTask_1kw189j">
-        <dc:Bounds x="1005" y="1873" width="100" height="80" />
+      <bpmndi:BPMNEdge id="SequenceFlow_04xlw7s_di" bpmnElement="SequenceFlow_04xlw7s">
+        <di:waypoint xsi:type="dc:Point" x="393" y="640" />
+        <di:waypoint xsi:type="dc:Point" x="589" y="640" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="491" y="619" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ExclusiveGateway_06gj84t_di" bpmnElement="ExclusiveGateway_06gj84t" isMarkerVisible="true">
+        <dc:Bounds x="590" y="843" width="50" height="50" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="573" y="815" width="85" height="24" />
+        </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_0utvwkh_di" bpmnElement="SequenceFlow_0utvwkh">
-        <di:waypoint xsi:type="dc:Point" x="1105" y="1913" />
-        <di:waypoint xsi:type="dc:Point" x="1248" y="1913" />
+      <bpmndi:BPMNEdge id="SequenceFlow_0ttlte0_di" bpmnElement="SequenceFlow_0ttlte0">
+        <di:waypoint xsi:type="dc:Point" x="640" y="868" />
+        <di:waypoint xsi:type="dc:Point" x="756" y="868" />
+        <di:waypoint xsi:type="dc:Point" x="756" y="868" />
+        <di:waypoint xsi:type="dc:Point" x="858" y="868" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1176.5" y="1892" width="0" height="12" />
+          <dc:Bounds x="750" y="845" width="19" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ScriptTask_1bb9adn_di" bpmnElement="ScriptTask_1bb9adn">
-        <dc:Bounds x="786" y="1873" width="100" height="80" />
+      <bpmndi:BPMNShape id="IntermediateThrowEvent_0xny7on_di" bpmnElement="IntermediateThrowEvent_0xny7on">
+        <dc:Bounds x="597" y="955" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="573" y="995" width="86" height="36" />
+        </bpmndi:BPMNLabel>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_1lqzi94_di" bpmnElement="SequenceFlow_1lqzi94">
-        <di:waypoint xsi:type="dc:Point" x="886" y="1913" />
-        <di:waypoint xsi:type="dc:Point" x="1005" y="1913" />
+      <bpmndi:BPMNEdge id="SequenceFlow_01po987_di" bpmnElement="SequenceFlow_01po987">
+        <di:waypoint xsi:type="dc:Point" x="615" y="893" />
+        <di:waypoint xsi:type="dc:Point" x="615" y="955" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="623" y="918" width="14" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="IntermediateThrowEvent_0y1ii4i_di" bpmnElement="IntermediateThrowEvent_0y1ii4i">
+        <dc:Bounds x="597" y="1215" width="36" height="36" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="585" y="1255" width="82" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_177wo8z_di" bpmnElement="SequenceFlow_177wo8z">
+        <di:waypoint xsi:type="dc:Point" x="1329" y="868" />
+        <di:waypoint xsi:type="dc:Point" x="1762" y="868" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1545.5" y="847" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="CallActivity_11obqi0_di" bpmnElement="CallActivity_11obqi0">
+        <dc:Bounds x="872" y="1081" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_0w4t4ao_di" bpmnElement="SequenceFlow_0w4t4ao">
+        <di:waypoint xsi:type="dc:Point" x="972" y="1121" />
+        <di:waypoint xsi:type="dc:Point" x="1240" y="1121" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1106" y="1100" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="CallActivity_07pl1uw_di" bpmnElement="CallActivity_07pl1uw">
+        <dc:Bounds x="858" y="828" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1wwjugw_di" bpmnElement="SequenceFlow_1wwjugw">
+        <di:waypoint xsi:type="dc:Point" x="958" y="868" />
+        <di:waypoint xsi:type="dc:Point" x="1101" y="868" />
+        <di:waypoint xsi:type="dc:Point" x="1101" y="868" />
+        <di:waypoint xsi:type="dc:Point" x="1229" y="868" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="1116" y="862" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="ExclusiveGateway_1fcnq0g_di" bpmnElement="ExclusiveGateway_1fcnq0g" isMarkerVisible="true">
+        <dc:Bounds x="589.8479623824451" y="1096.0329153605016" width="50" height="50" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="572" y="1062" width="85" height="24" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="SequenceFlow_1s799cp_di" bpmnElement="SequenceFlow_1s799cp">
+        <di:waypoint xsi:type="dc:Point" x="393" y="1121" />
+        <di:waypoint xsi:type="dc:Point" x="590" y="1121" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="491.5" y="1100" width="0" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_0ur34hv_di" bpmnElement="SequenceFlow_0ur34hv">
+        <di:waypoint xsi:type="dc:Point" x="640" y="1121" />
+        <di:waypoint xsi:type="dc:Point" x="872" y="1121" />
+        <bpmndi:BPMNLabel>
+          <dc:Bounds x="746.9754098360655" y="1100" width="19" height="12" />
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_070o30v_di" bpmnElement="SequenceFlow_070o30v">
+        <di:waypoint xsi:type="dc:Point" x="615" y="1146" />
+        <di:waypoint xsi:type="dc:Point" x="615" y="1182" />
+        <di:waypoint xsi:type="dc:Point" x="615" y="1182" />
+        <di:waypoint xsi:type="dc:Point" x="615" y="1215" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="945.5" y="1892" width="0" height="12" />
+          <dc:Bounds x="630" y="1176" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
index e2ec7e0..99a87de 100644 (file)
@@ -310,12 +310,12 @@ public class AbstractBuilderTest {
         abstractBuilder.build(null, null);
     }
 
-    @Test(expected = NullPointerException.class)
+    @Test
     public void getRequestActoinTest() throws Exception {
         abstractBuilder.getRequestActoin(delegateExecution);
     }
 
-    @Test(expected = NullPointerException.class)
+    @Test
     public void getSvcActionTest() throws Exception {
         abstractBuilder.getSvcAction(delegateExecution);
     }
@@ -340,7 +340,7 @@ public class AbstractBuilderTest {
         abstractBuilder.getParamEntities(new HashMap<>());
     }
 
-    @Test(expected = NullPointerException.class)
+    @Test
     public void getRequestInformationEntityTest() throws Exception {
         abstractBuilder.getRequestInformationEntity(delegateExecution);
     }
index 54aab5c..a84aeaa 100644 (file)
@@ -168,7 +168,7 @@ public class AAIRestClientImpl implements AAIRestClientI {
         try {
             requestId = UUID.fromString(transactionLoggingUuid);
         } catch (IllegalArgumentException e) {
-            logger.warn("could not parse uuid: " + transactionLoggingUuid + " creating valid uuid automatically");
+            logger.warn("could not parse uuid: " + transactionLoggingUuid + " creating valid uuid automatically", e);
             requestId = UUID.randomUUID();
         }
         Response response = new AAIResourcesClient(ENDPOINT_VERSION, requestId)
@@ -186,7 +186,7 @@ public class AAIRestClientImpl implements AAIRestClientI {
         try {
             requestId = UUID.fromString(transactionLoggingUuid);
         } catch (IllegalArgumentException e) {
-            logger.warn("could not parse uuid: " + transactionLoggingUuid + " creating valid uuid automatically");
+            logger.warn("could not parse uuid: " + transactionLoggingUuid + " creating valid uuid automatically", e);
             requestId = UUID.randomUUID();
         }
         new AAIResourcesClient(ENDPOINT_VERSION, requestId)
index aabeb8a..5a2fa17 100644 (file)
@@ -60,7 +60,7 @@ public abstract class DmaapClient {
                try {
                        return new String(Base64.getDecoder().decode(password.getBytes()));
                } catch(IllegalArgumentException iae) {
-                       
+                       auditLogger.error("llegal Arguments",iae);
                        return password;
                }
        }
index f0c1b18..d1b2fb1 100644 (file)
@@ -28,10 +28,12 @@ import java.lang.reflect.Method;
 import org.hamcrest.Description;
 import org.hamcrest.Matcher;
 import org.hamcrest.TypeSafeDiagnosingMatcher;
+import org.openecomp.mso.logger.MsoLogger;
 
 import com.openpojo.reflection.PojoField;
 
 public class HasAnnotationPropertyWithValueMatcher<T extends PojoField> extends TypeSafeDiagnosingMatcher<T> {
+       private MsoLogger logger=MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
        private final String attribute;
        private final Matcher<?> annotationMatcher;
        private final Class<? extends Annotation> annotationClass;
@@ -59,6 +61,7 @@ public class HasAnnotationPropertyWithValueMatcher<T extends PojoField> extends
                        }
                } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
                        mismatchDescription.appendText("does not have property ").appendText(attribute);
+                       logger.debug("Error occured", e);
                        return false;
                }
                return true;
index 8d3a643..95da5b6 100644 (file)
-/*-\r
- * ============LICENSE_START=======================================================\r
- * ONAP - SO\r
- * ================================================================================\r
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ============LICENSE_END=========================================================\r
- */\r
-\r
-package org.openecomp.mso.apihandlerinfra;\r
-\r
-import java.io.IOException;\r
-import java.sql.Timestamp;\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import javax.ws.rs.Consumes;\r
-import javax.ws.rs.DELETE;\r
-import javax.ws.rs.GET;\r
-import javax.ws.rs.POST;\r
-import javax.ws.rs.PUT;\r
-import javax.ws.rs.Path;\r
-import javax.ws.rs.PathParam;\r
-import javax.ws.rs.Produces;\r
-import javax.ws.rs.core.MediaType;\r
-import javax.ws.rs.core.Response;\r
-\r
-import org.apache.http.HttpResponse;\r
-import org.apache.http.HttpStatus;\r
-import com.fasterxml.jackson.databind.ObjectMapper;\r
-import org.hibernate.Session;\r
-import org.json.JSONObject;\r
-import org.openecomp.mso.apihandler.common.ErrorNumbers;\r
-import org.openecomp.mso.apihandler.common.RequestClient;\r
-import org.openecomp.mso.apihandler.common.RequestClientFactory;\r
-import org.openecomp.mso.apihandler.common.ResponseHandler;\r
-import org.openecomp.mso.apihandlerinfra.Messages;\r
-import org.openecomp.mso.apihandlerinfra.MsoException;\r
-import org.openecomp.mso.apihandlerinfra.MsoRequest;\r
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.CompareModelsRequest;\r
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.DelE2ESvcResp;\r
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceDeleteRequest;\r
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceRequest;\r
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EUserParam;\r
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.GetE2EServiceInstanceResponse;\r
-import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.*;\r
-import org.openecomp.mso.serviceinstancebeans.ModelInfo;\r
-import org.openecomp.mso.serviceinstancebeans.ModelType;\r
-import org.openecomp.mso.serviceinstancebeans.RequestDetails;\r
-import org.openecomp.mso.serviceinstancebeans.RequestInfo;\r
-import org.openecomp.mso.serviceinstancebeans.RequestParameters;\r
-import org.openecomp.mso.serviceinstancebeans.ServiceInstancesRequest;\r
-import org.openecomp.mso.serviceinstancebeans.SubscriberInfo;\r
-import org.openecomp.mso.db.AbstractSessionFactoryManager;\r
-import org.openecomp.mso.db.catalog.CatalogDatabase;\r
-import org.openecomp.mso.db.catalog.beans.Service;\r
-import org.openecomp.mso.db.catalog.beans.ServiceRecipe;\r
-import org.openecomp.mso.logger.MessageEnum;\r
-import org.openecomp.mso.logger.MsoAlarmLogger;\r
-import org.openecomp.mso.logger.MsoLogger;\r
-import org.openecomp.mso.properties.MsoDatabaseException;\r
-import org.openecomp.mso.requestsdb.OperationStatus;\r
-import org.openecomp.mso.requestsdb.RequestsDatabase;\r
-import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager;\r
-import org.openecomp.mso.utils.UUIDChecker;\r
-\r
-import com.wordnik.swagger.annotations.Api;\r
-import com.wordnik.swagger.annotations.ApiOperation;\r
-\r
-@Path("/e2eServiceInstances")\r
-@Api(value = "/e2eServiceInstances", description = "API Requests for E2E Service Instances")\r
-public class E2EServiceInstances {\r
-\r
-       private HashMap<String, String> instanceIdMap = new HashMap<>();\r
-       private static MsoLogger msoLogger = MsoLogger\r
-                       .getMsoLogger(MsoLogger.Catalog.APIH);\r
-       private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger();\r
-       public static final String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA";\r
-       private ServiceInstancesRequest sir = null;\r
-\r
-       public static final String END_OF_THE_TRANSACTION = "End of the transaction, the final response is: ";\r
-       public static final String EXCEPTION_CREATING_DB_RECORD = "Exception while creating record in DB";\r
-       public static final String EXCEPTION_COMMUNICATE_BPMN_ENGINE = "Exception while communicate with BPMN engine";\r
-\r
-       /**\r
-        * POST Requests for E2E Service create Instance on a version provided\r
-        */\r
-\r
-       @POST\r
-       @Path("/{version:[vV][3-5]}")\r
-       @Consumes(MediaType.APPLICATION_JSON)\r
-       @Produces(MediaType.APPLICATION_JSON)\r
-       @ApiOperation(value = "Create an E2E Service Instance on a version provided", response = Response.class)\r
-       public Response createE2EServiceInstance(String request,\r
-                       @PathParam("version") String version) {\r
-\r
-               return processE2EserviceInstances(request, Action.createInstance, null,\r
-                               version);\r
-       }\r
-       \r
-       /**\r
-        * PUT Requests for E2E Service update Instance on a version provided\r
-        */\r
-\r
-       @PUT\r
-       @Path("/{version:[vV][3-5]}/{serviceId}")\r
-       @Consumes(MediaType.APPLICATION_JSON)\r
-       @Produces(MediaType.APPLICATION_JSON)\r
-       @ApiOperation(value = "Update an E2E Service Instance on a version provided and serviceId", response = Response.class)\r
-       public Response updateE2EServiceInstance(String request,\r
-                       @PathParam("version") String version,\r
-                       @PathParam("serviceId") String serviceId) {\r
-               \r
-               instanceIdMap.put("serviceId", serviceId);\r
-\r
-               return updateE2EserviceInstances(request, Action.updateInstance, instanceIdMap,\r
-                               version);\r
-       }\r
-\r
-       /**\r
-        * DELETE Requests for E2E Service delete Instance on a specified version\r
-        * and serviceId\r
-        */\r
-\r
-       @DELETE\r
-       @Path("/{version:[vV][3-5]}/{serviceId}")\r
-       @Consumes(MediaType.APPLICATION_JSON)\r
-       @Produces(MediaType.APPLICATION_JSON)\r
-       @ApiOperation(value = "Delete E2E Service Instance on a specified version and serviceId", response = Response.class)\r
-       public Response deleteE2EServiceInstance(String request,\r
-                       @PathParam("version") String version,\r
-                       @PathParam("serviceId") String serviceId) {\r
-\r
-               instanceIdMap.put("serviceId", serviceId);\r
-\r
-               return deleteE2EserviceInstances(request, Action.deleteInstance,\r
-                               instanceIdMap, version);\r
-       }\r
-\r
-       @GET\r
-       @Path("/{version:[vV][3-5]}/{serviceId}/operations/{operationId}")\r
-       @ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId", response = Response.class)\r
-       @Produces(MediaType.APPLICATION_JSON)\r
-       public Response getE2EServiceInstances(\r
-                       @PathParam("serviceId") String serviceId,\r
-                       @PathParam("version") String version,\r
-                       @PathParam("operationId") String operationId) {\r
-               return getE2EServiceInstances(serviceId, operationId);\r
-       }\r
-       \r
-    /**\r
-        * Scale Requests for E2E Service scale Instance on a specified version \r
-     */\r
-        \r
-       @POST\r
-       @Path("/{version:[vV][3-5]}/{serviceId}/scale")\r
-       @Consumes(MediaType.APPLICATION_JSON)\r
-       @Produces(MediaType.APPLICATION_JSON)\r
-       @ApiOperation(value="Scale E2E Service Instance on a specified version",response=Response.class)\r
-       public Response scaleE2EServiceInstance(String request,\r
-                                            @PathParam("version") String version,\r
-                                            @PathParam("serviceId") String serviceId) {\r
-\r
-               msoLogger.debug("------------------scale begin------------------");\r
-               instanceIdMap.put("serviceId", serviceId);\r
-               return scaleE2EserviceInstances(request, Action.scaleInstance, instanceIdMap, version);\r
-       }\r
-       /**\r
-        * GET Requests for Comparing model of service instance with target version\r
-        */\r
-       \r
-       @POST\r
-       @Path("/{version:[vV][3-5]}/{serviceId}/modeldifferences")\r
-       @Consumes(MediaType.APPLICATION_JSON)\r
-       @Produces(MediaType.APPLICATION_JSON)\r
-       @ApiOperation(value = "Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId ", response = Response.class)\r
-       public Response compareModelwithTargetVersion(String request,\r
-                       @PathParam("serviceId") String serviceId,\r
-                       @PathParam("version") String version) {\r
-               \r
-               instanceIdMap.put("serviceId", serviceId);\r
-               \r
-               return compareModelwithTargetVersion(request, Action.compareModel, instanceIdMap, version);\r
-       }       \r
-\r
-       private Response compareModelwithTargetVersion(String requestJSON, Action action,\r
-                       HashMap<String, String> instanceIdMap, String version) {\r
-\r
-               String requestId = instanceIdMap.get("serviceId");\r
-               long startTime = System.currentTimeMillis();\r
-               msoLogger.debug("requestId is: " + requestId);\r
-\r
-               CompareModelsRequest e2eCompareModelReq = null;\r
-\r
-               MsoRequest msoRequest = new MsoRequest(requestId);\r
-\r
-               ObjectMapper mapper = new ObjectMapper();\r
-               try {\r
-                       e2eCompareModelReq = mapper.readValue(requestJSON, CompareModelsRequest.class);\r
-\r
-               } catch (Exception e) {\r
-\r
-                       msoLogger.debug("Mapping of request to JSON object failed : ", e);\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,\r
-                                       MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_BAD_PARAMETER, null);\r
-                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,\r
-                                       "Mapping of request to JSON object failed");\r
-                       msoLogger.debug("End of the transaction, the final response is: " + response.getEntity().toString());\r
-\r
-                       return response;\r
-               }\r
-\r
-               Response returnResp = runCompareModelBPMWorkflow(e2eCompareModelReq, msoRequest, requestJSON, requestId,\r
-                               startTime, action);\r
-\r
-               return returnResp;\r
-\r
-       }\r
-\r
-       private Response runCompareModelBPMWorkflow(CompareModelsRequest e2eCompareModelReq, MsoRequest msoRequest,\r
-                       String requestJSON, String requestId, long startTime, Action action) {\r
-               \r
-               // Define RecipeLookupResult info here instead of query DB for efficiency\r
-               String workflowUrl = "/mso/async/services/CompareModelofE2EServiceInstance";\r
-               int recipeTimeout = 180;\r
-\r
-               RequestClient requestClient = null;\r
-               HttpResponse response = null;\r
-\r
-               long subStartTime = System.currentTimeMillis();\r
-\r
-               try {\r
-                       requestClient = RequestClientFactory.getRequestClient(workflowUrl, MsoPropertiesUtils.loadMsoProperties());\r
-\r
-                       JSONObject jjo = new JSONObject(requestJSON);\r
-                       String bpmnRequest = jjo.toString();\r
-\r
-                       // Capture audit event\r
-                       msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());\r
-                       String serviceId = instanceIdMap.get("serviceId");\r
-                       String serviceType = e2eCompareModelReq.getServiceType();\r
-                       response = requestClient.post(requestId, false, recipeTimeout, action.name(), serviceId, null, null, null,\r
-                                       null, null, serviceType, null, null, null, bpmnRequest, null);\r
-\r
-                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,\r
-                                       "Successfully received response from BPMN engine", "BPMN", workflowUrl, null);\r
-               } catch (Exception e) {\r
-                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",\r
-                                       workflowUrl, null);\r
-                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,\r
-                                       MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,\r
-                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));\r
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,\r
-                                       "Exception while communicate with BPMN engine");\r
-                       msoLogger.debug("End of the transaction, the final response is: " + resp.getEntity().toString());\r
-                       return resp;\r
-               }\r
-\r
-               if (response == null) {\r
-                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,\r
-                                       MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,\r
-                                       "Null response from BPMN");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION + resp.getEntity().toString());\r
-                       return resp;\r
-               }\r
-\r
-               ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());\r
-               int bpelStatus = respHandler.getStatus();\r
-               // String responseBody = respHandler.getResponseBody();\r
-               // CompareModelsResult modelDiffResponse = new CompareModelsResult();\r
-\r
-               return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action,\r
-                               instanceIdMap);\r
-       }\r
-\r
-       private Response getE2EServiceInstances(String serviceId, String operationId) {\r
-               RequestsDatabase requestsDB = RequestsDatabase.getInstance();\r
-\r
-               GetE2EServiceInstanceResponse e2eServiceResponse = new GetE2EServiceInstanceResponse();\r
-\r
-               MsoRequest msoRequest = new MsoRequest(serviceId);\r
-\r
-               long startTime = System.currentTimeMillis();\r
-\r
-               OperationStatus operationStatus = null;\r
-\r
-               try {\r
-                       operationStatus = requestsDB.getOperationStatus(serviceId,\r
-                                       operationId);\r
-\r
-               } catch (Exception e) {\r
-                       msoLogger\r
-                                       .error(MessageEnum.APIH_DB_ACCESS_EXC,\r
-                                                       MSO_PROP_APIHANDLER_INFRA,\r
-                                                       "",\r
-                                                       "",\r
-                                                       MsoLogger.ErrorCode.AvailabilityError,\r
-                                                       "Exception while communciate with Request DB - Infra Request Lookup",\r
-                                                       e);\r
-                       msoRequest\r
-                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
-                       Response response = msoRequest.buildServiceErrorResponse(\r
-                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,\r
-                                       e.getMessage(),\r
-                                       ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB, null);\r
-                       alarmLogger.sendAlarm("MsoDatabaseAccessError",\r
-                                       MsoAlarmLogger.CRITICAL, Messages.errors\r
-                                                       .get(ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB));\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.DBAccessError,\r
-                                       "Exception while communciate with Request DB");\r
-                       msoLogger.debug("End of the transaction, the final response is: "\r
-                                       + (String) response.getEntity());\r
-                       return response;\r
-\r
-               }\r
-\r
-               if (operationStatus == null) {\r
-                       Response resp = msoRequest.buildServiceErrorResponse(\r
-                                       HttpStatus.SC_NO_CONTENT, MsoException.ServiceException,\r
-                                       "E2E serviceId " + serviceId + " is not found in DB",\r
-                                       ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);\r
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,\r
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.BusinessProcesssError,\r
-                                       "Null response from RequestDB when searching by serviceId");\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.DataNotFound,\r
-                                       "Null response from RequestDB when searching by serviceId");\r
-                       msoLogger.debug("End of the transaction, the final response is: "\r
-                                       + (String) resp.getEntity());\r
-                       return resp;\r
-\r
-               }\r
-\r
-               e2eServiceResponse.setOperationStatus(operationStatus);\r
-\r
-               return Response.status(200).entity(e2eServiceResponse).build();\r
-       }\r
-\r
-       private Response deleteE2EserviceInstances(String requestJSON,\r
-                       Action action, HashMap<String, String> instanceIdMap, String version) {\r
-               // TODO should be a new one or the same service instance Id\r
-               String requestId = instanceIdMap.get("serviceId");\r
-               long startTime = System.currentTimeMillis();\r
-               msoLogger.debug("requestId is: " + requestId);\r
-               E2EServiceInstanceDeleteRequest e2eDelReq = null;\r
-\r
-               MsoRequest msoRequest = new MsoRequest(requestId);\r
-\r
-               ObjectMapper mapper = new ObjectMapper();\r
-               try {\r
-                       e2eDelReq = mapper.readValue(requestJSON,\r
-                                       E2EServiceInstanceDeleteRequest.class);\r
-\r
-               } catch (Exception e) {\r
-\r
-                       msoLogger.debug("Mapping of request to JSON object failed : ", e);\r
-                       Response response = msoRequest.buildServiceErrorResponse(\r
-                                       HttpStatus.SC_BAD_REQUEST,\r
-                                       MsoException.ServiceException,\r
-                                       "Mapping of request to JSON object failed.  "\r
-                                                       + e.getMessage(), ErrorNumbers.SVC_BAD_PARAMETER,\r
-                                       null);\r
-                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR,\r
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.SchemaError,\r
-                                       "Mapping of request to JSON object failed");\r
-                       msoLogger.debug("End of the transaction, the final response is: "\r
-                                       + (String) response.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return response;\r
-               }\r
-\r
-               CatalogDatabase db = null;\r
-               RecipeLookupResult recipeLookupResult = null;\r
-               try {\r
-                       db = CatalogDatabase.getInstance();\r
-                       //TODO  Get the service template model version uuid from AAI.\r
-                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, null, action);\r
-               } catch (Exception e) {\r
-                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC,\r
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.AvailabilityError,\r
-                                       "Exception while communciate with Catalog DB", e);\r
-                       msoRequest\r
-                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
-                       Response response = msoRequest.buildServiceErrorResponse(\r
-                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,\r
-                                       "No communication to catalog DB " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       alarmLogger.sendAlarm("MsoDatabaseAccessError",\r
-                                       MsoAlarmLogger.CRITICAL, Messages.errors\r
-                                                       .get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));\r
-                       msoRequest.createRequestRecord(Status.FAILED, action);\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.DBAccessError,\r
-                                       "Exception while communciate with DB");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION\r
-                                       + (String) response.getEntity());\r
-                       return response;\r
-               } finally {\r
-                       closeCatalogDB(db);\r
-               }\r
-               if (recipeLookupResult == null) {\r
-                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,\r
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");\r
-                       msoRequest\r
-                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
-                       Response response = msoRequest.buildServiceErrorResponse(\r
-                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,\r
-                                       "Recipe does not exist in catalog DB",\r
-                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);\r
-                       msoRequest.createRequestRecord(Status.FAILED, action);\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.DataNotFound,\r
-                                       "No recipe found in DB");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION\r
-                                       + (String) response.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return response;\r
-               }\r
-\r
-               RequestClient requestClient = null;\r
-               HttpResponse response = null;\r
-\r
-               long subStartTime = System.currentTimeMillis();\r
-               // String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
-\r
-               try {\r
-                       requestClient = RequestClientFactory.getRequestClient(\r
-                                       recipeLookupResult.getOrchestrationURI(),\r
-                                       MsoPropertiesUtils.loadMsoProperties());\r
-\r
-                       JSONObject jjo = new JSONObject(requestJSON);\r
-                       jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));\r
-\r
-                       String bpmnRequest = jjo.toString();\r
-\r
-                       // Capture audit event\r
-                       msoLogger\r
-                                       .debug("MSO API Handler Posting call to BPEL engine for url: "\r
-                                                       + requestClient.getUrl());\r
-                       String serviceId = instanceIdMap.get("serviceId");\r
-                       String serviceInstanceType = e2eDelReq.getServiceType();\r
-                       response = requestClient.post(requestId, false,\r
-                                       recipeLookupResult.getRecipeTimeout(), action.name(),\r
-                                       serviceId, null, null, null, null, null, serviceInstanceType,\r
-                                       null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());\r
-\r
-                       msoLogger.recordMetricEvent(subStartTime,\r
-                                       MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,\r
-                                       "Successfully received response from BPMN engine", "BPMN",\r
-                                       recipeLookupResult.getOrchestrationURI(), null);\r
-               } catch (Exception e) {\r
-                       msoLogger.recordMetricEvent(subStartTime,\r
-                                       MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.CommunicationError,\r
-                                       "Exception while communicate with BPMN engine", "BPMN",\r
-                                       recipeLookupResult.getOrchestrationURI(), null);\r
-                       Response resp = msoRequest.buildServiceErrorResponse(\r
-                                       HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,\r
-                                       "Failed calling bpmn " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       alarmLogger.sendAlarm("MsoConfigurationError",\r
-                                       MsoAlarmLogger.CRITICAL,\r
-                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));\r
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,\r
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.AvailabilityError,\r
-                                       "Exception while communicate with BPMN engine");\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.CommunicationError,\r
-                                       "Exception while communicate with BPMN engine");\r
-                       msoLogger.debug("End of the transaction, the final response is: "\r
-                                       + (String) resp.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return resp;\r
-               }\r
-\r
-               if (response == null) {\r
-                       Response resp = msoRequest.buildServiceErrorResponse(\r
-                                       HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,\r
-                                       "bpelResponse is null",\r
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,\r
-                                       MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.BusinessProcesssError,\r
-                                       "Null response from BPEL");\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.InternalError,\r
-                                       "Null response from BPMN");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return resp;\r
-               }\r
-\r
-               ResponseHandler respHandler = new ResponseHandler(response,\r
-                               requestClient.getType());\r
-               int bpelStatus = respHandler.getStatus();\r
-\r
-               return beplStatusUpdate(requestId, startTime, msoRequest,\r
-                               requestClient, respHandler, bpelStatus, action, instanceIdMap);\r
-       }\r
-\r
-       private Response updateE2EserviceInstances(String requestJSON, Action action,\r
-                       HashMap<String, String> instanceIdMap, String version) {\r
-\r
-               String requestId = UUIDChecker.generateUUID(msoLogger);\r
-               long startTime = System.currentTimeMillis();\r
-               msoLogger.debug("requestId is: " + requestId);\r
-               E2EServiceInstanceRequest e2eSir = null;\r
-\r
-               MsoRequest msoRequest = new MsoRequest(requestId);\r
-               ObjectMapper mapper = new ObjectMapper();\r
-               try {\r
-                       e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);\r
-\r
-               } catch (Exception e) {\r
-          \r
-          this.createOperationStatusRecordForError(action, requestId);\r
-                 \r
-                       msoLogger.debug("Mapping of request to JSON object failed : ", e);\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,\r
-                                       MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_BAD_PARAMETER, null);\r
-                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,\r
-                                       "Mapping of request to JSON object failed");\r
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
-                       return response;\r
-               }\r
-\r
-               mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
-               sir.getRequestDetails().getRequestParameters().setaLaCarte(true);\r
-               try {\r
-                       msoRequest.parse(sir, instanceIdMap, action, version, requestJSON);\r
-               } catch (Exception e) {\r
-                       msoLogger.debug("Validation failed: ", e);\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,\r
-                                       MsoException.ServiceException, "Error parsing request.  " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_BAD_PARAMETER, null);\r
-                       if (msoRequest.getRequestId() != null) {\r
-                               msoLogger.debug("Logging failed message to the database");\r
-                               this.createOperationStatusRecordForError(action, requestId);\r
-                       }\r
-                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,\r
-                                       "Validation of the input request failed");\r
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
-                       return response;\r
-               }\r
-               \r
-               //check for the current operation status\r
-               Response resp = checkE2ESvcInstStatus(action, requestId, startTime, msoRequest);\r
-               if(resp != null && resp.getStatus() != 200) {\r
-                       return resp;\r
-               }\r
-               \r
-               CatalogDatabase db = null;\r
-               RecipeLookupResult recipeLookupResult = null;\r
-               try {\r
-                       db = CatalogDatabase.getInstance();\r
-                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, e2eSir.getService().getServiceUuid(), action);\r
-               } catch (Exception e) {\r
-                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);\r
-                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,\r
-                                       MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,\r
-                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));\r
-                       \r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,\r
-                                       "Exception while communciate with DB");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return response;\r
-               } finally {\r
-                       closeCatalogDB(db);\r
-               }\r
-\r
-               if (recipeLookupResult == null) {\r
-                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");\r
-                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,\r
-                                       MsoException.ServiceException, "Recipe does not exist in catalog DB",\r
-                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);\r
-               \r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,\r
-                                       "No recipe found in DB");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return response;\r
-               }\r
-\r
-               String serviceInstanceType = e2eSir.getService().getServiceType();\r
-\r
-               String serviceId = instanceIdMap.get("serviceId");\r
-               RequestClient requestClient = null;\r
-               HttpResponse response = null;\r
-\r
-               long subStartTime = System.currentTimeMillis();\r
-               String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
-\r
-               try {\r
-                       requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),\r
-                                       MsoPropertiesUtils.loadMsoProperties());\r
-\r
-                       // Capture audit event\r
-                       msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());\r
-\r
-                       response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),\r
-                                       serviceId, null, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson,\r
-                                       recipeLookupResult.getRecipeParamXsd());\r
-\r
-                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,\r
-                                       "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),\r
-                                       null);\r
-               } catch (Exception e) {\r
-                       msoLogger.debug("Exception while communicate with BPMN engine", e);\r
-                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",\r
-                                       recipeLookupResult.getOrchestrationURI(), null);\r
-                       Response getBPMNResp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,\r
-                                       MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,\r
-                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));\r
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,\r
-                                       "Exception while communicate with BPMN engine");\r
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) getBPMNResp.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return getBPMNResp;\r
-               }\r
-\r
-               if (response == null) {\r
-                       Response getBPMNResp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,\r
-                                       MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,\r
-                                       "Null response from BPMN");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) getBPMNResp.getEntity());\r
-                       this.createOperationStatusRecordForError(action, requestId);\r
-                       return getBPMNResp;\r
-               }\r
-\r
-               ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());\r
-               int bpelStatus = respHandler.getStatus();\r
-\r
-               return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);\r
-       }\r
-\r
-       private Response checkE2ESvcInstStatus(Action action, String requestId, long startTime, MsoRequest msoRequest) {\r
-               OperationStatus curStatus = null;\r
-//             String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();\r
-               String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();\r
-               try {\r
-                       if (!(requestId == null && "service".equals(requestScope) && (action == Action.updateInstance))) {                          \r
-                               curStatus = chkSvcInstOperStatusbySvcId(requestId);\r
-                       }\r
-               } catch (Exception e) {\r
-                       msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.DataError, "Error during current operation status check ", e);\r
-\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,\r
-                                       MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);\r
-\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,\r
-                                       "Error during current operation status check");\r
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
-                       return response;\r
-               }\r
-\r
-               if (curStatus != null && curStatus.getResult() != null && curStatus.getResult().equalsIgnoreCase("processing")) {\r
-                       String chkMessage = "Error: Locked instance - This " + requestScope + " (" + requestId + ") "\r
-                                       + "now being worked with a status of " + curStatus.getResult() \r
-                                       + ". The latest workflow of instance must be finished or cleaned up.";\r
-\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,\r
-                                       MsoException.ServiceException, chkMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);\r
-\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,\r
-                                       chkMessage);\r
-\r
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
-\r
-                       createOperationStatusRecordForError(action, requestId);\r
-\r
-                       return response;\r
-               }\r
-               \r
-               return Response.status(200).entity(null).build();\r
-       }\r
-       \r
-       private Response processE2EserviceInstances(String requestJSON, Action action,\r
-                       HashMap<String, String> instanceIdMap, String version) {\r
-\r
-               String requestId = UUIDChecker.generateUUID(msoLogger);\r
-               long startTime = System.currentTimeMillis();\r
-               msoLogger.debug("requestId is: " + requestId);\r
-               E2EServiceInstanceRequest e2eSir = null;\r
-\r
-               MsoRequest msoRequest = new MsoRequest(requestId);\r
-               ObjectMapper mapper = new ObjectMapper();\r
-               try {\r
-                       e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);\r
-\r
-               } catch (Exception e) {\r
-          //TODO update the service name\r
-          this.createOperationStatusRecordForError(action, requestId);\r
-                 \r
-                       msoLogger.debug("Mapping of request to JSON object failed : ", e);\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,\r
-                                       MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_BAD_PARAMETER, null);\r
-                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,\r
-                                       "Mapping of request to JSON object failed");\r
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
-                       return response;\r
-               }\r
-\r
-               mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
-               sir.getRequestDetails().getRequestParameters().setaLaCarte(true);\r
-               try {\r
-                       msoRequest.parse(sir, instanceIdMap, action, version, requestJSON);\r
-               } catch (Exception e) {\r
-                       msoLogger.debug("Validation failed: ", e);\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,\r
-                                       MsoException.ServiceException, "Error parsing request.  " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_BAD_PARAMETER, null);\r
-                       if (msoRequest.getRequestId() != null) {\r
-                               msoLogger.debug("Logging failed message to the database");\r
-                               //TODO update the service name\r
-                         this.createOperationStatusRecordForError(action, requestId);\r
-                       }\r
-                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,\r
-                                       "Validation of the input request failed");\r
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
-                       return response;\r
-               }\r
-               \r
-               OperationStatus dup = null;\r
-               String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();\r
-               String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();\r
-               try {\r
-                       if (!(instanceName == null && "service".equals(requestScope)\r
-                                       && (action == Action.createInstance || action == Action.activateInstance))) {\r
-                         //TODO : Need to check for the duplicate record from the operation status,\r
-                         //TODO : commenting this check for unblocking current testing for now...  induces dead code...\r
-                               dup = chkDuplicateServiceNameInOperStatus( instanceName);\r
-                       }\r
-               } catch (Exception e) {\r
-                       msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.DataError, "Error during duplicate check ", e);\r
-\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,\r
-                                       MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);\r
-\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,\r
-                                       "Error during duplicate check");\r
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
-                       return response;\r
-               }\r
-\r
-               if (dup != null) {\r
-                       // Found the duplicate record. Return the appropriate error.\r
-                       String instance = null;\r
-                       if (instanceName != null) {\r
-                               instance = instanceName;\r
-                       } else {\r
-                               instance = instanceIdMap.get(requestScope + "InstanceId");\r
-                       }\r
-                       String dupMessage = "Error: Locked instance - This " + requestScope + " (" + instance + ") "\r
-                                       + "already has a request being worked with a status of " + dup.getProgress() + " (ServiceId - "\r
-                                       + dup.getServiceId() + "). The existing request must finish or be cleaned up before proceeding.";\r
-\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,\r
-                                       MsoException.ServiceException, dupMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);\r
-\r
-                       msoLogger.warn(MessageEnum.APIH_DUPLICATE_FOUND, dupMessage, "", "", MsoLogger.ErrorCode.SchemaError,\r
-                                       "Duplicate request - Subscriber already has a request for this service");\r
-                       \r
-                       \r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,\r
-                                       dupMessage);\r
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return response;\r
-               }\r
-               \r
-               CatalogDatabase db = null;\r
-               RecipeLookupResult recipeLookupResult = null;\r
-               try {\r
-                       db = CatalogDatabase.getInstance();\r
-                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, e2eSir.getService().getServiceUuid(), action);\r
-               } catch (Exception e) {\r
-                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);\r
-                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,\r
-                                       MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,\r
-                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));\r
-                       \r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,\r
-                                       "Exception while communciate with DB");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return response;\r
-               } finally {\r
-                       closeCatalogDB(db);\r
-               }\r
-\r
-               if (recipeLookupResult == null) {\r
-                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");\r
-                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
-                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,\r
-                                       MsoException.ServiceException, "Recipe does not exist in catalog DB",\r
-                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);\r
-               \r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,\r
-                                       "No recipe found in DB");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return response;\r
-               }\r
-//             try {\r
-//                     msoRequest.createRequestRecord(Status.PENDING, action);\r
-//                     //createOperationStatusRecord(action, requestId);\r
-//             } catch (Exception e) {\r
-//                     msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "",\r
-//                                     MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e);\r
-//                     msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
-//                     Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,\r
-//                                     MsoException.ServiceException, "Exception while creating record in DB " + e.getMessage(),\r
-//                                     ErrorNumbers.SVC_BAD_PARAMETER, null);\r
-//                     msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,\r
-//                                     "Exception while creating record in DB");\r
-//                     msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());\r
-//                     return response;\r
-//             }\r
-\r
-               String serviceInstanceType = e2eSir.getService().getServiceType();\r
-\r
-               String serviceId = "";\r
-               RequestClient requestClient = null;\r
-               HttpResponse response = null;\r
-\r
-               long subStartTime = System.currentTimeMillis();\r
-               String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
-\r
-               try {\r
-                       requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),\r
-                                       MsoPropertiesUtils.loadMsoProperties());\r
-\r
-                       // Capture audit event\r
-                       msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());\r
-\r
-                       response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),\r
-                                       serviceId, null, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson,\r
-                                       recipeLookupResult.getRecipeParamXsd());\r
-\r
-                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,\r
-                                       "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),\r
-                                       null);\r
-               } catch (Exception e) {\r
-                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,\r
-                                       MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",\r
-                                       recipeLookupResult.getOrchestrationURI(), null);\r
-                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,\r
-                                       MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),\r
-                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,\r
-                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));\r
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,\r
-                                       "Exception while communicate with BPMN engine");\r
-                       msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity());\r
-                       createOperationStatusRecordForError(action, requestId);\r
-                       return resp;\r
-               }\r
-\r
-               if (response == null) {\r
-                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,\r
-                                       MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                                       MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");\r
-                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,\r
-                                       "Null response from BPMN");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());\r
-                       return resp;\r
-               }\r
-\r
-               ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());\r
-               int bpelStatus = respHandler.getStatus();\r
-\r
-               return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);\r
-       }\r
-\r
-   private Response scaleE2EserviceInstances(String requestJSON,\r
-                                               Action action, HashMap<String, String> instanceIdMap, String version) {\r
-\r
-        String requestId = instanceIdMap.get("serviceId");\r
-        long startTime = System.currentTimeMillis();\r
-        msoLogger.debug("requestId is: " + requestId);\r
-               E2EServiceInstanceScaleRequest e2eScaleReq = null;\r
-\r
-        MsoRequest msoRequest = new MsoRequest(requestId);\r
-\r
-        ObjectMapper mapper = new ObjectMapper();\r
-        try {\r
-               e2eScaleReq = mapper.readValue(requestJSON,\r
-                                       E2EServiceInstanceScaleRequest.class);\r
-\r
-        } catch (Exception e) {\r
-\r
-            msoLogger.debug("Mapping of request to JSON object failed : ", e);\r
-            Response response = msoRequest.buildServiceErrorResponse(\r
-                    HttpStatus.SC_BAD_REQUEST,\r
-                    MsoException.ServiceException,\r
-                    "Mapping of request to JSON object failed.  "\r
-                            + e.getMessage(), ErrorNumbers.SVC_BAD_PARAMETER,\r
-                    null);\r
-            msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR,\r
-                    MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                    MsoLogger.ErrorCode.SchemaError, requestJSON, e);\r
-            msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                    MsoLogger.ResponseCode.SchemaError,\r
-                    "Mapping of request to JSON object failed");\r
-            msoLogger.debug("End of the transaction, the final response is: "\r
-                    + (String) response.getEntity());\r
-            createOperationStatusRecordForError(action, requestId);\r
-            return response;\r
-        }\r
-\r
-        CatalogDatabase db = null;\r
-        RecipeLookupResult recipeLookupResult = null;\r
-        try {\r
-            db = CatalogDatabase.getInstance();\r
-                       //TODO  Get the service template model version uuid from AAI.\r
-                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, null, action);\r
-        } catch (Exception e) {\r
-            msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC,\r
-                    MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                    MsoLogger.ErrorCode.AvailabilityError,\r
-                    "Exception while communciate with Catalog DB", e);\r
-            msoRequest\r
-                    .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
-            Response response = msoRequest.buildServiceErrorResponse(\r
-                    HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,\r
-                    "No communication to catalog DB " + e.getMessage(),\r
-                    ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-            alarmLogger.sendAlarm("MsoDatabaseAccessError",\r
-                    MsoAlarmLogger.CRITICAL, Messages.errors\r
-                            .get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));\r
-            msoRequest.createRequestRecord(Status.FAILED, action);\r
-            msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                    MsoLogger.ResponseCode.DBAccessError,\r
-                    "Exception while communciate with DB");\r
-            msoLogger.debug(END_OF_THE_TRANSACTION\r
-                    + (String) response.getEntity());\r
-            return response;\r
-        } finally {\r
-            closeCatalogDB(db);\r
-        }\r
-        if (recipeLookupResult == null) {\r
-            msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,\r
-                    MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                    MsoLogger.ErrorCode.DataError, "No recipe found in DB");\r
-            msoRequest\r
-                    .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);\r
-            Response response = msoRequest.buildServiceErrorResponse(\r
-                    HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,\r
-                    "Recipe does not exist in catalog DB",\r
-                    ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);\r
-            msoRequest.createRequestRecord(Status.FAILED, action);\r
-            msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                    MsoLogger.ResponseCode.DataNotFound,\r
-                    "No recipe found in DB");\r
-            msoLogger.debug(END_OF_THE_TRANSACTION\r
-                    + (String) response.getEntity());\r
-            createOperationStatusRecordForError(action, requestId);\r
-            return response;\r
-        }\r
-\r
-        RequestClient requestClient = null;\r
-        HttpResponse response = null;\r
-\r
-        long subStartTime = System.currentTimeMillis();\r
-        // String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);\r
-\r
-        try {\r
-            requestClient = RequestClientFactory.getRequestClient(\r
-                    recipeLookupResult.getOrchestrationURI(),\r
-                    MsoPropertiesUtils.loadMsoProperties());\r
-\r
-            JSONObject jjo = new JSONObject(requestJSON);\r
-            jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));\r
-\r
-            String bpmnRequest = jjo.toString();\r
-\r
-            // Capture audit event\r
-            msoLogger\r
-                    .debug("MSO API Handler Posting call to BPEL engine for url: "\r
-                            + requestClient.getUrl());\r
-            String serviceId = instanceIdMap.get("serviceId");\r
-            String serviceInstanceType = e2eScaleReq.getService().getServiceType();\r
-            response = requestClient.post(requestId, false,\r
-                                       recipeLookupResult.getRecipeTimeout(), action.name(),\r
-                                       serviceId, null, null, null, null, null, serviceInstanceType,\r
-                                       null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());\r
-\r
-            msoLogger.recordMetricEvent(subStartTime,\r
-                    MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,\r
-                    "Successfully received response from BPMN engine", "BPMN",\r
-                    recipeLookupResult.getOrchestrationURI(), null);\r
-        } catch (Exception e) {\r
-            msoLogger.recordMetricEvent(subStartTime,\r
-                    MsoLogger.StatusCode.ERROR,\r
-                    MsoLogger.ResponseCode.CommunicationError,\r
-                    "Exception while communicate with BPMN engine", "BPMN",\r
-                    recipeLookupResult.getOrchestrationURI(), null);\r
-            Response resp = msoRequest.buildServiceErrorResponse(\r
-                    HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,\r
-                    "Failed calling bpmn " + e.getMessage(),\r
-                    ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-            alarmLogger.sendAlarm("MsoConfigurationError",\r
-                    MsoAlarmLogger.CRITICAL,\r
-                    Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));\r
-            msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,\r
-                    MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                    MsoLogger.ErrorCode.AvailabilityError,\r
-                    "Exception while communicate with BPMN engine");\r
-            msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                    MsoLogger.ResponseCode.CommunicationError,\r
-                    "Exception while communicate with BPMN engine");\r
-            msoLogger.debug("End of the transaction, the final response is: "\r
-                    + (String) resp.getEntity());\r
-            createOperationStatusRecordForError(action, requestId);\r
-            return resp;\r
-        }\r
-\r
-        if (response == null) {\r
-            Response resp = msoRequest.buildServiceErrorResponse(\r
-                    HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,\r
-                    "bpelResponse is null",\r
-                    ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);\r
-            msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,\r
-                    MSO_PROP_APIHANDLER_INFRA, "", "",\r
-                    MsoLogger.ErrorCode.BusinessProcesssError,\r
-                    "Null response from BPEL");\r
-            msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,\r
-                    MsoLogger.ResponseCode.InternalError,\r
-                    "Null response from BPMN");\r
-            msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());\r
-            createOperationStatusRecordForError(action, requestId);\r
-            return resp;\r
-        }\r
-\r
-        ResponseHandler respHandler = new ResponseHandler(response,\r
-                requestClient.getType());\r
-        int bpelStatus = respHandler.getStatus();\r
-\r
-        return beplStatusUpdate(requestId, startTime, msoRequest,\r
-                requestClient, respHandler, bpelStatus, action, instanceIdMap);\r
-    }\r
-\r
-       private void closeCatalogDB(CatalogDatabase db) {\r
-               if (db != null) {\r
-                       db.close();\r
-               }\r
-       }\r
-\r
-       private Response beplStatusUpdate(String requestId, long startTime,\r
-                       MsoRequest msoRequest, RequestClient requestClient,\r
-                       ResponseHandler respHandler, int bpelStatus, Action action,\r
-                       HashMap<String, String> instanceIdMap) {\r
-               // BPMN accepted the request, the request is in progress\r
-               if (bpelStatus == HttpStatus.SC_ACCEPTED) {\r
-                       String camundaJSONResponseBody = respHandler.getResponseBody();\r
-                       msoLogger.debug("Received from Camunda: " + camundaJSONResponseBody);\r
-\r
-                       // currently only for delete case we update the status here\r
-                       if (action == Action.deleteInstance) {\r
-                               ObjectMapper mapper = new ObjectMapper();\r
-                               try {\r
-                                       DelE2ESvcResp jo = mapper.readValue(\r
-                                                       camundaJSONResponseBody, DelE2ESvcResp.class);\r
-                                       String operationId = jo.getOperationId();\r
-                               this.createOperationStatusRecord("DELETE", requestId,\r
-                                                               operationId);\r
-                               } catch (Exception ex) {\r
-                                       msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,\r
-                                                       requestClient.getUrl(), "", "",\r
-                                                       MsoLogger.ErrorCode.BusinessProcesssError,\r
-                                                       "Response from BPEL engine is failed with HTTP Status="\r
-                                                                       + bpelStatus);\r
-                               }\r
-                       }\r
-                       \r
-                       msoLogger.recordAuditEvent(startTime,\r
-                                       MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,\r
-                                       "BPMN accepted the request, the request is in progress");\r
-                       msoLogger.debug(END_OF_THE_TRANSACTION + camundaJSONResponseBody);\r
-                       return Response.status(HttpStatus.SC_ACCEPTED)\r
-                                       .entity(camundaJSONResponseBody).build();\r
-               } else {\r
-                       List<String> variables = new ArrayList<>();\r
-                       variables.add(bpelStatus + "");\r
-                       String camundaJSONResponseBody = respHandler.getResponseBody();\r
-                       if (camundaJSONResponseBody != null\r
-                                       && !camundaJSONResponseBody.isEmpty()) {\r
-                               Response resp = msoRequest.buildServiceErrorResponse(\r
-                                               bpelStatus, MsoException.ServiceException,\r
-                                               "Request Failed due to BPEL error with HTTP Status= %1 "\r
-                                                               + '\n' + camundaJSONResponseBody,\r
-                                               ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables);\r
-                               msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,\r
-                                               requestClient.getUrl(), "", "",\r
-                                               MsoLogger.ErrorCode.BusinessProcesssError,\r
-                                               "Response from BPEL engine is failed with HTTP Status="\r
-                                                               + bpelStatus);\r
-                               msoLogger.recordAuditEvent(startTime,\r
-                                               MsoLogger.StatusCode.ERROR,\r
-                                               MsoLogger.ResponseCode.InternalError,\r
-                                               "Response from BPMN engine is failed");\r
-                               msoLogger.debug(END_OF_THE_TRANSACTION\r
-                                               + (String) resp.getEntity());\r
-                               return resp;\r
-                       } else {\r
-                               Response resp = msoRequest\r
-                                               .buildServiceErrorResponse(\r
-                                                               bpelStatus,\r
-                                                               MsoException.ServiceException,\r
-                                                               "Request Failed due to BPEL error with HTTP Status= %1",\r
-                                                               ErrorNumbers.SVC_DETAILED_SERVICE_ERROR,\r
-                                                               variables);\r
-                               msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,\r
-                                               requestClient.getUrl(), "", "",\r
-                                               MsoLogger.ErrorCode.BusinessProcesssError,\r
-                                               "Response from BPEL engine is empty");\r
-                               msoLogger.recordAuditEvent(startTime,\r
-                                               MsoLogger.StatusCode.ERROR,\r
-                                               MsoLogger.ResponseCode.InternalError,\r
-                                               "Response from BPEL engine is empty");\r
-                               msoLogger.debug(END_OF_THE_TRANSACTION\r
-                                               + (String) resp.getEntity());\r
-                               return resp;\r
-                       }\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Getting recipes from catalogDb\r
-        * \r
-        * @param db the catalog db\r
-        * @param serviceModelUUID the service model version uuid\r
-        * @param action the action for the service\r
-        * @return the service recipe result\r
-        */\r
-       private RecipeLookupResult getServiceInstanceOrchestrationURI(\r
-                       CatalogDatabase db, String serviceModelUUID, Action action) {\r
-\r
-               RecipeLookupResult recipeLookupResult = getServiceURI(db, serviceModelUUID, action);\r
-\r
-               if (recipeLookupResult != null) {\r
-                       msoLogger.debug("Orchestration URI is: "\r
-                                       + recipeLookupResult.getOrchestrationURI()\r
-                                       + ", recipe Timeout is: "\r
-                                       + Integer.toString(recipeLookupResult.getRecipeTimeout()));\r
-               } else {\r
-                       msoLogger.debug("No matching recipe record found");\r
-               }\r
-               return recipeLookupResult;\r
-       }\r
-\r
-       /**\r
-        * Getting recipes from catalogDb\r
-        * If Service recipe is not set, use default recipe, if set , use special recipe.\r
-        * @param db the catalog db\r
-        * @param serviceModelUUID the service version uuid\r
-        * @param action the action of the service.\r
-        * @return the service recipe result.\r
-        */\r
-       private RecipeLookupResult getServiceURI(CatalogDatabase db, String serviceModelUUID, Action action) {\r
-\r
-               String defaultServiceModelName = "UUI_DEFAULT";\r
-\r
-               Service defaultServiceRecord = db\r
-                               .getServiceByModelName(defaultServiceModelName);\r
-               ServiceRecipe defaultRecipe = db.getServiceRecipeByModelUUID(\r
-                       defaultServiceRecord.getModelUUID(), action.name());\r
-               //set recipe as default generic recipe\r
-               ServiceRecipe recipe = defaultRecipe;\r
-               //check the service special recipe \r
-               if(null != serviceModelUUID && ! serviceModelUUID.isEmpty()){\r
-                     ServiceRecipe serviceSpecialRecipe = db.getServiceRecipeByModelUUID(\r
-                             serviceModelUUID, action.name());\r
-                     if(null != serviceSpecialRecipe){\r
-                         //set service special recipe.\r
-                         recipe = serviceSpecialRecipe;\r
-                     }\r
-               }       \r
-               \r
-               if (recipe == null) {\r
-                       return null;\r
-               }\r
-               return new RecipeLookupResult(recipe.getOrchestrationUri(),\r
-                               recipe.getRecipeTimeout(), recipe.getServiceParamXSD());\r
-\r
-       }\r
-\r
-       /**\r
-        * Converting E2EServiceInstanceRequest to ServiceInstanceRequest and\r
-        * passing it to camunda engine.\r
-        * \r
-        * @param e2eSir\r
-        * @return\r
-        */\r
-       private String mapReqJsonToSvcInstReq(E2EServiceInstanceRequest e2eSir,\r
-                       String requestJSON) {\r
-\r
-               sir = new ServiceInstancesRequest();\r
-\r
-               String returnString = null;\r
-               RequestDetails requestDetails = new RequestDetails();\r
-               ModelInfo modelInfo = new ModelInfo();\r
-\r
-               // ModelInvariantId\r
-               modelInfo.setModelInvariantId(e2eSir.getService().getServiceInvariantUuid());\r
-\r
-               // modelNameVersionId\r
-               modelInfo.setModelNameVersionId(e2eSir.getService().getServiceUuid());\r
-\r
-               // String modelInfoValue =\r
-               // e2eSir.getService().getParameters().getNodeTemplateName();\r
-               // String[] arrayOfInfo = modelInfoValue.split(":");\r
-               // String modelName = arrayOfInfo[0];\r
-               // String modelVersion = arrayOfInfo[1];\r
-\r
-               // TODO: To ensure, if we dont get the values from the UUI\r
-               String modelName = "voLTE";\r
-               String modelVersion = "1.0";\r
-               // modelName\r
-               modelInfo.setModelName(modelName);\r
-\r
-               // modelVersion\r
-               modelInfo.setModelVersion(modelVersion);\r
-\r
-               // modelType\r
-               modelInfo.setModelType(ModelType.service);\r
-\r
-               // setting modelInfo to requestDetails\r
-               requestDetails.setModelInfo(modelInfo);\r
-\r
-               SubscriberInfo subscriberInfo = new SubscriberInfo();\r
-\r
-               // globalsubscriberId\r
-               subscriberInfo.setGlobalSubscriberId(e2eSir.getService().getGlobalSubscriberId());\r
-\r
-               // setting subscriberInfo to requestDetails\r
-               requestDetails.setSubscriberInfo(subscriberInfo);\r
-\r
-               RequestInfo requestInfo = new RequestInfo();\r
-\r
-               // instanceName\r
-               requestInfo.setInstanceName(e2eSir.getService().getName());\r
-\r
-               // source\r
-               requestInfo.setSource("UUI");\r
-\r
-               // suppressRollback\r
-               requestInfo.setSuppressRollback(true);\r
-\r
-               // setting requestInfo to requestDetails\r
-               requestDetails.setRequestInfo(requestInfo);\r
-\r
-               RequestParameters requestParameters = new RequestParameters();\r
-\r
-               // subscriptionServiceType\r
-               requestParameters.setSubscriptionServiceType("MOG");\r
-\r
-               // Userparams\r
-               List<E2EUserParam> userParams;\r
-               // userParams =\r
-               // e2eSir.getService().getParameters().getRequestParameters().getUserParams();\r
-               List<Map<String, Object>> userParamList = new ArrayList<>();\r
-               Map<String, Object> userParamMap = new HashMap<>();\r
-               // complete json request updated in the camunda\r
-               userParamMap.put("UUIRequest", requestJSON);\r
-               userParamMap.put("ServiceInstanceName", e2eSir.getService().getName());\r
-\r
-               // Map<String, String> userParamMap3 = null;\r
-               // for (E2EUserParam userp : userParams) {\r
-               // userParamMap.put(userp.getName(), userp.getValue());\r
-               //\r
-               // }\r
-               userParamList.add(userParamMap);\r
-               requestParameters.setUserParams(userParamList);\r
-\r
-               // setting requestParameters to requestDetails\r
-               requestDetails.setRequestParameters(requestParameters);\r
-\r
-               sir.setRequestDetails(requestDetails);\r
-\r
-               // converting to string\r
-               ObjectMapper mapper = new ObjectMapper();\r
-               try {\r
-                       returnString = mapper.writeValueAsString(sir);\r
-               } catch (IOException e) {\r
-                       msoLogger\r
-                                       .debug("Exception while converting ServiceInstancesRequest object to string",\r
-                                                       e);\r
-               }\r
-\r
-               return returnString;\r
-       }\r
-\r
-       private void createOperationStatusRecordForError(Action action,\r
-                       String requestId) throws MsoDatabaseException {\r
-\r
-               AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();\r
-\r
-               Session session = null;\r
-               try {\r
-\r
-                       session = requestsDbSessionFactoryManager.getSessionFactory()\r
-                                       .openSession();\r
-                       session.beginTransaction();\r
-\r
-                       OperationStatus os = new OperationStatus();\r
-                       os.setOperation(action.name());\r
-                       os.setOperationContent("");\r
-                       os.setOperationId("");\r
-                       os.setProgress("100");\r
-                       os.setReason("");\r
-                       os.setResult("error");\r
-                       os.setServiceId(requestId);\r
-                       os.setUserId("");\r
-                       Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());\r
-                       Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());\r
-                       os.setFinishedAt(endTimeStamp);\r
-                       os.setOperateAt(startTimeStamp);\r
-\r
-                       session.save(os);\r
-                       session.getTransaction().commit();\r
-\r
-               } catch (Exception e) {\r
-                       msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",\r
-                                       MsoLogger.ErrorCode.DataError,\r
-                                       "Exception when creation record request in Operation", e);\r
-                       throw new MsoDatabaseException(\r
-                                       "Data did inserted in Operatus Status Table for failure", e);\r
-               } finally {\r
-                       if (null != session) {\r
-                               session.close();\r
-                       }\r
-               }\r
-       }\r
-\r
-       private void createOperationStatusRecord(String actionNm, String serviceId,\r
-                       String operationId) throws MsoDatabaseException {\r
-\r
-               AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();\r
-\r
-               Session session = null;\r
-               try {\r
-\r
-                       session = requestsDbSessionFactoryManager.getSessionFactory()\r
-                                       .openSession();\r
-                       session.beginTransaction();\r
-\r
-                       OperationStatus os = new OperationStatus();\r
-                       os.setOperation(actionNm);\r
-                       os.setOperationContent("");\r
-                       os.setOperationId(operationId);\r
-                       os.setProgress("0");\r
-                       os.setReason("");\r
-                       os.setResult("processing");\r
-                       os.setServiceId(serviceId);\r
-                       // TODO : to be updated...\r
-                       os.setUserId("");\r
-                       Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());\r
-                       Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());\r
-                       os.setFinishedAt(endTimeStamp);\r
-                       os.setOperateAt(startTimeStamp);\r
-\r
-                       session.save(os);\r
-                       session.getTransaction().commit();\r
-\r
-               } catch (Exception e) {\r
-                       msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",\r
-                                       MsoLogger.ErrorCode.DataError,\r
-                                       "Exception when creation record request in Operation", e);\r
-                       throw new MsoDatabaseException(\r
-                                       "Data did inserted in Operatus Status Table", e);\r
-               } finally {\r
-                       if (null != session) {\r
-                               session.close();\r
-                       }\r
-               }\r
-       }\r
-\r
-       private OperationStatus chkSvcInstOperStatusbySvcId(String serviceId) {\r
-               OperationStatus svcInstanceOperStatus = (RequestsDatabase.getInstance())\r
-                               .getOperationStatusByServiceId(serviceId);\r
-\r
-               return svcInstanceOperStatus;\r
-       }\r
-\r
-       private OperationStatus chkDuplicateServiceNameInOperStatus(\r
-                       String serviceName) {\r
-               OperationStatus dupServiceName = (RequestsDatabase.getInstance())\r
-                               .getOperationStatusByServiceName(serviceName);\r
-\r
-               return dupServiceName;\r
-       }\r
-}\r
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.apihandlerinfra;
+
+import java.io.IOException;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.hibernate.Session;
+import org.json.JSONObject;
+import org.openecomp.mso.apihandler.common.ErrorNumbers;
+import org.openecomp.mso.apihandler.common.RequestClient;
+import org.openecomp.mso.apihandler.common.RequestClientFactory;
+import org.openecomp.mso.apihandler.common.ResponseHandler;
+import org.openecomp.mso.apihandlerinfra.Messages;
+import org.openecomp.mso.apihandlerinfra.MsoException;
+import org.openecomp.mso.apihandlerinfra.MsoRequest;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.CompareModelsRequest;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.DelE2ESvcResp;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceDeleteRequest;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EServiceInstanceRequest;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.E2EUserParam;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.GetE2EServiceInstanceResponse;
+import org.openecomp.mso.apihandlerinfra.e2eserviceinstancebeans.*;
+import org.openecomp.mso.serviceinstancebeans.ModelInfo;
+import org.openecomp.mso.serviceinstancebeans.ModelType;
+import org.openecomp.mso.serviceinstancebeans.RequestDetails;
+import org.openecomp.mso.serviceinstancebeans.RequestInfo;
+import org.openecomp.mso.serviceinstancebeans.RequestParameters;
+import org.openecomp.mso.serviceinstancebeans.ServiceInstancesRequest;
+import org.openecomp.mso.serviceinstancebeans.SubscriberInfo;
+import org.openecomp.mso.db.AbstractSessionFactoryManager;
+import org.openecomp.mso.db.catalog.CatalogDatabase;
+import org.openecomp.mso.db.catalog.beans.Service;
+import org.openecomp.mso.db.catalog.beans.ServiceRecipe;
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoAlarmLogger;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.properties.MsoDatabaseException;
+import org.openecomp.mso.requestsdb.OperationStatus;
+import org.openecomp.mso.requestsdb.RequestsDatabase;
+import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager;
+import org.openecomp.mso.utils.UUIDChecker;
+
+import com.wordnik.swagger.annotations.Api;
+import com.wordnik.swagger.annotations.ApiOperation;
+
+@Path("/e2eServiceInstances")
+@Api(value = "/e2eServiceInstances", description = "API Requests for E2E Service Instances")
+public class E2EServiceInstances {
+
+       private HashMap<String, String> instanceIdMap = new HashMap<>();
+       private static MsoLogger msoLogger = MsoLogger
+                       .getMsoLogger(MsoLogger.Catalog.APIH);
+       private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger();
+       public static final String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA";
+       private ServiceInstancesRequest sir = null;
+
+       public static final String END_OF_THE_TRANSACTION = "End of the transaction, the final response is: ";
+       public static final String EXCEPTION_CREATING_DB_RECORD = "Exception while creating record in DB";
+       public static final String EXCEPTION_COMMUNICATE_BPMN_ENGINE = "Exception while communicate with BPMN engine";
+
+       /**
+        * POST Requests for E2E Service create Instance on a version provided
+        */
+
+       @POST
+       @Path("/{version:[vV][3-5]}")
+       @Consumes(MediaType.APPLICATION_JSON)
+       @Produces(MediaType.APPLICATION_JSON)
+       @ApiOperation(value = "Create an E2E Service Instance on a version provided", response = Response.class)
+       public Response createE2EServiceInstance(String request,
+                       @PathParam("version") String version) {
+
+               return processE2EserviceInstances(request, Action.createInstance, null,
+                               version);
+       }
+       
+       /**
+        * PUT Requests for E2E Service update Instance on a version provided
+        */
+
+       @PUT
+       @Path("/{version:[vV][3-5]}/{serviceId}")
+       @Consumes(MediaType.APPLICATION_JSON)
+       @Produces(MediaType.APPLICATION_JSON)
+       @ApiOperation(value = "Update an E2E Service Instance on a version provided and serviceId", response = Response.class)
+       public Response updateE2EServiceInstance(String request,
+                       @PathParam("version") String version,
+                       @PathParam("serviceId") String serviceId) {
+               
+               instanceIdMap.put("serviceId", serviceId);
+
+               return updateE2EserviceInstances(request, Action.updateInstance, instanceIdMap,
+                               version);
+       }
+
+       /**
+        * DELETE Requests for E2E Service delete Instance on a specified version
+        * and serviceId
+        */
+
+       @DELETE
+       @Path("/{version:[vV][3-5]}/{serviceId}")
+       @Consumes(MediaType.APPLICATION_JSON)
+       @Produces(MediaType.APPLICATION_JSON)
+       @ApiOperation(value = "Delete E2E Service Instance on a specified version and serviceId", response = Response.class)
+       public Response deleteE2EServiceInstance(String request,
+                       @PathParam("version") String version,
+                       @PathParam("serviceId") String serviceId) {
+
+               instanceIdMap.put("serviceId", serviceId);
+
+               return deleteE2EserviceInstances(request, Action.deleteInstance,
+                               instanceIdMap, version);
+       }
+
+       @GET
+       @Path("/{version:[vV][3-5]}/{serviceId}/operations/{operationId}")
+       @ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId", response = Response.class)
+       @Produces(MediaType.APPLICATION_JSON)
+       public Response getE2EServiceInstances(
+                       @PathParam("serviceId") String serviceId,
+                       @PathParam("version") String version,
+                       @PathParam("operationId") String operationId) {
+               return getE2EServiceInstances(serviceId, operationId);
+       }
+       
+    /**
+        * Scale Requests for E2E Service scale Instance on a specified version 
+     */
+        
+       @POST
+       @Path("/{version:[vV][3-5]}/{serviceId}/scale")
+       @Consumes(MediaType.APPLICATION_JSON)
+       @Produces(MediaType.APPLICATION_JSON)
+       @ApiOperation(value="Scale E2E Service Instance on a specified version",response=Response.class)
+       public Response scaleE2EServiceInstance(String request,
+                                            @PathParam("version") String version,
+                                            @PathParam("serviceId") String serviceId) {
+
+               msoLogger.debug("------------------scale begin------------------");
+               instanceIdMap.put("serviceId", serviceId);
+               return scaleE2EserviceInstances(request, Action.scaleInstance, instanceIdMap, version);
+       }
+       /**
+        * GET Requests for Comparing model of service instance with target version
+        */
+       
+       @POST
+       @Path("/{version:[vV][3-5]}/{serviceId}/modeldifferences")
+       @Consumes(MediaType.APPLICATION_JSON)
+       @Produces(MediaType.APPLICATION_JSON)
+       @ApiOperation(value = "Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId ", response = Response.class)
+       public Response compareModelwithTargetVersion(String request,
+                       @PathParam("serviceId") String serviceId,
+                       @PathParam("version") String version) {
+               
+               instanceIdMap.put("serviceId", serviceId);
+               
+               return compareModelwithTargetVersion(request, Action.compareModel, instanceIdMap, version);
+       }       
+
+       private Response compareModelwithTargetVersion(String requestJSON, Action action,
+                       HashMap<String, String> instanceIdMap, String version) {
+
+               String requestId = instanceIdMap.get("serviceId");
+               long startTime = System.currentTimeMillis();
+               msoLogger.debug("requestId is: " + requestId);
+
+               CompareModelsRequest e2eCompareModelReq = null;
+
+               MsoRequest msoRequest = new MsoRequest(requestId);
+
+               ObjectMapper mapper = new ObjectMapper();
+               try {
+                       e2eCompareModelReq = mapper.readValue(requestJSON, CompareModelsRequest.class);
+
+               } catch (Exception e) {
+
+                       msoLogger.debug("Mapping of request to JSON object failed : ", e);
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+                                       MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),
+                                       ErrorNumbers.SVC_BAD_PARAMETER, null);
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+                                       "Mapping of request to JSON object failed");
+                       msoLogger.debug("End of the transaction, the final response is: " + response.getEntity().toString());
+
+                       return response;
+               }
+
+               Response returnResp = runCompareModelBPMWorkflow(e2eCompareModelReq, msoRequest, requestJSON, requestId,
+                               startTime, action);
+
+               return returnResp;
+
+       }
+
+       private Response runCompareModelBPMWorkflow(CompareModelsRequest e2eCompareModelReq, MsoRequest msoRequest,
+                       String requestJSON, String requestId, long startTime, Action action) {
+               
+               // Define RecipeLookupResult info here instead of query DB for efficiency
+               String workflowUrl = "/mso/async/services/CompareModelofE2EServiceInstance";
+               int recipeTimeout = 180;
+
+               RequestClient requestClient = null;
+               HttpResponse response = null;
+
+               long subStartTime = System.currentTimeMillis();
+
+               try {
+                       requestClient = RequestClientFactory.getRequestClient(workflowUrl, MsoPropertiesUtils.loadMsoProperties());
+
+                       JSONObject jjo = new JSONObject(requestJSON);
+                       String bpmnRequest = jjo.toString();
+
+                       // Capture audit event
+                       msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
+                       String serviceId = instanceIdMap.get("serviceId");
+                       String serviceType = e2eCompareModelReq.getServiceType();
+                       response = requestClient.post(requestId, false, recipeTimeout, action.name(), serviceId, null, null, null,
+                                       null, null, serviceType, null, null, null, bpmnRequest, null);
+
+                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                                       "Successfully received response from BPMN engine", "BPMN", workflowUrl, null);
+               } catch (Exception e) {
+                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",
+                                       workflowUrl, null);
+                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+                                       MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine",e);
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                                       "Exception while communicate with BPMN engine");
+                       msoLogger.debug("End of the transaction, the final response is: " + resp.getEntity().toString());
+                       return resp;
+               }
+
+               if (response == null) {
+                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+                                       MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
+                                       "Null response from BPMN");
+                       msoLogger.debug(END_OF_THE_TRANSACTION + resp.getEntity().toString());
+                       return resp;
+               }
+
+               ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
+               int bpelStatus = respHandler.getStatus();
+               // String responseBody = respHandler.getResponseBody();
+               // CompareModelsResult modelDiffResponse = new CompareModelsResult();
+
+               return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action,
+                               instanceIdMap);
+       }
+
+       private Response getE2EServiceInstances(String serviceId, String operationId) {
+               RequestsDatabase requestsDB = RequestsDatabase.getInstance();
+
+               GetE2EServiceInstanceResponse e2eServiceResponse = new GetE2EServiceInstanceResponse();
+
+               MsoRequest msoRequest = new MsoRequest(serviceId);
+
+               long startTime = System.currentTimeMillis();
+
+               OperationStatus operationStatus = null;
+
+               try {
+                       operationStatus = requestsDB.getOperationStatus(serviceId,
+                                       operationId);
+
+               } catch (Exception e) {
+                       msoLogger
+                                       .error(MessageEnum.APIH_DB_ACCESS_EXC,
+                                                       MSO_PROP_APIHANDLER_INFRA,
+                                                       "",
+                                                       "",
+                                                       MsoLogger.ErrorCode.AvailabilityError,
+                                                       "Exception while communciate with Request DB - Infra Request Lookup",
+                                                       e);
+                       msoRequest
+                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+                       Response response = msoRequest.buildServiceErrorResponse(
+                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
+                                       e.getMessage(),
+                                       ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB, null);
+                       alarmLogger.sendAlarm("MsoDatabaseAccessError",
+                                       MsoAlarmLogger.CRITICAL, Messages.errors
+                                                       .get(ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB));
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.DBAccessError,
+                                       "Exception while communciate with Request DB");
+                       msoLogger.debug("End of the transaction, the final response is: "
+                                       + (String) response.getEntity());
+                       return response;
+
+               }
+
+               if (operationStatus == null) {
+                       Response resp = msoRequest.buildServiceErrorResponse(
+                                       HttpStatus.SC_NO_CONTENT, MsoException.ServiceException,
+                                       "E2E serviceId " + serviceId + " is not found in DB",
+                                       ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.BusinessProcesssError,
+                                       "Null response from RequestDB when searching by serviceId");
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.DataNotFound,
+                                       "Null response from RequestDB when searching by serviceId");
+                       msoLogger.debug("End of the transaction, the final response is: "
+                                       + (String) resp.getEntity());
+                       return resp;
+
+               }
+
+               e2eServiceResponse.setOperationStatus(operationStatus);
+
+               return Response.status(200).entity(e2eServiceResponse).build();
+       }
+
+       private Response deleteE2EserviceInstances(String requestJSON,
+                       Action action, HashMap<String, String> instanceIdMap, String version) {
+               // TODO should be a new one or the same service instance Id
+               String requestId = instanceIdMap.get("serviceId");
+               long startTime = System.currentTimeMillis();
+               msoLogger.debug("requestId is: " + requestId);
+               E2EServiceInstanceDeleteRequest e2eDelReq = null;
+
+               MsoRequest msoRequest = new MsoRequest(requestId);
+
+               ObjectMapper mapper = new ObjectMapper();
+               try {
+                       e2eDelReq = mapper.readValue(requestJSON,
+                                       E2EServiceInstanceDeleteRequest.class);
+
+               } catch (Exception e) {
+
+                       msoLogger.debug("Mapping of request to JSON object failed : ", e);
+                       Response response = msoRequest.buildServiceErrorResponse(
+                                       HttpStatus.SC_BAD_REQUEST,
+                                       MsoException.ServiceException,
+                                       "Mapping of request to JSON object failed.  "
+                                                       + e.getMessage(), ErrorNumbers.SVC_BAD_PARAMETER,
+                                       null);
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR,
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.SchemaError,
+                                       "Mapping of request to JSON object failed");
+                       msoLogger.debug("End of the transaction, the final response is: "
+                                       + (String) response.getEntity());
+                       createOperationStatusRecordForError(action, requestId);
+                       return response;
+               }
+
+               CatalogDatabase db = null;
+               RecipeLookupResult recipeLookupResult = null;
+               try {
+                       db = CatalogDatabase.getInstance();
+                       //TODO  Get the service template model version uuid from AAI.
+                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, null, action);
+               } catch (Exception e) {
+                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC,
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.AvailabilityError,
+                                       "Exception while communciate with Catalog DB", e);
+                       msoRequest
+                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+                       Response response = msoRequest.buildServiceErrorResponse(
+                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
+                                       "No communication to catalog DB " + e.getMessage(),
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       alarmLogger.sendAlarm("MsoDatabaseAccessError",
+                                       MsoAlarmLogger.CRITICAL, Messages.errors
+                                                       .get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
+                       msoRequest.createRequestRecord(Status.FAILED, action);
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.DBAccessError,
+                                       "Exception while communciate with DB");
+                       msoLogger.debug(END_OF_THE_TRANSACTION
+                                       + (String) response.getEntity());
+                       return response;
+               } finally {
+                       closeCatalogDB(db);
+               }
+               if (recipeLookupResult == null) {
+                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+                       msoRequest
+                                       .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+                       Response response = msoRequest.buildServiceErrorResponse(
+                                       HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
+                                       "Recipe does not exist in catalog DB",
+                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
+                       msoRequest.createRequestRecord(Status.FAILED, action);
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.DataNotFound,
+                                       "No recipe found in DB");
+                       msoLogger.debug(END_OF_THE_TRANSACTION
+                                       + (String) response.getEntity());
+                       createOperationStatusRecordForError(action, requestId);
+                       return response;
+               }
+
+               RequestClient requestClient = null;
+               HttpResponse response = null;
+
+               long subStartTime = System.currentTimeMillis();
+               // String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
+               try {
+                       requestClient = RequestClientFactory.getRequestClient(
+                                       recipeLookupResult.getOrchestrationURI(),
+                                       MsoPropertiesUtils.loadMsoProperties());
+
+                       JSONObject jjo = new JSONObject(requestJSON);
+                       jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));
+
+                       String bpmnRequest = jjo.toString();
+
+                       // Capture audit event
+                       msoLogger
+                                       .debug("MSO API Handler Posting call to BPEL engine for url: "
+                                                       + requestClient.getUrl());
+                       String serviceId = instanceIdMap.get("serviceId");
+                       String serviceInstanceType = e2eDelReq.getServiceType();
+                       response = requestClient.post(requestId, false,
+                                       recipeLookupResult.getRecipeTimeout(), action.name(),
+                                       serviceId, null, null, null, null, null, serviceInstanceType,
+                                       null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());
+
+                       msoLogger.recordMetricEvent(subStartTime,
+                                       MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                                       "Successfully received response from BPMN engine", "BPMN",
+                                       recipeLookupResult.getOrchestrationURI(), null);
+               } catch (Exception e) {
+                       msoLogger.recordMetricEvent(subStartTime,
+                                       MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.CommunicationError,
+                                       "Exception while communicate with BPMN engine", "BPMN",
+                                       recipeLookupResult.getOrchestrationURI(), null);
+                       Response resp = msoRequest.buildServiceErrorResponse(
+                                       HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
+                                       "Failed calling bpmn " + e.getMessage(),
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       alarmLogger.sendAlarm("MsoConfigurationError",
+                                       MsoAlarmLogger.CRITICAL,
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.AvailabilityError,
+                                       "Exception while communicate with BPMN engine");
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.CommunicationError,
+                                       "Exception while communicate with BPMN engine");
+                       msoLogger.debug("End of the transaction, the final response is: "
+                                       + (String) resp.getEntity());
+                       createOperationStatusRecordForError(action, requestId);
+                       return resp;
+               }
+
+               if (response == null) {
+                       Response resp = msoRequest.buildServiceErrorResponse(
+                                       HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
+                                       "bpelResponse is null",
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
+                                       MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.BusinessProcesssError,
+                                       "Null response from BPEL");
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.InternalError,
+                                       "Null response from BPMN");
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
+                       createOperationStatusRecordForError(action, requestId);
+                       return resp;
+               }
+
+               ResponseHandler respHandler = new ResponseHandler(response,
+                               requestClient.getType());
+               int bpelStatus = respHandler.getStatus();
+
+               return beplStatusUpdate(requestId, startTime, msoRequest,
+                               requestClient, respHandler, bpelStatus, action, instanceIdMap);
+       }
+
+       private Response updateE2EserviceInstances(String requestJSON, Action action,
+                       HashMap<String, String> instanceIdMap, String version) {
+
+               String requestId = UUIDChecker.generateUUID(msoLogger);
+               long startTime = System.currentTimeMillis();
+               msoLogger.debug("requestId is: " + requestId);
+               E2EServiceInstanceRequest e2eSir = null;
+               String serviceId = instanceIdMap.get("serviceId");
+
+               MsoRequest msoRequest = new MsoRequest(requestId);
+               ObjectMapper mapper = new ObjectMapper();
+               try {
+                       e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);
+
+               } catch (Exception e) {
+          
+                       msoLogger.debug("Mapping of request to JSON object failed : ", e);
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+                                       MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),
+                                       ErrorNumbers.SVC_BAD_PARAMETER, null);
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+                                       "Mapping of request to JSON object failed");
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+                       return response;
+               }
+
+               mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+               sir.getRequestDetails().getRequestParameters().setaLaCarte(true);
+               try {
+                       msoRequest.parse(sir, instanceIdMap, action, version, requestJSON);
+               } catch (Exception e) {
+                       msoLogger.debug("Validation failed: ", e);
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+                                       MsoException.ServiceException, "Error parsing request.  " + e.getMessage(),
+                                       ErrorNumbers.SVC_BAD_PARAMETER, null);
+                       if (msoRequest.getRequestId() != null) {
+                               msoLogger.debug("Logging failed message to the database");
+                       }
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+                                       "Validation of the input request failed");
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+                       return response;
+               }
+               
+               //check for the current operation status
+//             Response resp = checkE2ESvcInstStatus(action, serviceId, startTime, msoRequest);
+//             if(resp != null && resp.getStatus() != 200) {
+//                     return resp;
+//             }
+               
+               CatalogDatabase db = null;
+               RecipeLookupResult recipeLookupResult = null;
+               try {
+                       db = CatalogDatabase.getInstance();
+                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, e2eSir.getService().getServiceUuid(), action);
+               } catch (Exception e) {
+                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);
+                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+                                       MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
+                       
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+                                       "Exception while communciate with DB");
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
+                       
+                       return response;
+               } finally {
+                       closeCatalogDB(db);
+               }
+
+               if (recipeLookupResult == null) {
+                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+                                       MsoException.ServiceException, "Recipe does not exist in catalog DB",
+                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
+               
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                                       "No recipe found in DB");
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
+
+                       return response;
+               }
+
+               String serviceInstanceType = e2eSir.getService().getServiceType();
+
+               RequestClient requestClient = null;
+               HttpResponse response = null;
+
+               long subStartTime = System.currentTimeMillis();
+               String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
+               try {
+                       requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),
+                                       MsoPropertiesUtils.loadMsoProperties());
+
+                       // Capture audit event
+                       msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
+
+                       response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),
+                                       serviceId, null, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson,
+                                       recipeLookupResult.getRecipeParamXsd());
+
+                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                                       "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
+                                       null);
+               } catch (Exception e) {
+                       msoLogger.debug("Exception while communicate with BPMN engine", e);
+                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",
+                                       recipeLookupResult.getOrchestrationURI(), null);
+                       Response getBPMNResp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+                                       MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                                       "Exception while communicate with BPMN engine");
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) getBPMNResp.getEntity());
+
+                       return getBPMNResp;
+               }
+
+               if (response == null) {
+                       Response getBPMNResp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+                                       MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
+                                       "Null response from BPMN");
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) getBPMNResp.getEntity());
+
+                       return getBPMNResp;
+               }
+
+               ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
+               int bpelStatus = respHandler.getStatus();
+
+               return beplStatusUpdate(serviceId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);
+       }
+
+       private Response checkE2ESvcInstStatus(Action action, String serviceId, long startTime, MsoRequest msoRequest) {
+               OperationStatus curStatus = null;
+//             String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();
+               String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();
+               try {
+                       if (!(serviceId == null && "service".equals(requestScope) && (action == Action.updateInstance))) {                          
+                               curStatus = chkSvcInstOperStatusbySvcId(serviceId);
+                       }
+               } catch (Exception e) {
+                       msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.DataError, "Error during current operation status check ", e);
+
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
+                                       MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+                                       "Error during current operation status check");
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+                       return response;
+               }
+
+               if (curStatus != null && curStatus.getResult() != null && curStatus.getResult().equalsIgnoreCase("processing")) {
+                       String chkMessage = "Error: Locked instance - This " + requestScope + " (" + serviceId + ") "
+                                       + "now being worked with a status of " + curStatus.getResult() 
+                                       + ". The latest workflow of instance must be finished or cleaned up.";
+
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,
+                                       MsoException.ServiceException, chkMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
+                                       chkMessage);
+
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+
+                       return response;
+               }
+               
+               return Response.status(200).entity(null).build();
+       }
+       
+       private Response processE2EserviceInstances(String requestJSON, Action action,
+                       HashMap<String, String> instanceIdMap, String version) {
+
+               String requestId = UUIDChecker.generateUUID(msoLogger);
+               long startTime = System.currentTimeMillis();
+               msoLogger.debug("requestId is: " + requestId);
+               E2EServiceInstanceRequest e2eSir = null;
+
+               MsoRequest msoRequest = new MsoRequest(requestId);
+               ObjectMapper mapper = new ObjectMapper();
+               try {
+                       e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);
+
+               } catch (Exception e) {
+          //TODO update the service name
+          this.createOperationStatusRecordForError(action, requestId);
+                 
+                       msoLogger.debug("Mapping of request to JSON object failed : ", e);
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+                                       MsoException.ServiceException, "Mapping of request to JSON object failed.  " + e.getMessage(),
+                                       ErrorNumbers.SVC_BAD_PARAMETER, null);
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+                                       "Mapping of request to JSON object failed");
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+                       return response;
+               }
+
+               mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+               sir.getRequestDetails().getRequestParameters().setaLaCarte(true);
+               try {
+                       msoRequest.parse(sir, instanceIdMap, action, version, requestJSON);
+               } catch (Exception e) {
+                       msoLogger.debug("Validation failed: ", e);
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_REQUEST,
+                                       MsoException.ServiceException, "Error parsing request.  " + e.getMessage(),
+                                       ErrorNumbers.SVC_BAD_PARAMETER, null);
+                       if (msoRequest.getRequestId() != null) {
+                               msoLogger.debug("Logging failed message to the database");
+                               //TODO update the service name
+                         this.createOperationStatusRecordForError(action, requestId);
+                       }
+                       msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.SchemaError,
+                                       "Validation of the input request failed");
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+                       return response;
+               }
+               
+               OperationStatus dup = null;
+               String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();
+               String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();
+               try {
+                       if (!(instanceName == null && "service".equals(requestScope)
+                                       && (action == Action.createInstance || action == Action.activateInstance))) {
+                         //TODO : Need to check for the duplicate record from the operation status,
+                         //TODO : commenting this check for unblocking current testing for now...  induces dead code...
+                               dup = chkDuplicateServiceNameInOperStatus( instanceName);
+                       }
+               } catch (Exception e) {
+                       msoLogger.error(MessageEnum.APIH_DUPLICATE_CHECK_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.DataError, "Error during duplicate check ", e);
+
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
+                                       MsoException.ServiceException, e.getMessage(), ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+                                       "Error during duplicate check");
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+                       return response;
+               }
+
+               if (dup != null) {
+                       // Found the duplicate record. Return the appropriate error.
+                       String instance = null;
+                       if (instanceName != null) {
+                               instance = instanceName;
+                       } else {
+                               instance = instanceIdMap.get(requestScope + "InstanceId");
+                       }
+                       String dupMessage = "Error: Locked instance - This " + requestScope + " (" + instance + ") "
+                                       + "already has a request being worked with a status of " + dup.getProgress() + " (ServiceId - "
+                                       + dup.getServiceId() + "). The existing request must finish or be cleaned up before proceeding.";
+
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_CONFLICT,
+                                       MsoException.ServiceException, dupMessage, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, null);
+
+                       msoLogger.warn(MessageEnum.APIH_DUPLICATE_FOUND, dupMessage, "", "", MsoLogger.ErrorCode.SchemaError,
+                                       "Duplicate request - Subscriber already has a request for this service");
+                       
+                       
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.Conflict,
+                                       dupMessage);
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+                       createOperationStatusRecordForError(action, requestId);
+                       return response;
+               }
+               
+               CatalogDatabase db = null;
+               RecipeLookupResult recipeLookupResult = null;
+               try {
+                       db = CatalogDatabase.getInstance();
+                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, e2eSir.getService().getServiceUuid(), action);
+               } catch (Exception e) {
+                       msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communciate with Catalog DB", e);
+                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+                                       MsoException.ServiceException, "No communication to catalog DB " + e.getMessage(),
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       alarmLogger.sendAlarm("MsoDatabaseAccessError", MsoAlarmLogger.CRITICAL,
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
+                       
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+                                       "Exception while communciate with DB");
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
+                       createOperationStatusRecordForError(action, requestId);
+                       return response;
+               } finally {
+                       closeCatalogDB(db);
+               }
+
+               if (recipeLookupResult == null) {
+                       msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+                       msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+                       Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_NOT_FOUND,
+                                       MsoException.ServiceException, "Recipe does not exist in catalog DB",
+                                       ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
+               
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DataNotFound,
+                                       "No recipe found in DB");
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) response.getEntity());
+                       createOperationStatusRecordForError(action, requestId);
+                       return response;
+               }
+//             try {
+//                     msoRequest.createRequestRecord(Status.PENDING, action);
+//                     //createOperationStatusRecord(action, requestId);
+//             } catch (Exception e) {
+//                     msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC_REASON, "Exception while creating record in DB", "", "",
+//                                     MsoLogger.ErrorCode.SchemaError, "Exception while creating record in DB", e);
+//                     msoRequest.setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+//                     Response response = msoRequest.buildServiceErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR,
+//                                     MsoException.ServiceException, "Exception while creating record in DB " + e.getMessage(),
+//                                     ErrorNumbers.SVC_BAD_PARAMETER, null);
+//                     msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError,
+//                                     "Exception while creating record in DB");
+//                     msoLogger.debug("End of the transaction, the final response is: " + (String) response.getEntity());
+//                     return response;
+//             }
+
+               String serviceInstanceType = e2eSir.getService().getServiceType();
+
+               String serviceId = "";
+               RequestClient requestClient = null;
+               HttpResponse response = null;
+
+               long subStartTime = System.currentTimeMillis();
+               String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
+               try {
+                       requestClient = RequestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI(),
+                                       MsoPropertiesUtils.loadMsoProperties());
+
+                       // Capture audit event
+                       msoLogger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
+
+                       response = requestClient.post(requestId, false, recipeLookupResult.getRecipeTimeout(), action.name(),
+                                       serviceId, null, null, null, null, null, serviceInstanceType, null, null, null, sirRequestJson,
+                                       recipeLookupResult.getRecipeParamXsd());
+
+                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                                       "Successfully received response from BPMN engine", "BPMN", recipeLookupResult.getOrchestrationURI(),
+                                       null);
+               } catch (Exception e) {
+                       msoLogger.recordMetricEvent(subStartTime, MsoLogger.StatusCode.ERROR,
+                                       MsoLogger.ResponseCode.CommunicationError, "Exception while communicate with BPMN engine", "BPMN",
+                                       recipeLookupResult.getOrchestrationURI(), null);
+                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+                                       MsoException.ServiceException, "Failed calling bpmn " + e.getMessage(),
+                                       ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       alarmLogger.sendAlarm("MsoConfigurationError", MsoAlarmLogger.CRITICAL,
+                                       Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.AvailabilityError, "Exception while communicate with BPMN engine");
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.CommunicationError,
+                                       "Exception while communicate with BPMN engine");
+                       msoLogger.debug("End of the transaction, the final response is: " + (String) resp.getEntity());
+                       createOperationStatusRecordForError(action, requestId);
+                       return resp;
+               }
+
+               if (response == null) {
+                       Response resp = msoRequest.buildServiceErrorResponse(HttpStatus.SC_BAD_GATEWAY,
+                                       MsoException.ServiceException, "bpelResponse is null", ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+                       msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR, MSO_PROP_APIHANDLER_INFRA, "", "",
+                                       MsoLogger.ErrorCode.BusinessProcesssError, "Null response from BPEL");
+                       msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.InternalError,
+                                       "Null response from BPMN");
+                       msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
+                       return resp;
+               }
+
+               ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
+               int bpelStatus = respHandler.getStatus();
+
+               return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);
+       }
+
+   private Response scaleE2EserviceInstances(String requestJSON,
+                                               Action action, HashMap<String, String> instanceIdMap, String version) {
+
+        String requestId = instanceIdMap.get("serviceId");
+        long startTime = System.currentTimeMillis();
+        msoLogger.debug("requestId is: " + requestId);
+               E2EServiceInstanceScaleRequest e2eScaleReq = null;
+
+        MsoRequest msoRequest = new MsoRequest(requestId);
+
+        ObjectMapper mapper = new ObjectMapper();
+        try {
+               e2eScaleReq = mapper.readValue(requestJSON,
+                                       E2EServiceInstanceScaleRequest.class);
+
+        } catch (Exception e) {
+
+            msoLogger.debug("Mapping of request to JSON object failed : ", e);
+            Response response = msoRequest.buildServiceErrorResponse(
+                    HttpStatus.SC_BAD_REQUEST,
+                    MsoException.ServiceException,
+                    "Mapping of request to JSON object failed.  "
+                            + e.getMessage(), ErrorNumbers.SVC_BAD_PARAMETER,
+                    null);
+            msoLogger.error(MessageEnum.APIH_REQUEST_VALIDATION_ERROR,
+                    MSO_PROP_APIHANDLER_INFRA, "", "",
+                    MsoLogger.ErrorCode.SchemaError, requestJSON, e);
+            msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.SchemaError,
+                    "Mapping of request to JSON object failed");
+            msoLogger.debug("End of the transaction, the final response is: "
+                    + (String) response.getEntity());
+            createOperationStatusRecordForError(action, requestId);
+            return response;
+        }
+
+        CatalogDatabase db = null;
+        RecipeLookupResult recipeLookupResult = null;
+        try {
+            db = CatalogDatabase.getInstance();
+                       //TODO  Get the service template model version uuid from AAI.
+                       recipeLookupResult = getServiceInstanceOrchestrationURI(db, null, action);
+        } catch (Exception e) {
+            msoLogger.error(MessageEnum.APIH_DB_ACCESS_EXC,
+                    MSO_PROP_APIHANDLER_INFRA, "", "",
+                    MsoLogger.ErrorCode.AvailabilityError,
+                    "Exception while communciate with Catalog DB", e);
+            msoRequest
+                    .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+            Response response = msoRequest.buildServiceErrorResponse(
+                    HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
+                    "No communication to catalog DB " + e.getMessage(),
+                    ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+            alarmLogger.sendAlarm("MsoDatabaseAccessError",
+                    MsoAlarmLogger.CRITICAL, Messages.errors
+                            .get(ErrorNumbers.NO_COMMUNICATION_TO_CATALOG_DB));
+            msoRequest.createRequestRecord(Status.FAILED, action);
+            msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.DBAccessError,
+                    "Exception while communciate with DB");
+            msoLogger.debug(END_OF_THE_TRANSACTION
+                    + (String) response.getEntity());
+            return response;
+        } finally {
+            closeCatalogDB(db);
+        }
+        if (recipeLookupResult == null) {
+            msoLogger.error(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND,
+                    MSO_PROP_APIHANDLER_INFRA, "", "",
+                    MsoLogger.ErrorCode.DataError, "No recipe found in DB");
+            msoRequest
+                    .setStatus(org.openecomp.mso.apihandlerinfra.vnfbeans.RequestStatusType.FAILED);
+            Response response = msoRequest.buildServiceErrorResponse(
+                    HttpStatus.SC_NOT_FOUND, MsoException.ServiceException,
+                    "Recipe does not exist in catalog DB",
+                    ErrorNumbers.SVC_GENERAL_SERVICE_ERROR, null);
+            msoRequest.createRequestRecord(Status.FAILED, action);
+            msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.DataNotFound,
+                    "No recipe found in DB");
+            msoLogger.debug(END_OF_THE_TRANSACTION
+                    + (String) response.getEntity());
+            createOperationStatusRecordForError(action, requestId);
+            return response;
+        }
+
+        RequestClient requestClient = null;
+        HttpResponse response = null;
+
+        long subStartTime = System.currentTimeMillis();
+        // String sirRequestJson = mapReqJsonToSvcInstReq(e2eSir, requestJSON);
+
+        try {
+            requestClient = RequestClientFactory.getRequestClient(
+                    recipeLookupResult.getOrchestrationURI(),
+                    MsoPropertiesUtils.loadMsoProperties());
+
+            JSONObject jjo = new JSONObject(requestJSON);
+            jjo.put("operationId", UUIDChecker.generateUUID(msoLogger));
+
+            String bpmnRequest = jjo.toString();
+
+            // Capture audit event
+            msoLogger
+                    .debug("MSO API Handler Posting call to BPEL engine for url: "
+                            + requestClient.getUrl());
+            String serviceId = instanceIdMap.get("serviceId");
+            String serviceInstanceType = e2eScaleReq.getService().getServiceType();
+            response = requestClient.post(requestId, false,
+                                       recipeLookupResult.getRecipeTimeout(), action.name(),
+                                       serviceId, null, null, null, null, null, serviceInstanceType,
+                                       null, null, null, bpmnRequest, recipeLookupResult.getRecipeParamXsd());
+
+            msoLogger.recordMetricEvent(subStartTime,
+                    MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                    "Successfully received response from BPMN engine", "BPMN",
+                    recipeLookupResult.getOrchestrationURI(), null);
+        } catch (Exception e) {
+            msoLogger.recordMetricEvent(subStartTime,
+                    MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.CommunicationError,
+                    "Exception while communicate with BPMN engine", "BPMN",
+                    recipeLookupResult.getOrchestrationURI(), null);
+            Response resp = msoRequest.buildServiceErrorResponse(
+                    HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
+                    "Failed calling bpmn " + e.getMessage(),
+                    ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+            alarmLogger.sendAlarm("MsoConfigurationError",
+                    MsoAlarmLogger.CRITICAL,
+                    Messages.errors.get(ErrorNumbers.NO_COMMUNICATION_TO_BPEL));
+            msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
+                    MSO_PROP_APIHANDLER_INFRA, "", "",
+                    MsoLogger.ErrorCode.AvailabilityError,
+                    "Exception while communicate with BPMN engine",e);
+            msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.CommunicationError,
+                    "Exception while communicate with BPMN engine");
+            msoLogger.debug("End of the transaction, the final response is: "
+                    + (String) resp.getEntity());
+            createOperationStatusRecordForError(action, requestId);
+            return resp;
+        }
+
+        if (response == null) {
+            Response resp = msoRequest.buildServiceErrorResponse(
+                    HttpStatus.SC_BAD_GATEWAY, MsoException.ServiceException,
+                    "bpelResponse is null",
+                    ErrorNumbers.SVC_NO_SERVER_RESOURCES, null);
+            msoLogger.error(MessageEnum.APIH_BPEL_COMMUNICATE_ERROR,
+                    MSO_PROP_APIHANDLER_INFRA, "", "",
+                    MsoLogger.ErrorCode.BusinessProcesssError,
+                    "Null response from BPEL");
+            msoLogger.recordAuditEvent(startTime, MsoLogger.StatusCode.ERROR,
+                    MsoLogger.ResponseCode.InternalError,
+                    "Null response from BPMN");
+            msoLogger.debug(END_OF_THE_TRANSACTION + (String) resp.getEntity());
+            createOperationStatusRecordForError(action, requestId);
+            return resp;
+        }
+
+        ResponseHandler respHandler = new ResponseHandler(response,
+                requestClient.getType());
+        int bpelStatus = respHandler.getStatus();
+
+        return beplStatusUpdate(requestId, startTime, msoRequest,
+                requestClient, respHandler, bpelStatus, action, instanceIdMap);
+    }
+
+       private void closeCatalogDB(CatalogDatabase db) {
+               if (db != null) {
+                       db.close();
+               }
+       }
+
+       private Response beplStatusUpdate(String serviceId, long startTime,
+                       MsoRequest msoRequest, RequestClient requestClient,
+                       ResponseHandler respHandler, int bpelStatus, Action action,
+                       HashMap<String, String> instanceIdMap) {
+               // BPMN accepted the request, the request is in progress
+               if (bpelStatus == HttpStatus.SC_ACCEPTED) {
+                       String camundaJSONResponseBody = respHandler.getResponseBody();
+                       msoLogger.debug("Received from Camunda: " + camundaJSONResponseBody);
+
+                       // currently only for delete case we update the status here
+                       if (action == Action.deleteInstance) {
+                               ObjectMapper mapper = new ObjectMapper();
+                               try {
+                                       DelE2ESvcResp jo = mapper.readValue(
+                                                       camundaJSONResponseBody, DelE2ESvcResp.class);
+                                       String operationId = jo.getOperationId();
+                               this.createOperationStatusRecord("DELETE", serviceId,
+                                                               operationId);
+                               } catch (Exception ex) {
+                                       msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
+                                                       requestClient.getUrl(), "", "",
+                                                       MsoLogger.ErrorCode.BusinessProcesssError,
+                                                       "Response from BPEL engine is failed with HTTP Status="
+                                                                       + bpelStatus);
+                               }
+                       }
+                       
+                       msoLogger.recordAuditEvent(startTime,
+                                       MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                                       "BPMN accepted the request, the request is in progress");
+                       msoLogger.debug(END_OF_THE_TRANSACTION + camundaJSONResponseBody);
+                       return Response.status(HttpStatus.SC_ACCEPTED)
+                                       .entity(camundaJSONResponseBody).build();
+               } else {
+                       List<String> variables = new ArrayList<>();
+                       variables.add(bpelStatus + "");
+                       String camundaJSONResponseBody = respHandler.getResponseBody();
+                       if (camundaJSONResponseBody != null
+                                       && !camundaJSONResponseBody.isEmpty()) {
+                               Response resp = msoRequest.buildServiceErrorResponse(
+                                               bpelStatus, MsoException.ServiceException,
+                                               "Request Failed due to BPEL error with HTTP Status= %1 "
+                                                               + '\n' + camundaJSONResponseBody,
+                                               ErrorNumbers.SVC_DETAILED_SERVICE_ERROR, variables);
+                               msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
+                                               requestClient.getUrl(), "", "",
+                                               MsoLogger.ErrorCode.BusinessProcesssError,
+                                               "Response from BPEL engine is failed with HTTP Status="
+                                                               + bpelStatus);
+                               msoLogger.recordAuditEvent(startTime,
+                                               MsoLogger.StatusCode.ERROR,
+                                               MsoLogger.ResponseCode.InternalError,
+                                               "Response from BPMN engine is failed");
+                               msoLogger.debug(END_OF_THE_TRANSACTION
+                                               + (String) resp.getEntity());
+                               return resp;
+                       } else {
+                               Response resp = msoRequest
+                                               .buildServiceErrorResponse(
+                                                               bpelStatus,
+                                                               MsoException.ServiceException,
+                                                               "Request Failed due to BPEL error with HTTP Status= %1",
+                                                               ErrorNumbers.SVC_DETAILED_SERVICE_ERROR,
+                                                               variables);
+                               msoLogger.error(MessageEnum.APIH_BPEL_RESPONSE_ERROR,
+                                               requestClient.getUrl(), "", "",
+                                               MsoLogger.ErrorCode.BusinessProcesssError,
+                                               "Response from BPEL engine is empty");
+                               msoLogger.recordAuditEvent(startTime,
+                                               MsoLogger.StatusCode.ERROR,
+                                               MsoLogger.ResponseCode.InternalError,
+                                               "Response from BPEL engine is empty");
+                               msoLogger.debug(END_OF_THE_TRANSACTION
+                                               + (String) resp.getEntity());
+                               return resp;
+                       }
+               }
+       }
+
+       /**
+        * Getting recipes from catalogDb
+        * 
+        * @param db the catalog db
+        * @param serviceModelUUID the service model version uuid
+        * @param action the action for the service
+        * @return the service recipe result
+        */
+       private RecipeLookupResult getServiceInstanceOrchestrationURI(
+                       CatalogDatabase db, String serviceModelUUID, Action action) {
+
+               RecipeLookupResult recipeLookupResult = getServiceURI(db, serviceModelUUID, action);
+
+               if (recipeLookupResult != null) {
+                       msoLogger.debug("Orchestration URI is: "
+                                       + recipeLookupResult.getOrchestrationURI()
+                                       + ", recipe Timeout is: "
+                                       + Integer.toString(recipeLookupResult.getRecipeTimeout()));
+               } else {
+                       msoLogger.debug("No matching recipe record found");
+               }
+               return recipeLookupResult;
+       }
+
+       /**
+        * Getting recipes from catalogDb
+        * If Service recipe is not set, use default recipe, if set , use special recipe.
+        * @param db the catalog db
+        * @param serviceModelUUID the service version uuid
+        * @param action the action of the service.
+        * @return the service recipe result.
+        */
+       private RecipeLookupResult getServiceURI(CatalogDatabase db, String serviceModelUUID, Action action) {
+
+               String defaultServiceModelName = "UUI_DEFAULT";
+
+               Service defaultServiceRecord = db
+                               .getServiceByModelName(defaultServiceModelName);
+               ServiceRecipe defaultRecipe = db.getServiceRecipeByModelUUID(
+                       defaultServiceRecord.getModelUUID(), action.name());
+               //set recipe as default generic recipe
+               ServiceRecipe recipe = defaultRecipe;
+               //check the service special recipe 
+               if(null != serviceModelUUID && ! serviceModelUUID.isEmpty()){
+                     ServiceRecipe serviceSpecialRecipe = db.getServiceRecipeByModelUUID(
+                             serviceModelUUID, action.name());
+                     if(null != serviceSpecialRecipe){
+                         //set service special recipe.
+                         recipe = serviceSpecialRecipe;
+                     }
+               }       
+               
+               if (recipe == null) {
+                       return null;
+               }
+               return new RecipeLookupResult(recipe.getOrchestrationUri(),
+                               recipe.getRecipeTimeout(), recipe.getServiceParamXSD());
+
+       }
+
+       /**
+        * Converting E2EServiceInstanceRequest to ServiceInstanceRequest and
+        * passing it to camunda engine.
+        * 
+        * @param e2eSir
+        * @return
+        */
+       private String mapReqJsonToSvcInstReq(E2EServiceInstanceRequest e2eSir,
+                       String requestJSON) {
+
+               sir = new ServiceInstancesRequest();
+
+               String returnString = null;
+               RequestDetails requestDetails = new RequestDetails();
+               ModelInfo modelInfo = new ModelInfo();
+
+               // ModelInvariantId
+               modelInfo.setModelInvariantId(e2eSir.getService().getServiceInvariantUuid());
+
+               // modelNameVersionId
+               modelInfo.setModelNameVersionId(e2eSir.getService().getServiceUuid());
+
+               // String modelInfoValue =
+               // e2eSir.getService().getParameters().getNodeTemplateName();
+               // String[] arrayOfInfo = modelInfoValue.split(":");
+               // String modelName = arrayOfInfo[0];
+               // String modelVersion = arrayOfInfo[1];
+
+               // TODO: To ensure, if we dont get the values from the UUI
+               String modelName = "voLTE";
+               String modelVersion = "1.0";
+               // modelName
+               modelInfo.setModelName(modelName);
+
+               // modelVersion
+               modelInfo.setModelVersion(modelVersion);
+
+               // modelType
+               modelInfo.setModelType(ModelType.service);
+
+               // setting modelInfo to requestDetails
+               requestDetails.setModelInfo(modelInfo);
+
+               SubscriberInfo subscriberInfo = new SubscriberInfo();
+
+               // globalsubscriberId
+               subscriberInfo.setGlobalSubscriberId(e2eSir.getService().getGlobalSubscriberId());
+
+               // setting subscriberInfo to requestDetails
+               requestDetails.setSubscriberInfo(subscriberInfo);
+
+               RequestInfo requestInfo = new RequestInfo();
+
+               // instanceName
+               requestInfo.setInstanceName(e2eSir.getService().getName());
+
+               // source
+               requestInfo.setSource("UUI");
+
+               // suppressRollback
+               requestInfo.setSuppressRollback(true);
+
+               // setting requestInfo to requestDetails
+               requestDetails.setRequestInfo(requestInfo);
+
+               RequestParameters requestParameters = new RequestParameters();
+
+               // subscriptionServiceType
+               requestParameters.setSubscriptionServiceType("MOG");
+
+               // Userparams
+               List<E2EUserParam> userParams;
+               // userParams =
+               // e2eSir.getService().getParameters().getRequestParameters().getUserParams();
+               List<Map<String, Object>> userParamList = new ArrayList<>();
+               Map<String, Object> userParamMap = new HashMap<>();
+               // complete json request updated in the camunda
+               userParamMap.put("UUIRequest", requestJSON);
+               userParamMap.put("ServiceInstanceName", e2eSir.getService().getName());
+
+               // Map<String, String> userParamMap3 = null;
+               // for (E2EUserParam userp : userParams) {
+               // userParamMap.put(userp.getName(), userp.getValue());
+               //
+               // }
+               userParamList.add(userParamMap);
+               requestParameters.setUserParams(userParamList);
+
+               // setting requestParameters to requestDetails
+               requestDetails.setRequestParameters(requestParameters);
+
+               sir.setRequestDetails(requestDetails);
+
+               // converting to string
+               ObjectMapper mapper = new ObjectMapper();
+               try {
+                       returnString = mapper.writeValueAsString(sir);
+               } catch (IOException e) {
+                       msoLogger
+                                       .debug("Exception while converting ServiceInstancesRequest object to string",
+                                                       e);
+               }
+
+               return returnString;
+       }
+
+       private void createOperationStatusRecordForError(Action action,
+                       String serviceId) throws MsoDatabaseException {
+
+               AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();
+
+               Session session = null;
+               try {
+
+                       session = requestsDbSessionFactoryManager.getSessionFactory()
+                                       .openSession();
+                       session.beginTransaction();
+
+                       OperationStatus os = new OperationStatus();
+                       os.setOperation(action.name());
+                       os.setOperationContent("");
+                       os.setOperationId("");
+                       os.setProgress("100");
+                       os.setReason("");
+                       os.setResult("error");
+                       os.setServiceId(serviceId);
+                       os.setUserId("");
+                       Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
+                       Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
+                       os.setFinishedAt(endTimeStamp);
+                       os.setOperateAt(startTimeStamp);
+
+                       session.save(os);
+                       session.getTransaction().commit();
+
+               } catch (Exception e) {
+                       msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",
+                                       MsoLogger.ErrorCode.DataError,
+                                       "Exception when creation record request in Operation", e);
+                       throw new MsoDatabaseException(
+                                       "Data did inserted in Operatus Status Table for failure", e);
+               } finally {
+                       if (null != session) {
+                               session.close();
+                       }
+               }
+       }
+
+       private void createOperationStatusRecord(String actionNm, String serviceId,
+                       String operationId) throws MsoDatabaseException {
+
+               AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager();
+
+               Session session = null;
+               try {
+
+                       session = requestsDbSessionFactoryManager.getSessionFactory()
+                                       .openSession();
+                       session.beginTransaction();
+
+                       OperationStatus os = new OperationStatus();
+                       os.setOperation(actionNm);
+                       os.setOperationContent("");
+                       os.setOperationId(operationId);
+                       os.setProgress("0");
+                       os.setReason("");
+                       os.setResult("processing");
+                       os.setServiceId(serviceId);
+                       // TODO : to be updated...
+                       os.setUserId("");
+                       Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
+                       Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
+                       os.setFinishedAt(endTimeStamp);
+                       os.setOperateAt(startTimeStamp);
+
+                       session.save(os);
+                       session.getTransaction().commit();
+
+               } catch (Exception e) {
+                       msoLogger.error(MessageEnum.APIH_DB_INSERT_EXC, "", "",
+                                       MsoLogger.ErrorCode.DataError,
+                                       "Exception when creation record request in Operation", e);
+                       throw new MsoDatabaseException(
+                                       "Data did inserted in Operatus Status Table", e);
+               } finally {
+                       if (null != session) {
+                               session.close();
+                       }
+               }
+       }
+
+       private OperationStatus chkSvcInstOperStatusbySvcId(String serviceId) {
+               OperationStatus svcInstanceOperStatus = (RequestsDatabase.getInstance())
+                               .getOperationStatusByServiceId(serviceId);
+
+               return svcInstanceOperStatus;
+       }
+
+       private OperationStatus chkDuplicateServiceNameInOperStatus(
+                       String serviceName) {
+               OperationStatus dupServiceName = (RequestsDatabase.getInstance())
+                               .getOperationStatusByServiceName(serviceName);
+
+               return dupServiceName;
+       }
+}
index 7be86fe..b809fc2 100644 (file)
@@ -341,7 +341,7 @@ public class OrchestrationRequests {
                requestDetails = mapper.readValue(requestBody, RequestDetails.class);
 
        }catch(Exception e){
-               msoLogger.debug("Exception caught mapping requestBody to RequestDetails");
+               msoLogger.debug("Exception caught mapping requestBody to RequestDetails",e);
        }
 
        request.setRequestDetails(requestDetails);
index d8a6282..45fc89b 100644 (file)
@@ -1001,7 +1001,7 @@ public class E2EServiceInstancesTest {
                String request = jsonBody;
                Response resp = instance.updateE2EServiceInstance(request, "v3", "12345");
                String respStr = resp.getEntity().toString();
-               assertTrue(respStr.contains("SVC2000"));
+               assertTrue(!respStr.contains("SVC2000"));
        }
 
     @Test
index 27c94f0..4fb5ebc 100644 (file)
@@ -93,8 +93,8 @@ public class CatalogDatabase implements Closeable {
     private static final String MODEL_TYPE = "modelType";
     private static final String MODEL_VERSION_ID = "modelVersionId";
     private static final String MODEL_CUSTOMIZATION_UUID = "modelCustomizationUuid";
-       private static final String VF_MODULE_MODEL_UUID = "vfModuleModelUUId";
-       private static final String NETWORK_SERVICE = "network service";
+    private static final String VF_MODULE_MODEL_UUID = "vfModuleModelUUId";
+    private static final String NETWORK_SERVICE = "network service";
 
     protected static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
 
@@ -4469,7 +4469,7 @@ public class CatalogDatabase implements Closeable {
     /**
      * Return a Network recipe that matches a given MODEL_UUID and ACTION
      *
-     * @param modelName
+     * @param networkModelUuid
      * @param action
      * @return NetworkRecipe object or null if none found
      */
@@ -4484,7 +4484,17 @@ public class CatalogDatabase implements Closeable {
         }
         
         NetworkRecipe recipe = getNetworkRecipeByNameVersion(networkResource.getModelName(), networkResource.getModelVersion(), action);
-        return recipe;        
+
+        if (recipe == null) {
+            recipe = getDefaultNetworkReceipe(action);
+        }
+
+        return recipe;
+    }
+
+    private NetworkRecipe getDefaultNetworkReceipe(String action) {
+        String modelName = "SDNC_DEFAULT";
+        return getNetworkRecipe(modelName, action);
     }
     
     /**