diff options
42 files changed, 3484 insertions, 2776 deletions
diff --git a/INFO.yaml b/INFO.yaml new file mode 100644 index 0000000000..34f11c2ff1 --- /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' diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipe.java b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipe.java index 5be6970554..7d6aed4785 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipe.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/openecomp/mso/adapters/catalogdb/catalogrest/QueryResourceRecipe.java @@ -24,6 +24,10 @@ import java.util.Map; import org.openecomp.mso.db.catalog.beans.Recipe;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+
/**
* serivce csar query support
* <br>
@@ -41,16 +45,6 @@ public class QueryResourceRecipe extends CatalogQuery{ this.resourceRecipe =resourceRecipe;
}
- private final String template =
- "\t{\n"+
- "\t\t\"id\" : <ID>,\n"+
- "\t\t\"action\" : <ACTION>,\n"+
- "\t\t\"orchestrationUri\" : <ORCHESTRATION_URI>,\n"+
- "\t\t\"recipeTimeout\" : <RECIPE_TIMEOUT>,\n"+
- "\t\t\"paramXSD\" : <PARAM_XSD>,\n"+
- "\t\t\"description\" : <DESCRIPTION>\n"+
- "\t}";
-
@Override
public String toString() {
@@ -58,15 +52,25 @@ public class QueryResourceRecipe extends CatalogQuery{ }
@Override
- public String JSON2(boolean isArray, boolean isEmbed) {
+ public String JSON2(boolean isArray, boolean isEmbed) {
+
Map<String, String> valueMap = new HashMap<>();
- put(valueMap, "ID", null == resourceRecipe ? null : resourceRecipe.getId());
- put(valueMap, "ACTION", null == resourceRecipe ? null : resourceRecipe.getAction());
- put(valueMap, "ORCHESTRATION_URI", null == resourceRecipe ? null : resourceRecipe.getOrchestrationUri());
- put(valueMap, "RECIPE_TIMEOUT", null == resourceRecipe ? null : resourceRecipe.getRecipeTimeout());
- put(valueMap, "PARAM_XSD", null == resourceRecipe ? null : resourceRecipe.getParamXSD());
- put(valueMap, "DESCRIPTION", null == resourceRecipe ? null : resourceRecipe.getDescription());
- return this.setTemplate(template, valueMap);
+ valueMap.put("id", null == resourceRecipe ? null :String.valueOf(resourceRecipe.getId()));
+ valueMap.put("action", null == resourceRecipe ? null :resourceRecipe.getAction());
+ valueMap.put("orchestrationUri", null == resourceRecipe ? null : resourceRecipe.getOrchestrationUri());
+ valueMap.put("recipeTimeout", null == resourceRecipe ? null : String.valueOf(resourceRecipe.getRecipeTimeout()));
+ valueMap.put("paramXSD", null == resourceRecipe ? null : resourceRecipe.getParamXSD());
+ valueMap.put("description", null == resourceRecipe ? null : resourceRecipe.getDescription());
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
+ String jsonStr = "";
+ try {
+ jsonStr = mapper.writeValueAsString(valueMap);
+ } catch(JsonProcessingException e) {
+
+ e.printStackTrace();
+ }
+ return jsonStr;
}
}
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 index 0000000000..87e2a87138 --- /dev/null +++ b/adapters/mso-requests-db-adapter/src/test/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandlerTest.java @@ -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()); + } + +} + + diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImplTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImplTest.java index 6e05402736..98b368f5fa 100644 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImplTest.java +++ b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImplTest.java @@ -20,43 +20,60 @@ 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); - }*/ + } } diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResourceTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResourceTest.java index a62f42af5a..75cd360663 100644 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResourceTest.java +++ b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResourceTest.java @@ -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()); + + } } diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java index 8e16d1c22f..0673af2f14 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java @@ -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); diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NSResourceInputParameter.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NSResourceInputParameter.java index 765ee52069..d46844364f 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NSResourceInputParameter.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NSResourceInputParameter.java @@ -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; + } + } diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java index fcbbf8515a..0bedd12eb1 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java @@ -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; diff --git a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfPluginAdapterImpl.java index a817a6b427..0b9ffd9468 100644 --- a/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfPluginAdapterImpl.java +++ b/adapters/mso-vnf-adapter/src/main/java/org/openecomp/mso/adapters/vnf/MsoVnfPluginAdapterImpl.java @@ -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); } } } diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCConfiguration.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCConfiguration.java index a151b5dae7..7cc6ab8a89 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCConfiguration.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/client/ASDCConfiguration.java @@ -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; } } diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandlerTestException.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnIntegerParam.java index 994ce5dbb3..033c6876bd 100644 --- a/adapters/mso-requests-db-adapter/src/test/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandlerTestException.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnIntegerParam.java @@ -17,19 +17,32 @@ * 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 + "]"; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java index 016afa8537..1dc0451213 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/BpmnRestClient.java @@ -115,9 +115,6 @@ public class BpmnRestClient { HttpPost post = new HttpPost(recipeUri);
MsoJavaProperties props = loadMsoProperties();
- RequestConfig requestConfig =
- RequestConfig.custom().setSocketTimeout(recipeTimeout).setConnectTimeout(recipeTimeout).setConnectionRequestTimeout(recipeTimeout).build();
- post.setConfig(requestConfig);
msoLogger.debug("call the bpmn, url:" + recipeUri);
String jsonReq = wrapResourceRequest(requestId, recipeTimeout, requestAction, serviceInstanceId, serviceType, requestDetails, recipeParamXsd);
@@ -177,6 +174,8 @@ public class BpmnRestClient { BpmnParam serviceInstanceIdInput = new BpmnParam();
BpmnParam serviceTypeInput = new BpmnParam();
BpmnParam recipeParamsInput = new BpmnParam();
+ BpmnIntegerParam recipeTimeoutInput = new BpmnIntegerParam();
+ recipeTimeoutInput.setValue(recipeTimeout);
// host.setValue(parseURL());
requestIdInput.setValue(requestId);
requestActionInput.setValue(requestAction);
@@ -191,6 +190,7 @@ public class BpmnRestClient { recipeRequest.setServiceType(serviceTypeInput);
recipeRequest.setRecipeParams(recipeParamsInput);
recipeRequest.setResourceInput(resourceInput);
+ recipeRequest.setRecipeTimeout(recipeTimeoutInput);
jsonReq = recipeRequest.toString();
msoLogger.debug("request body is " + jsonReq);
} catch(Exception e) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java index 00e4ae71d6..13b1666991 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceInput.java @@ -1,293 +1,296 @@ -/*-
- * ============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 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 {
-
- @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) {
-
- e.printStackTrace();
- }
- return jsonStr;
- }
-}
+/*- + * ============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; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequest.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequest.java index 5bf5a02a38..a1809fe754 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequest.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/recipe/ResourceRecipeRequest.java @@ -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; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java index 9aa17930c0..c88800273c 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/resource/ResourceRequestBuilder.java @@ -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; diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy index 81266148ca..ede76c0fd2 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy @@ -18,7 +18,10 @@ * ============LICENSE_END=========================================================
*/
-package org.openecomp.mso.bpmn.infrastructure.scripts;
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import org.json.JSONObject
+import org.json.XML;
import static org.apache.commons.lang3.StringUtils.*;
import groovy.xml.XmlUtil
@@ -117,7 +120,23 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
-
+
+ String customizeResourceParam(String netowrkInputParametersJson) {
+ List<Map<String, Object>> paramList = new ArrayList();
+ JSONObject jsonObject = new JSONObject(netowrkInputParametersJson);
+ Iterator iterator = jsonObject.keys();
+ while (iterator.hasNext()) {
+ String key = iterator.next();
+ HashMap<String, String> hashMap = new HashMap();
+ hashMap.put("name", key);
+ hashMap.put("value", jsonObject.get(key))
+ paramList.add(hashMap)
+ }
+ Map<String, List<Map<String, Object>>> paramMap = new HashMap();
+ paramMap.put("param", paramList);
+
+ return new JSONObject(paramMap).toString();
+ }
/**
* Pre Process the BPMN Flow Request
@@ -144,8 +163,8 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { String serviceType = resourceInputObj.getServiceType()
String serviceModelInvariantUuid = resourceInputObj.getServiceModelInfo().getModelInvariantUuid()
String serviceModelUuid = resourceInputObj.getServiceModelInfo().getModelUuid()
- String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelName()
- String serviceModelName = resourceInputObj.getServiceModelInfo().getModelVersion()
+ String serviceModelVersion = resourceInputObj.getServiceModelInfo().getModelVersion()
+ String serviceModelName = resourceInputObj.getServiceModelInfo().getModelName()
String globalCustomerId = resourceInputObj.getGlobalSubscriberId()
String modelInvariantUuid = resourceInputObj.getResourceModelInfo().getModelInvariantUuid();
String modelCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
@@ -155,7 +174,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { String resourceInputPrameters = resourceInputObj.getResourceParameters()
String netowrkInputParametersJson = jsonUtil.getJsonValue(resourceInputPrameters, "requestInputs")
//here convert json string to xml string
- String netowrkInputParameters = jsonUtil.json2xml(netowrkInputParametersJson)
+ String netowrkInputParameters = XML.toString(new JSONObject(customizeResourceParam(netowrkInputParametersJson)))
// 1. prepare assign topology via SDNC Adapter SUBFLOW call
String sndcTopologyCreateRequest =
"""<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.openecomp/mso/workflow/schema/v1"
@@ -179,14 +198,14 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { <order-version></order-version>
</request-information>
<service-information>
- <service-id>${sdnc_service_id}</service-id>
+ <service-id>${serviceInstanceId}</service-id>
<subscription-service-type>${serviceType}</subscription-service-type>
- <ecomp-model-information>
+ <onap-model-information>
<model-invariant-uuid>${serviceModelInvariantUuid}</model-invariant-uuid>
<model-uuid>${serviceModelUuid}</model-uuid>
<model-version>${serviceModelVersion}</model-version>
<model-name>${serviceModelName}</model-name>
- </ecomp-model-information>
+ </onap-model-information>
<service-instance-id>${serviceInstanceId}</service-instance-id>
<global-customer-id>${globalCustomerId}</global-customer-id>
</service-information>
@@ -219,6 +238,77 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { utils.log("INFO"," ***** Exit prepareSDNCRequest *****", isDebugEnabled)
}
+ private void setProgressUpdateVariables(DelegateExecution execution, String body) {
+ def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
+ execution.setVariable("CVFMI_updateResOperStatusRequest", body)
+ }
+
+ public void prepareUpdateBeforeCreateSDNCResource(DelegateExecution execution) {
+ ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput")
+ String operType = resourceInputObj.getOperationType()
+ String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
+ String ServiceInstanceId = resourceInputObj.getServiceInstanceId()
+ String operationId = resourceInputObj.getOperationId()
+ String progress = "20"
+ String status = "processing"
+ String statusDescription = "SDCN resource creation invoked"
+
+ execution.getVariable("operationId")
+
+ String body = """
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateResourceOperationStatus>
+ <operType>${operType}</operType>
+ <operationId>${operationId}</operationId>
+ <progress>${progress}</progress>
+ <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID>
+ <serviceId>${ServiceInstanceId}</serviceId>
+ <status>${status}</status>
+ <statusDescription>${statusDescription}</statusDescription>
+ </ns:updateResourceOperationStatus>
+ </soapenv:Body>
+ </soapenv:Envelope>""";
+
+ setProgressUpdateVariables(execution, body)
+
+ }
+
+ public void prepareUpdateAfterCreateSDNCResource(execution) {
+ ResourceInput resourceInputObj = execution.getVariable(Prefix + "resourceInput")
+ String operType = resourceInputObj.getOperationType()
+ String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
+ String ServiceInstanceId = resourceInputObj.getServiceInstanceId()
+ String operationId = resourceInputObj.getOperationId()
+ String progress = "100"
+ String status = "Created"
+ String statusDescription = "SDCN resource creation completed"
+
+ execution.getVariable("operationId")
+
+ String body = """
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:ns="http://org.openecomp.mso/requestsdb">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <ns:updateResourceOperationStatus>
+ <operType>${operType}</operType>
+ <operationId>${operationId}</operationId>
+ <progress>${progress}</progress>
+ <resourceTemplateUUID>${resourceCustomizationUuid}</resourceTemplateUUID>
+ <serviceId>${ServiceInstanceId}</serviceId>
+ <status>${status}</status>
+ <statusDescription>${statusDescription}</statusDescription>
+ </ns:updateResourceOperationStatus>
+ </soapenv:Body>
+ </soapenv:Envelope>""";
+
+ setProgressUpdateVariables(execution, body)
+ }
+
public void postCreateSDNCCall(DelegateExecution execution){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** Started prepareSDNCRequest *****", isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy index 9456007dc8..9f3910beed 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy @@ -80,6 +80,8 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { //deal with operation key
String globalSubscriberId = jsonUtil.getJsonValue(resourceInput, "globalSubscriberId")
utils.log("INFO", "globalSubscriberId:" + globalSubscriberId, isDebugEnabled)
+ //set local globalSubscriberId variable
+ execution.setVariable("globalSubscriberId", globalSubscriberId);
String serviceType = execution.getVariable("serviceType")
utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled)
@@ -87,10 +89,11 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { String serviceId = execution.getVariable("serviceInstanceId")
utils.log("INFO", "serviceId:" + serviceId, isDebugEnabled)
- String operationId = execution.getVariable("requestId")
+ String operationId = jsonUtil.getJsonValue(resourceInput, "operationId")
utils.log("INFO", "serviceType:" + serviceType, isDebugEnabled)
- String nodeTemplateUUID = jsonUtil.getJsonValue(resourceParameters, "requestInputs.nsd0_providing_service_uuid")
+ String nodeTemplateUUID = jsonUtil.getJsonValue(resourceInput, "resourceModelInfo.modelCustomizationUuid")
+ String nsServiceModelUUID = jsonUtil.getJsonValue(resourceParameters, "requestInputs.nsd0_providing_service_uuid")
utils.log("INFO", "nodeTemplateUUID:" + nodeTemplateUUID, isDebugEnabled)
/*
* segmentInformation needed as a object of segment
@@ -114,6 +117,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { }"""
execution.setVariable("nsOperationKey", nsOperationKey);
execution.setVariable("nsParameters", nsParameters)
+ execution.setVariable("nsServiceModelUUID", nsServiceModelUUID);
} catch (BpmnError e) {
@@ -133,6 +137,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** createNetworkService *****", isDebugEnabled)
String nsOperationKey = execution.getVariable("nsOperationKey");
+ String nsServiceModelUUID = execution.getVariable("nsServiceModelUUID");
String nsParameters = execution.getVariable("nsParameters");
String nsServiceName = execution.getVariable("nsServiceName")
String nsServiceDescription = execution.getVariable("nsServiceDescription")
@@ -141,6 +146,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { String reqBody ="""{
"nsServiceName":"${nsServiceName}",
"nsServiceDescription":"${nsServiceDescription}",
+ "nsServiceModelUUID":"${nsServiceModelUUID}",
"nsOperationKey":${nsOperationKey},
"nsParameters":{
"locationConstraints":${locationConstraints},
@@ -305,4 +311,26 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor { }
return apiResponse
}
+
+ public void sendSyncResponse (DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
+
+ try {
+ String nsInstanceId = execution.getVariable("nsInstanceId")
+ String operationStatus = execution.getVariable("operationStatus")
+ // RESTResponse for main flow
+ String createVFCResourceRestRsp = """{"nsInstanceId":"${nsInstanceId}","operationStatus":"${operationStatus}"}""".trim()
+ utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + createVFCResourceRestRsp, isDebugEnabled)
+ sendWorkflowResponse(execution, 202, createVFCResourceRestRsp)
+ execution.setVariable("sentSyncResponse", true)
+
+ } catch (Exception ex) {
+ String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
+ }
+
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy index d218adc279..ebf9ae7825 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy @@ -73,9 +73,9 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor String requestId = execution.getVariable("mso-request-id")
- execution.setVariable("msoRequestId", requestId)
+ execution.setVariable("msoRequestId", requestId)
utils.log("INFO", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)
-
+
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)) {
msg = "Input serviceInstanceId' is null"
@@ -114,7 +114,9 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor } else {
execution.setVariable("subscriptionServiceType", subscriptionServiceType)
}
-
+ String operationId = jsonUtil.getJsonValue(siRequest, "operationId")
+ execution.setVariable("operationId", operationId)
+
execution.setVariable("operationType", "DELETE")
} catch (BpmnError e) {
throw e;
@@ -129,13 +131,9 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " *** sendSyncResponse *** ", isDebugEnabled)
-
try {
- String requestId = execution.getVariable("msoRequestId")
- String serviceInstanceId = execution.getVariable("serviceInstanceId")
-
- // RESTResponse (for API Handler (APIH) Reply Task)
- String syncResponse = """{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
+ String operationId = execution.getVariable("operationId")
+ String syncResponse = """{"operationId":"${operationId}"}""".trim()
utils.log("INFO", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)
sendWorkflowResponse(execution, 202, syncResponse)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy index 267673d9fd..73d51c99b0 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy @@ -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" diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy index 7ccc1b0046..ae75d54afe 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateResources.groovy @@ -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) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy index 98a1a43035..d44de7c27d 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy @@ -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) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy index 6e19a3469a..63ecb45e28 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy @@ -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") diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy index 9540508075..f29db9252f 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoUpdateE2EServiceInstance.groovy @@ -58,24 +58,21 @@ import org.springframework.web.util.UriUtils; * Inputs:
* @param - msoRequestId
* @param - globalSubscriberId
- * @param - subscriptionServiceType
+ * @param - serviceType
* @param - serviceInstanceId
- * @param - serviceInstanceName - O
+ * @param - serviceInstanceName
* @param - serviceModelInfo
* @param - productFamilyId
- * @param - disableRollback
- * @param - failExists - TODO
- * @param - serviceInputParams (should contain aic_zone for serviceTypes TRANSPORT,ATM)
- * @param - sdncVersion ("1610")
- * @param - serviceDecomposition - Decomposition for R1710
- * (if macro provides serviceDecompsition then serviceModelInfo, serviceInstanceId & serviceInstanceName will be ignored)
- *
+ * @param - uuiRequest
+ * @param - serviceDecomposition_Target
+ * @param - serviceDecomposition_Original
+ * @param - addResourceList
+ * @param - delResourceList
+ *
* Outputs:
* @param - rollbackData (localRB->null)
* @param - rolledBack (no localRB->null, localRB F->false, localRB S->true)
* @param - WorkflowException
- * @param - serviceInstanceName - (GET from AAI if null in input)
- *
*/
public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor {
@@ -87,24 +84,22 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
-
- def method = getClass().getSimpleName() + '.preProcessRequest(' +'execution=' + execution.getId() +')'
- utils.log("INFO","Entered " + method, isDebugEnabled)
- String msg = ""
utils.log("INFO"," ***** Enter DoUpdateE2EServiceInstance preProcessRequest *****", isDebugEnabled)
+
+ String msg = ""
try {
execution.setVariable("prefix", Prefix)
//Inputs
- //requestDetails.subscriberInfo. for AAI GET & PUT & SDNC assignToplology
+ //for AAI GET & PUT & SDNC assignToplology
String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
utils.log("INFO"," ***** globalSubscriberId *****" + globalSubscriberId, isDebugEnabled)
- //requestDetails.requestParameters. for AAI PUT & SDNC assignTopology
+ //for AAI PUT & SDNC assignTopology
String serviceType = execution.getVariable("serviceType")
utils.log("INFO"," ***** serviceType *****" + serviceType, isDebugEnabled)
- //requestDetails.requestParameters. for SDNC assignTopology
+ //for SDNC assignTopology
String productFamilyId = execution.getVariable("productFamilyId") //AAI productFamilyId
if (isBlank(globalSubscriberId)) {
@@ -126,31 +121,16 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { utils.log("INFO", msg, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
-
- if (productFamilyId == null) {
- execution.setVariable("productFamilyId", "")
- }
String serviceInstanceName = execution.getVariable("serviceInstanceName")
- String uuiRequest = execution.getVariable("uuiRequest")
- utils.log("INFO","uuiRequest: " + uuiRequest, isDebugEnabled)
-
- String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
- utils.log("INFO","modelInvariantUuid: " + modelInvariantUuid, isDebugEnabled)
- execution.setVariable("modelInvariantUuid", modelInvariantUuid)
- execution.setVariable("model-invariant-id-target", modelInvariantUuid)
+ // user params
+ String uuiRequest = execution.getVariable("uuiRequest")
+ // target model uuid
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)
+ utils.log("INFO","modelUuid: " + modelUuid, isDebugEnabled)
} catch (BpmnError e) {
throw e;
@@ -159,128 +139,9 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { utils.log("INFO", msg, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("INFO", "Exited " + method, isDebugEnabled)
+ utils.log("INFO", "======== COMPLETED preProcessRequest Process ======== ", 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)
-
- // 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 preInitResourcesOperStatus(DelegateExecution execution){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
@@ -292,7 +153,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { String operationType = execution.getVariable("operationType")
String resourceTemplateUUIDs = ""
String result = "processing"
- String progress = "10"
+ String progress = "0"
String reason = ""
String operationContent = "Prepare service updating"
utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType, isDebugEnabled)
@@ -340,92 +201,18 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { utils.log("INFO", "======== COMPLETED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
}
- /**
- * Init 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 userId = ""
- String result = "processing"
- String progress = execution.getVariable("progress")
- utils.log("INFO", "progress: " + progress , isDebugEnabled)
- if ("100".equalsIgnoreCase(progress))
- {
- result = "finished"
- }
- String reason = ""
- 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 postResourcesOperStatus(DelegateExecution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-
- }
-
- public void preCompareModelVersions(DelegateExecution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-
- }
-
- public void postCompareModelVersions(DelegateExecution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- }
-
public void preProcessForAddResource(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** preProcessForAddResource ***** ", isDebugEnabled)
execution.setVariable("operationType", "create")
+
+ execution.setVariable("hasResourcetoAdd", false)
+ List<Resource> addResourceList = execution.getVariable("addResourceList")
+ if(addResourceList != null && !addResourceList.isEmpty()) {
+ execution.setVariable("hasResourcetoAdd", true)
+ }
utils.log("INFO"," *** Exit preProcessForAddResource *** ", isDebugEnabled)
}
@@ -445,6 +232,14 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { execution.setVariable("operationType", "delete")
+ execution.setVariable("hasResourcetoDelete", false)
+ List<Resource> delResourceList = execution.getVariable("delResourceList")
+ if(delResourceList != null && !delResourceList.isEmpty()) {
+ execution.setVariable("hasResourcetoDelete", true)
+ }
+
+ execution.setVariable("resourceInstanceIDs", execution.getVariable("serviceRelationShip"))
+
utils.log("INFO"," *** Exit preProcessForDeleteResource *** ", isDebugEnabled)
}
@@ -458,20 +253,20 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { utils.log("INFO"," *** Exit postProcessForDeleteResource *** ", isDebugEnabled)
}
- public void preProcessAAIGET2(DelegateExecution execution) {
+ public void preProcessAAIGET(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
}
- public void postProcessAAIGET2(DelegateExecution execution) {
+ public void postProcessAAIGET(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO"," ***** postProcessAAIGET2 ***** ", isDebugEnabled)
+ utils.log("INFO"," ***** postProcessAAIGET ***** ", isDebugEnabled)
String msg = ""
try {
String serviceInstanceName = execution.getVariable("serviceInstanceName")
boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
if(!succInAAI){
- utils.log("INFO","Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName, isDebugEnabled)
+ utils.log("INFO","Error getting Service-instance from AAI in postProcessAAIGET", + serviceInstanceName, isDebugEnabled)
WorkflowException workflowException = execution.getVariable("WorkflowException")
utils.logAudit("workflowException: " + workflowException)
if(workflowException != null){
@@ -479,7 +274,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { }
else
{
- msg = "Failure in postProcessAAIGET2 GENGS_SuccessIndicator:" + succInAAI
+ msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
utils.log("INFO", msg, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
}
@@ -498,11 +293,11 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { } catch (BpmnError e) {
throw e;
} catch (Exception ex) {
- msg = "Exception in DoCreateServiceInstance.postProcessAAIGET2 " + ex.getMessage()
+ msg = "Exception in DoUpdateE2EServiceInstance.postProcessAAIGET " + ex.getMessage()
utils.log("INFO", msg, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("INFO"," *** Exit postProcessAAIGET2 *** ", isDebugEnabled)
+ utils.log("INFO"," *** Exit postProcessAAIGET *** ", isDebugEnabled)
}
public void preProcessAAIPUT(DelegateExecution execution) {
@@ -510,7 +305,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
String msg = ""
- utils.log("INFO"," ***** preProcessAAIPUTt *****", isDebugEnabled)
+ utils.log("INFO"," ***** preProcessAAIPUT *****", isDebugEnabled)
String modelUuid = execution.getVariable("modelUuid")
String serviceInstanceVersion = execution.getVariable("serviceInstanceVersion")
@@ -523,6 +318,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { String namespace = aaiUriUtil.getNamespaceFromUri(aai_uri)
utils.log("INFO","namespace: " + namespace, isDebugEnabled)
+ //update target model to aai
String serviceInstanceData =
"""<service-instance xmlns=\"${namespace}\">
<model-version-id">${modelUuid}</model-version-id>
@@ -560,7 +356,7 @@ public class DoUpdateE2EServiceInstance extends AbstractServiceTaskProcessor { rollbackData.put("SERVICEINSTANCE", "disableRollback", disableRollback.toString())
rollbackData.put("SERVICEINSTANCE", "rollbackAAI", "true")
rollbackData.put("SERVICEINSTANCE", "serviceInstanceId", serviceInstanceId)
- rollbackData.put("SERVICEINSTANCE", "subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
+ rollbackData.put("SERVICEINSTANCE", "serviceType", execution.getVariable("serviceType"))
rollbackData.put("SERVICEINSTANCE", "globalSubscriberId", execution.getVariable("globalSubscriberId"))
execution.setVariable("rollbackData", rollbackData)
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy index adea23aa19..0ad2da4a9a 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy @@ -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">
<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"
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java index e2dfedb6e4..0e65dd7441 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java @@ -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()); } } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java index 0aeb0c6310..ee047c9dd5 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java @@ -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; } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java index de50fe11b5..09561a620e 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java @@ -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)) { diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn index c0637a3e1a..71f4a28c88 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn @@ -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> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn index fd7a27c031..dcd0b56418 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateSDNCNetworkResource.bpmn @@ -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> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVFCNSResource.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVFCNSResource.bpmn index e4254f2d9e..2370165354 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVFCNSResource.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/CreateVFCNSResource.bpmn @@ -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> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn index 3071d1c20d..ae84d894c0 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/process/UpdateCustomE2EServiceInstance.bpmn @@ -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.*
-ExceptionUtil ex = new ExceptionUtil()
+ <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.*
-def csi= new UpdateCustomE2EServiceInstance()
+ <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.*
-def csi = new UpdateCustomE2EServiceInstance()
+ <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.*
-def csi = new UpdateCustomE2EServiceInstance()
+ <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.*
-def csi = new UpdateCustomE2EServiceInstance()
+ <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.*
-def csi = new UpdateCustomE2EServiceInstance()
+ <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> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn index 9ed1431ed8..5bb3d315b0 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateResources.bpmn @@ -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> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn index 20686252bd..8a3d441a8e 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn @@ -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> diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUpdateE2EServiceInstance.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUpdateE2EServiceInstance.bpmn index 7735b192dc..5e00358302 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUpdateE2EServiceInstance.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUpdateE2EServiceInstance.bpmn @@ -7,20 +7,12 @@ <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> <bpmn2:outgoing>SequenceFlow_0yztz2p</bpmn2:outgoing> @@ -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.*
@@ -306,8 +161,8 @@ def dcsi = new DoCreateResources() dcsi.preProcessRollback(execution)
]]></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.*
def dcsi = new DoCreateResources()
@@ -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> diff --git a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java index e2ec7e062f..99a87def80 100644 --- a/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java +++ b/bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilderTest.java @@ -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); } diff --git a/common/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java b/common/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java index 54aab5c296..a84aeaac8e 100644 --- a/common/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java +++ b/common/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java @@ -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) diff --git a/common/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java b/common/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java index aabeb8aabf..5a2fa178de 100644 --- a/common/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java +++ b/common/src/main/java/org/openecomp/mso/client/dmaap/DmaapClient.java @@ -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; } } diff --git a/common/src/main/java/org/openecomp/mso/openpojo/rules/HasAnnotationPropertyWithValueMatcher.java b/common/src/main/java/org/openecomp/mso/openpojo/rules/HasAnnotationPropertyWithValueMatcher.java index f0c1b18df2..d1b2fb1d11 100644 --- a/common/src/main/java/org/openecomp/mso/openpojo/rules/HasAnnotationPropertyWithValueMatcher.java +++ b/common/src/main/java/org/openecomp/mso/openpojo/rules/HasAnnotationPropertyWithValueMatcher.java @@ -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; diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java index 8d3a64340d..95da5b6a95 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java @@ -1,1460 +1,1455 @@ -/*-
- * ============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");
- 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;
-
- MsoRequest msoRequest = new MsoRequest(requestId);
- ObjectMapper mapper = new ObjectMapper();
- try {
- e2eSir = mapper.readValue(requestJSON, E2EServiceInstanceRequest.class);
-
- } catch (Exception e) {
-
- 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");
- 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;
- }
-
- //check for the current operation status
- Response resp = checkE2ESvcInstStatus(action, requestId, 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());
- 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;
- }
-
- String serviceInstanceType = e2eSir.getService().getServiceType();
-
- String serviceId = instanceIdMap.get("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.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());
- createOperationStatusRecordForError(action, requestId);
- 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());
- this.createOperationStatusRecordForError(action, requestId);
- return getBPMNResp;
- }
-
- ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
- int bpelStatus = respHandler.getStatus();
-
- return beplStatusUpdate(requestId, startTime, msoRequest, requestClient, respHandler, bpelStatus, action, instanceIdMap);
- }
-
- private Response checkE2ESvcInstStatus(Action action, String requestId, long startTime, MsoRequest msoRequest) {
- OperationStatus curStatus = null;
-// String instanceName = sir.getRequestDetails().getRequestInfo().getInstanceName();
- String requestScope = sir.getRequestDetails().getModelInfo().getModelType().name();
- try {
- if (!(requestId == null && "service".equals(requestScope) && (action == Action.updateInstance))) {
- curStatus = chkSvcInstOperStatusbySvcId(requestId);
- }
- } 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 + " (" + requestId + ") "
- + "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());
-
- createOperationStatusRecordForError(action, requestId);
-
- 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");
- 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 requestId, 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", requestId,
- 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 requestId) 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(requestId);
- 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;
- }
-}
+/*- + * ============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; + } +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java index 7be86fed9d..b809fc24c0 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/OrchestrationRequests.java @@ -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); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java index d8a6282a8a..45fc89bfc2 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstancesTest.java @@ -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 diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java index 27c94f0770..4fb5ebc1f8 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java @@ -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); } /** |