diff options
34 files changed, 755 insertions, 1695 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml b/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml index ff6f2378fa..749a319372 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml +++ b/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml @@ -14,7 +14,6 @@ mso: max-pool-size: 50 queue-capacity: 500 -# CatalogDB spring: datasource: jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb @@ -34,7 +33,7 @@ spring: fail-on-empty-beans: false flyway: baseline-on-migrate: false - jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb + url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb user: ${DB_ADMIN_USERNAME} password: ${DB_ADMIN_PASSWORD} outOfOrder: true diff --git a/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java b/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java index 6339616803..257ad3c023 100644 --- a/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java +++ b/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java @@ -67,7 +67,7 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro CloudConfig cloudConfig = null; // Try the override file - String configLocation = System.getProperty("spring.config.location"); + String configLocation = System.getProperty("spring.config.additional-location"); if (configLocation != null) { try (InputStream stream = new FileInputStream(Paths.get(configLocation).normalize().toString())) { cloudConfig = loadCloudConfig(stream); diff --git a/adapters/mso-openstack-adapters/src/main/resources/application.yaml b/adapters/mso-openstack-adapters/src/main/resources/application.yaml index 88099be07f..bc3bfba418 100644 --- a/adapters/mso-openstack-adapters/src/main/resources/application.yaml +++ b/adapters/mso-openstack-adapters/src/main/resources/application.yaml @@ -13,8 +13,7 @@ mso: core-pool-size: 50 max-pool-size: 50 queue-capacity: 500 - -# CatalogDB + spring: datasource: jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application.yaml index 4d200d25b8..af99a86e8e 100644 --- a/adapters/mso-requests-db-adapter/src/main/resources/application.yaml +++ b/adapters/mso-requests-db-adapter/src/main/resources/application.yaml @@ -46,7 +46,7 @@ spring: role: ACTUATOR flyway: baseline-on-migrate: false - jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb + url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb user: ${DB_ADMIN_USERNAME} password: ${DB_ADMIN_PASSWORD} diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtils.groovy index f1eab6601b..103326a693 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CatalogDbUtils.groovy @@ -22,17 +22,12 @@ package org.onap.so.bpmn.common.scripts import org.json.JSONObject; import org.json.JSONArray; -import org.json.XML import org.onap.logging.ref.slf4j.ONAPLogConstants import org.onap.so.bpmn.core.UrnPropertiesReader; import org.springframework.web.util.UriUtils; import org.onap.so.bpmn.core.json.JsonUtils import org.onap.so.client.HttpClient -import groovy.json.JsonBuilder -import groovy.json.JsonSlurper -import groovy.util.slurpersupport.GPathResult -import groovy.xml.QName; import javax.ws.rs.core.MediaType import javax.ws.rs.core.Response @@ -57,365 +52,6 @@ class CatalogDbUtils { JsonUtils jsonUtils = new JsonUtils() static private String defaultDbAdapterVersion = "v2" - public JSONArray getAllNetworksByServiceModelUuid(DelegateExecution execution, String serviceModelUuid) { - JSONArray networksList = null - String endPoint = "/serviceNetworks?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return networksList - } - - public JSONArray getAllNetworksByServiceModelUuid(DelegateExecution execution, String serviceModelUuid, String catalogUtilsVersion) { - JSONArray networksList = null - String endPoint = "/serviceNetworks?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - networksList = responseJson.getJSONArray("serviceNetworks") - } - else { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return networksList - } - - public JSONArray getAllNetworksByServiceModelInvariantUuid(DelegateExecution execution, String serviceModelInvariantUuid) { - JSONArray networksList = null - String endPoint = "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return networksList - } - - public JSONArray getAllNetworksByServiceModelInvariantUuid(DelegateExecution execution, String serviceModelInvariantUuid, String catalogUtilsVersion) { - JSONArray networksList = null - String endPoint = "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - networksList = responseJson.getJSONArray("serviceNetworks") - } - else { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return networksList - } - - public JSONArray getAllNetworksByServiceModelInvariantUuidAndServiceModelVersion(DelegateExecution execution, String serviceModelInvariantUuid, String serviceModelVersion) { - JSONArray networksList = null - String endPoint = "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return networksList - } - - public JSONArray getAllNetworksByServiceModelInvariantUuidAndServiceModelVersion(DelegateExecution execution, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { - JSONArray networksList = null - String endPoint = "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - networksList = responseJson.getJSONArray("serviceNetworks") - } - else { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return networksList - } - - public JSONArray getAllNetworksByNetworkModelCustomizationUuid(DelegateExecution execution, String networkModelCustomizationUuid) { - JSONArray networksList = null - String endPoint = "/serviceNetworks?networkModelCustomizationUuid=" + UriUtils.encode(networkModelCustomizationUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return networksList - } - - public JSONArray getAllNetworksByNetworkModelCustomizationUuid(DelegateExecution execution, String networkModelCustomizationUuid, String catalogUtilsVersion) { - JSONArray networksList = null - String endPoint = "/serviceNetworks?networkModelCustomizationUuid=" + UriUtils.encode(networkModelCustomizationUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - networksList = responseJson.getJSONArray("serviceNetworks") - } - else { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return networksList - } - - public JSONArray getAllNetworksByNetworkType(DelegateExecution execution, String networkType) { - JSONArray networksList = null - String endPoint = "/serviceNetworks?networkType=" + UriUtils.encode(networkType, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return networksList - } - - public JSONArray getAllNetworksByNetworkType(DelegateExecution execution, String networkType, String catalogUtilsVersion) { - JSONArray networksList = null - String endPoint = "/serviceNetworks?networkType=" + UriUtils.encode(networkType, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - networksList = responseJson.getJSONArray("serviceNetworks") - } - else { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return networksList - } - - - public JSONArray getAllVnfsByServiceModelUuid(DelegateExecution execution, String serviceModelUuid) { - JSONArray vnfsList = null - String endPoint = "/serviceVnfs?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") - try { - msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONArray getAllVnfsByServiceModelUuid(DelegateExecution execution, String serviceModelUuid, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = "/serviceVnfs?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") - try { - msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - vnfsList = responseJson.getJSONArray("serviceVnfs") - } - else { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONArray getAllVnfsByServiceModelInvariantUuid(DelegateExecution execution, String serviceModelInvariantUuid) { - JSONArray vnfsList = null - String endPoint ="/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") - try { - msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONArray getAllVnfsByServiceModelInvariantUuid(DelegateExecution execution, String serviceModelInvariantUuid, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = "/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") - try { - msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - vnfsList = responseJson.getJSONArray("serviceVnfs") - } - else { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONArray getAllVnfsByServiceModelInvariantUuidAndServiceModelVersion(DelegateExecution execution, String serviceModelInvariantUuid, String serviceModelVersion) { - JSONArray vnfsList = null - String endPoint = "/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") - try { - msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONArray getAllVnfsByServiceModelInvariantUuidAndServiceModelVersion(DelegateExecution execution, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = "/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") - try { - msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - vnfsList = responseJson.getJSONArray("serviceVnfs") - } - else { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - public JSONArray getAllVnfsByVnfModelCustomizationUuid(DelegateExecution execution, String vnfModelCustomizationUuid) { JSONArray vnfsList = null String endPoint = "/serviceVnfs?vnfModelCustomizationUuid=" + UriUtils.encode(vnfModelCustomizationUuid, "UTF-8") @@ -436,33 +72,6 @@ class CatalogDbUtils { return vnfsList } - /** - * This method gets a all vnfs for a particular - * service from the catalog database using the - * service model's model name. - * - * @param catalogDbEndpoint - * @param serviceModelModelName - * @return vnfsList * - * - */ - public JSONArray getAllVnfsByServiceModelModelName(DelegateExecution execution, String serviceModelModelName) { - JSONArray vnfsList = null - String endPoint = "/serviceVnfs?serviceModelName=" + UriUtils.encode(serviceModelModelName, "UTF-8") - try { - msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", defaultDbAdapterVersion) - } - }catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - return vnfsList - } - public JSONArray getAllVnfsByVnfModelCustomizationUuid(DelegateExecution execution, String vnfModelCustomizationUuid, String catalogUtilsVersion) { JSONArray vnfsList = null String endPoint = "/serviceVnfs?vnfModelCustomizationUuid=" + UriUtils.encode(vnfModelCustomizationUuid, "UTF-8") @@ -489,263 +98,6 @@ class CatalogDbUtils { return vnfsList } - /** - * This method gets a single vf module from - * the catalog database using the vf module's - * model name. It returns that vf module as - * a JSONObject - * - * @param catalogDbEndpoint - * @param vfModuleModelName - * @return vfModule - */ - public JSONObject getVfModuleByVfModuleModelName(DelegateExecution execution, String vfModuleModelName) { - JSONObject vfModule = null - String endPoint = "/vfModules?vfModuleModelName=" + UriUtils.encode(vfModuleModelName, "UTF-8") - try{ - msoLogger.debug("Get VfModule By VfModule ModelName Endpoint is: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - vfModule = parseVfModuleJson(catalogDbResponse, "vfModules", "v1") - } - } - catch(Exception e){ - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vfModule - } - - /** - * This method gets a single vf module from - * the catalog database using the vf module's - * model name. It returns that vf module as - * a JSONObject - * - * @param catalogDbEndpoint - * @param vfModuleModelName - * @param catalogUtilsVersion - * @return vfModules - */ - public JSONObject getVfModuleByVfModuleModelName(DelegateExecution execution, String vfModuleModelName, String catalogUtilsVersion) { - JSONObject vfModule = null - String endPoint = "/vfModules?vfModuleModelName=" + UriUtils.encode(vfModuleModelName, "UTF-8") - try{ - msoLogger.debug("Get VfModule By VfModule ModelName Endpoint is: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - vfModule = parseVfModuleJson(catalogDbResponse, "vfModules", "v1") - } - } - catch(Exception e){ - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vfModule - } - - - public JSONArray getAllottedResourcesByServiceModelUuid(DelegateExecution execution, String serviceModelUuid) { - JSONArray vnfsList = null - String endPoint = "/ServiceAllottedResources?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONArray getAllottedResourcesByServiceModelUuid(DelegateExecution execution, String serviceModelUuid, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = "/ServiceAllottedResources?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - vnfsList = responseJson.getJSONArray("serviceAllottedResources") - } - else { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONArray getAllottedResourcesByServiceModelInvariantUuid(DelegateExecution execution, String serviceModelInvariantUuid) { - JSONArray vnfsList = null - String endPoint = "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONArray getAllottedResourcesByServiceModelInvariantUuid(DelegateExecution execution, String serviceModelInvariantUuid, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - vnfsList = responseJson.getJSONArray() - } - else { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.getStackTrace()); - throw e - } - - return vnfsList - } - - public JSONArray getAllottedResourcesByServiceModelInvariantUuidAndServiceModelVersion(DelegateExecution execution, String serviceModelInvariantUuid, String serviceModelVersion) { - JSONArray vnfsList = null - String endPoint = "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONArray getAllottedResourcesByServiceModelInvariantUuidAndServiceModelVersion(DelegateExecution execution, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - vnfsList = responseJson.getJSONArray("serviceAllottedResources") - } - else { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - - public JSONArray getAllottedResourcesByArModelCustomizationUuid(DelegateExecution execution, String arModelCustomizationUuid) { - JSONArray vnfsList = null - String endPoint = "/serviceAllottedResources?serviceModelCustomizationUuid=" + UriUtils.encode(arModelCustomizationUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONArray getAllottedResourcesByArModelCustomizationUuid(DelegateExecution execution, String arModelCustomizationUuid, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = "/serviceAllottedResources?serviceModelCustomizationUuid=" + UriUtils.encode(arModelCustomizationUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - if (!catalogUtilsVersion.equals("v1")) { - JSONObject responseJson = new JSONObject(catalogDbResponse) - vnfsList = responseJson.getJSONArray("serviceAllottedResources") - } - else { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) - } - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return vnfsList - } - - public JSONObject getServiceResourcesByServiceModelUuid(DelegateExecution execution, String serviceModelUuid) { - JSONObject resources = null - String endPoint = "/serviceResources?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - - resources = parseServiceResourcesJson(catalogDbResponse, "v1") - } - - } - catch (Exception e) { - utils.log("ERROR", "Exception in Querying Catalog DB: " + e.message) - throw e - } - - return resources - } - public JSONObject getServiceResourcesByServiceModelUuid(DelegateExecution execution, String serviceModelUuid, String catalogUtilsVersion) { JSONObject resources = null String endPoint = "/serviceResources?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") @@ -769,26 +121,6 @@ class CatalogDbUtils { return resources } - public JSONObject getServiceResourcesByServiceModelInvariantUuid(DelegateExecution execution, String serviceModelInvariantUuid) { - JSONObject resources = null - String endPoint = "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - - resources = parseServiceResourcesJson(catalogDbResponse, "v1") - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return resources - } - public String getServiceResourcesByServiceModelInvariantUuidString(DelegateExecution execution, String serviceModelInvariantUuid) { String resources = null String endPoint = "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") @@ -833,27 +165,6 @@ class CatalogDbUtils { return resources } - - public JSONObject getServiceResourcesByServiceModelInvariantUuidAndServiceModelVersion(DelegateExecution execution, String serviceModelInvariantUuid, String serviceModelVersion) { - JSONObject resources = null - String endPoint = "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") - try { - String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - - if (catalogDbResponse != null) { - //TODO this is wrong - resources = parseServiceResourcesJson(catalogDbResponse) - } - - } - catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in Querying Catalog DB", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - throw e - } - - return resources - } - public JSONObject getServiceResourcesByServiceModelInvariantUuidAndServiceModelVersion(DelegateExecution execution, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { JSONObject resources = null String endPoint = "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") @@ -878,8 +189,6 @@ class CatalogDbUtils { return resources } - - private JSONArray parseNetworksJson (String catalogDbResponse, String arrayName, String catalogUtilsVersion) { JSONArray modelInfos = null @@ -1004,58 +313,6 @@ class CatalogDbUtils { return modelInfos } - /** - * This method parses a Vf Module from the - * Vf Modules array - * - * @param catalogDbResponse - * @param arrayName - * @param catalogUtilsVersion - * @return vfModulelJson - */ - private JSONObject parseVfModuleJson (String catalogDbResponse, String arrayName, String catalogUtilsVersion) { - JSONObject vfModulelJson = new JSONObject() - msoLogger.debug("Started Parse Vf Module Json") - try { - JSONObject responseJson = new JSONObject(catalogDbResponse) - JSONArray vfModules = responseJson.getJSONArray(arrayName) - if(vfModules != null){ - JSONObject vfModuleInfo = new JSONObject() - for (int i = 0; i < vfModules.length(); i++) { - JSONObject vfModule = vfModules.getJSONObject(i) - JSONObject vfModuleModelInfo = buildModelInfo("vfModule", vfModule, catalogUtilsVersion) - vfModulelJson.put("modelInfo", vfModuleModelInfo) - String vfModuleType = jsonUtils.getJsonValueForKey(vfModule, "type") - vfModulelJson.put("vfModuleType", vfModuleType) - switch(catalogUtilsVersion) { - case "v1": - Integer isBase = jsonUtils.getJsonIntValueForKey(vfModule, "isBase") - if (isBase.intValue() == 1) { - vfModulelJson.put("isBase", "true") - } - else { - vfModulelJson.put("isBase", "false") - } - break - default: - boolean isBase = jsonUtils.getJsonBooleanValueForKey(vfModule, "isBase") - vfModulelJson.put("isBase", isBase) - break - } - String vfModuleLabel = jsonUtils.getJsonValueForKey(vfModule, "label") - vfModulelJson.put("vfModuleLabel", vfModuleLabel) - Integer initialCount = jsonUtils.getJsonIntValueForKey(vfModule, "initialCount") - vfModulelJson.put("initialCount", initialCount.intValue()) - } - } - msoLogger.debug("Completed Parsing Vf Module: " + vfModulelJson.toString()) - }catch (Exception e){ - msoLogger.debug("Exception while parsing Vf Modules from Catalog DB Response: " + e.message) - } - - return vfModulelJson - } - private JSONArray parseAllottedResourcesJson (String catalogDbResponse, String arrayName, String catalogUtilsVersion) { JSONArray modelInfos = null @@ -1108,37 +365,9 @@ class CatalogDbUtils { return modelInfos } - //TODO this is wrong - private JSONObject parseServiceResourcesJson (String catalogDbResponse) { - JSONObject serviceResources = new JSONObject() - String catalogUtilsVersion = "v1" - - try { - // Create array of jsons - - JSONObject responseJson = new JSONObject(catalogDbResponse) - JSONObject serviceResourcesRoot = responseJson.getJSONObject("serviceResources") - JSONArray vnfsArray = parseVnfsJson(serviceResourcesRoot.toString(), "vnfResources", catalogUtilsVersion) - serviceResources.put("vnfs", vnfsArray) - JSONArray networksArray = parseNetworksJson(serviceResourcesRoot.toString(), "networkResourceCustomization", catalogUtilsVersion) - serviceResources.put("networks", networksArray) - JSONArray allottedResourcesArray = parseAllottedResourcesJson(serviceResourcesRoot.toString(), "allottedResourceCustomization", catalogUtilsVersion) - serviceResources.put("allottedResources", allottedResourcesArray) - - String serviceResourcesString = serviceResources.toString() - msoLogger.debug("Returning serviceResources JSON: " + serviceResourcesString) - - } catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in parsing Catalog DB Response", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); - } - - return serviceResources - } - private JSONObject parseServiceResourcesJson (String catalogDbResponse, String catalogUtilsVersion) { JSONObject serviceResources = new JSONObject() JSONObject serviceResourcesObject = new JSONObject() - String serviceResourcesString = "" try { // Create array of jsons @@ -1154,9 +383,7 @@ class CatalogDbUtils { JSONArray allottedResourcesArray = parseAllottedResourcesJson(serviceResourcesRoot.toString(), "serviceAllottedResources", catalogUtilsVersion) serviceResources.put("serviceAllottedResources", allottedResourcesArray) serviceResourcesObject.put("serviceResources", serviceResources) - - serviceResourcesString = serviceResourcesObject.toString() - msoLogger.debug("Returning serviceResources JSON: " + serviceResourcesString) + msoLogger.debug("Returning serviceResources JSON: " + serviceResourcesObject.toString()) } catch (Exception e) { msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception in parsing Catalog DB Response", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.message); diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy index 5c935e9081..250cdda0a1 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtil.groovy @@ -19,29 +19,30 @@ */ package org.onap.so.bpmn.common.scripts -import org.camunda.bpm.engine.delegate.BpmnError + + import org.camunda.bpm.engine.delegate.DelegateExecution -import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor; +import org.onap.logging.ref.slf4j.ONAPLogConstants import org.onap.so.client.HttpClient +import org.onap.so.client.HttpClientFactory import org.onap.so.logger.MsoLogger -import org.apache.commons.lang3.StringEscapeUtils -import java.util.regex.Matcher -import java.util.regex.Pattern +import org.onap.so.utils.TargetEntity import javax.ws.rs.core.MediaType import javax.ws.rs.core.Response -import org.onap.so.utils.TargetEntity +import java.util.regex.Matcher +import java.util.regex.Pattern class ExternalAPIUtil { String Prefix="EXTAPI_" - public MsoUtils utils = new MsoUtils() - - ExceptionUtil exceptionUtil = new ExceptionUtil() - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ExternalAPIUtil.class) + private final HttpClientFactory httpClientFactory; + private final MsoUtils utils; + private final ExceptionUtil exceptionUtil; + public static final String PostServiceOrderRequestsTemplate = "{\n" + "\t\"externalId\": <externalId>,\n" + @@ -85,7 +86,10 @@ class ExternalAPIUtil { "\t} \n" + "}" - public ExternalAPIUtil() { + ExternalAPIUtil(HttpClientFactory httpClientFactory, MsoUtils utils, ExceptionUtil exceptionUtil) { + this.httpClientFactory = httpClientFactory + this.utils = utils + this.exceptionUtil = exceptionUtil } // public String getUri(DelegateExecution execution, resourceName) { @@ -137,8 +141,7 @@ class ExternalAPIUtil { msoLogger.debug( "Generated uuid is: " + uuid) msoLogger.debug( "URL to be used is: " + url) - URL Url = new URL(url) - HttpClient client = new HttpClient(Url, MediaType.APPLICATION_JSON, TargetEntity.EXTERNAL) + HttpClient client = httpClientFactory.create(new URL(url), MediaType.APPLICATION_JSON, TargetEntity.EXTERNAL) client.addBasicAuthHeader(execution.getVariable("URN_externalapi_auth"), execution.getVariable("URN_mso_msoKey")) client.addAdditionalHeader("X-FromAppId", "MSO") client.addAdditionalHeader(ONAPLogConstants.Headers.REQUEST_ID, uuid) @@ -166,17 +169,15 @@ class ExternalAPIUtil { * @return Response * */ - public Response executeExternalAPIPostCall(DelegateExecution execution, String urlString, String payload){ + public Response executeExternalAPIPostCall(DelegateExecution execution, String url, String payload){ msoLogger.debug( " ======== Started Execute ExternalAPI Post Process ======== ") Response apiResponse = null try{ String uuid = utils.getRequestID() msoLogger.debug( "Generated uuid is: " + uuid) - msoLogger.debug( "URL to be used is: " + urlString) - - URL url = new URL(urlString); + msoLogger.debug( "URL to be used is: " + url) - HttpClient httpClient = new HttpClient(url, "application/json", TargetEntity.AAI) + HttpClient httpClient = httpClientFactory.create(new URL(url), MediaType.APPLICATION_JSON, TargetEntity.AAI) httpClient.addBasicAuthHeader(execution.getVariable("URN_externalapi_auth"), execution.getVariable("URN_mso_msoKey")) httpClient.addAdditionalHeader("X-FromAppId", "MSO") httpClient.addAdditionalHeader("X-TransactionId", uuid) diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy new file mode 100644 index 0000000000..e7f46464ee --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilFactory.groovy @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2018 Nokia. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.bpmn.common.scripts + +import org.onap.so.client.HttpClientFactory + +class ExternalAPIUtilFactory { + + ExternalAPIUtil create() { + return new ExternalAPIUtil(new HttpClientFactory(), new MsoUtils(), new ExceptionUtil()) + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy index f9ddd0d430..2f240fb70d 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/MsoUtils.groovy @@ -287,14 +287,6 @@ class MsoUtils { return null } } - def getRelationshipVal(node, name){ - try{ - return node.'**'.find {it.'relationship-key'.text() == name}.'relationship-value'.text() - }catch(Exception e){ - return null - } - } - def log(logmode,logtxt,isDebugLogEnabled="false"){ if ("INFO"==logmode) { diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/NetworkUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/NetworkUtils.groovy index 27d067dfc1..41db603cdf 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/NetworkUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/NetworkUtils.groovy @@ -26,7 +26,6 @@ import org.onap.aai.domain.yang.L3Network import org.onap.aai.domain.yang.Subnet import org.onap.aai.domain.yang.Subnets import org.onap.so.bpmn.core.UrnPropertiesReader -import org.onap.so.logger.MsoLogger import org.w3c.dom.Document import org.w3c.dom.Element import org.w3c.dom.Node @@ -44,8 +43,6 @@ import javax.xml.transform.stream.StreamResult * This groovy class supports the any Network processes that need the methods defined here. */ class NetworkUtils { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NetworkUtils.class); - public MsoUtils utils = new MsoUtils() private AbstractServiceTaskProcessor taskProcessor @@ -283,187 +280,6 @@ class NetworkUtils { } /** - * This method returns the string for Create Volume Request payload - * @param groupId the volume-group-id - * @param volumeName the volume-group-name - * @param vnfType the vnf-type - * @param tenantId the value of relationship-key 'tenant.tenant-id' - * @return String request payload - */ - def String CreateNetworkVolumeRequest(groupId, volumeName, vnfType, tenantId) { - - String requestPayload = - """<volume-group xmlns="http://org.onap.so/v6"> - <volume-group-id>${MsoUtils.xmlEscape(groupId)}</volume-group-id> - <volume-group-name>${MsoUtils.xmlEscape(volumeName)}</volume-group-name> - <heat-stack-id></heat-stack-id> - <vnf-type>${MsoUtils.xmlEscape(vnfType)}</vnf-type> - <orchestration-status>Pending</orchestration-status> - <relationship-list> - <relationship> - <related-to>tenant</related-to> - <relationship-data> - <relationship-key>tenant.tenant-id</relationship-key> - <relationship-value>${MsoUtils.xmlEscape(tenantId)}</relationship-value> - </relationship-data> - </relationship> - </relationship-list> - </volume-group>""" - - return requestPayload - } - - /** - * This method returns the string for Update Volume Request payload - * @param requeryAAIVolGrpNameResponse the response of query volume group name (in AAI) - * @param heatStackId the value of heat stack id - * @return String request payload - */ - def String updateCloudRegionVolumeRequest(requeryAAIVolGrpNameResponse, heatStackId, namespace, modelCustomizationId) { - String requestPayload = "" - if (requeryAAIVolGrpNameResponse != null) { - def groupId = utils.getNodeText(requeryAAIVolGrpNameResponse, "volume-group-id") - def volumeName = utils.getNodeText(requeryAAIVolGrpNameResponse, "volume-group-name") - def vnfType = utils.getNodeText(requeryAAIVolGrpNameResponse, "vnf-type") - def resourceVersion = utils.getNodeText(requeryAAIVolGrpNameResponse, "resource-version") - def relationshipList = "" - if (utils.nodeExists(requeryAAIVolGrpNameResponse, "relationship")) { - relationshipList = rebuildRelationship(requeryAAIVolGrpNameResponse) - } - - requestPayload = - """<volume-group xmlns="${namespace}"> - <volume-group-id>${MsoUtils.xmlEscape(groupId)}</volume-group-id> - <volume-group-name>${MsoUtils.xmlEscape(volumeName)}</volume-group-name> - <heat-stack-id>${MsoUtils.xmlEscape(heatStackId)}</heat-stack-id> - <vnf-type>${MsoUtils.xmlEscape(vnfType)}</vnf-type> - <orchestration-status>Active</orchestration-status> - <resource-version>${MsoUtils.xmlEscape(resourceVersion)}</resource-version> - <vf-module-model-customization-id>${MsoUtils.xmlEscape(modelCustomizationId)}</vf-module-model-customization-id> - ${relationshipList} - </volume-group>""" - } - - return requestPayload - } - - - /** - * This method returns the string for Update Volume Request payload - * @param requeryAAIVolGrpNameResponse the response of query volume group name (in AAI) - * @param heatStackId the value of heat stack id - * @return String request payload - */ - def String UpdateNetworkVolumeRequest(requeryAAIVolGrpNameResponse, heatStackId) { - String requestPayload = "" - if (requeryAAIVolGrpNameResponse != null) { - def groupId = utils.getNodeText(requeryAAIVolGrpNameResponse, "volume-group-id") - def volumeName = utils.getNodeText(requeryAAIVolGrpNameResponse, "volume-group-name") - def vnfType = utils.getNodeText(requeryAAIVolGrpNameResponse, "vnf-type") - def resourceVersion = utils.getNodeText(requeryAAIVolGrpNameResponse, "resource-version") - def relationshipList = "" - if (utils.nodeExists(requeryAAIVolGrpNameResponse, "relationship")) { - relationshipList = rebuildRelationship(requeryAAIVolGrpNameResponse) - } - - requestPayload = - """<volume-group xmlns="http://org.onap.so/v6"> - <volume-group-id>${MsoUtils.xmlEscape(groupId)}</volume-group-id> - <volume-group-name>${MsoUtils.xmlEscape(volumeName)}</volume-group-name> - <heat-stack-id>${MsoUtils.xmlEscape(heatStackId)}</heat-stack-id> - <vnf-type>${MsoUtils.xmlEscape(vnfType)}</vnf-type> - <orchestration-status>Active</orchestration-status> - <resource-version>${MsoUtils.xmlEscape(resourceVersion)}</resource-version> - ${relationshipList} - </volume-group>""" - } - - return requestPayload - } - - /** - * This method returns the string for Create Contrail Network payload - * @param requeryIdAAIResponse the response from AAI query by id - * @param createNetworkResponse the response of create network - * @return String contrailNetworkCreatedUpdate - */ - def ContrailNetworkCreatedUpdate(requeryIdAAIResponse, createNetworkResponse, schemaVersion) { - - String contrailNetworkCreatedUpdate = "" - if(requeryIdAAIResponse!=null && createNetworkResponse!=null) { - - def l3Network = utils.getNodeXml(requeryIdAAIResponse, "l3-network", false).replace("tag0:","").replace(":tag0","") - def createNetworkContrailResponse = "" - if (utils.nodeExists(createNetworkResponse, 'createNetworkResponse')) { - createNetworkContrailResponse = utils.getNodeXml(createNetworkResponse, "createNetworkResponse", false).replace("tag0:","").replace(":tag0","") - } else { - createNetworkContrailResponse = utils.getNodeXml(createNetworkResponse, "updateNetworkContrailResponse", false).replace("tag0:","").replace(":tag0","") - } - - // rebuild network - def networkList = ["network-id", "network-name", "network-type", "network-role", "network-technology", "neutron-network-id", "is-bound-to-vpn", "service-id", "network-role-instance", "resource-version", "resource-model-uuid", "orchestration-status", "heat-stack-id", "mso-catalog-key", "contrail-network-fqdn", - "physical-network-name", "is-provider-network", "is-shared-network", "is-external-network"] - String rebuildNetworkElements = buildNetworkElements(l3Network, createNetworkContrailResponse, networkList) - - // rebuild 'subnets' - def rebuildSubnetList = "" - if (utils.nodeExists(requeryIdAAIResponse, 'subnet')) { - rebuildSubnetList = buildSubnets(requeryIdAAIResponse, createNetworkResponse) - } - - // rebuild 'segmentation-assignments' - def rebuildSegmentationAssignments = "" - if (utils.nodeExists(requeryIdAAIResponse, 'segmentation-assignments')) { - List elementList = ["segmentation-id", "resource-version"] - if (utils.nodeExists(requeryIdAAIResponse, 'segmentation-assignment')) { // new tag - rebuildSegmentationAssignments = buildXMLElements(requeryIdAAIResponse, "segmentation-assignments", "segmentation-assignment", elementList) - } else { - rebuildSegmentationAssignments = buildXMLElements(requeryIdAAIResponse, "", "segmentation-assignments", elementList) - } - } - - // rebuild 'ctag-assignments' / rebuildCtagAssignments - def rebuildCtagAssignmentsList = "" - if (utils.nodeExists(requeryIdAAIResponse, 'ctag-assignment')) { - rebuildCtagAssignmentsList = rebuildCtagAssignments(requeryIdAAIResponse) - } - - // rebuild 'relationship' - def relationshipList = "" - if (utils.nodeExists(requeryIdAAIResponse, 'relationship-list')) { - String rootRelationshipData = getFirstNodeXml(requeryIdAAIResponse, "relationship-list").drop(38).trim().replace("tag0:","").replace(":tag0","") - if (utils.nodeExists(rootRelationshipData, 'relationship')) { - relationshipList = rebuildRelationship(rootRelationshipData) - } - } - - //Check for optional contrail network fqdn within CreateNetworkResponse - String contrailNetworkFQDN - if(utils.nodeExists(createNetworkResponse, "contrail-network-fqdn")){ - contrailNetworkFQDN = utils.getNodeXml(createNetworkResponse, "contrail-network-fqdn") - contrailNetworkFQDN = utils.removeXmlNamespaces(contrailNetworkFQDN) - contrailNetworkFQDN = utils.removeXmlPreamble(contrailNetworkFQDN) - }else{ - contrailNetworkFQDN = "" - } - - contrailNetworkCreatedUpdate = - """<l3-network xmlns="${schemaVersion}"> - ${rebuildNetworkElements} - ${rebuildSubnetList} - ${rebuildSegmentationAssignments} - ${rebuildCtagAssignmentsList} - ${relationshipList} - ${contrailNetworkFQDN} - </l3-network>""".trim() - - } - return contrailNetworkCreatedUpdate - } - - - - /** * This method returns the value for the name paramName. * Ex: <network-params> * <param name="shared">1</param> @@ -570,56 +386,6 @@ class NetworkUtils { } /** - * This method returns the uri value for the vpn bindings. - * Return the a list of value of vpn binding in the <related-link> string. - * Ex. - * <relationship-list> - * <relationship> - * <related-to>vpn-binding</related-to> - * <related-link>https://aai-app-e2e.test.openecomp.com:8443/aai/v6/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/</related-link> - * <relationship-data> - * <relationship-key>vpn-binding.vpn-id</relationship-key> - * <relationship-value>85f015d0-2e32-4c30-96d2-87a1a27f8017</relationship-value> - * </relationship-data> - * </relationship> - * <relationship> - * <related-to>vpn-binding</related-to> - * <related-link>https://aai-ext1.test.openecomp.com:8443/aai/v6/network/vpn-bindings/vpn-binding/24a4b507-853a-4a38-99aa-05fcc54be24d/</related-link> - * <relationship-data> - * <relationship-key>vpn-binding.vpn-id</relationship-key> - * <relationship-value>24a4b507-853a-4a38-99aa-05fcc54be24d</relationship-value> - * </relationship-data> - * <related-to-property> - * <property-key>vpn-binding.vpn-name</property-key> - * <property-value>oam_protected_net_6_MTN5_msotest1</property-value> - * </related-to-property> - * </relationship> - * @param xmlInput the XML document - * @return a list of vpn binding values - * ex: ['aai/v6/network/vpn-bindings/vpn-binding/85f015d0-2e32-4c30-96d2-87a1a27f8017/', 'aai/v6/network/vpn-bindings/vpn-binding/c980a6ef-3b88-49f0-9751-dbad8608d0a6/'] - * - **/ - def getVnfBindingObject(xmlInput) { - //def rtn = null - List rtn = [] - if (xmlInput!=null) { - def relationshipList = getListWithElements(xmlInput, 'relationship') - def relationshipListSize = relationshipList.size() - if (relationshipListSize > 0) { - for (i in 0..relationshipListSize-1) { - def relationshipXml = XmlUtil.serialize(relationshipList[i]) - if (utils.getNodeText(relationshipXml, 'related-to') == "vpn-binding") { - def relatedLink = utils.getNodeText(relationshipXml, 'related-link') - if (relatedLink != null || relatedLink != "") { - rtn.add(relatedLink.substring(relatedLink.indexOf("/aai/"), relatedLink.length())) - } - } - } - } - } - return rtn - } - /** * similar to VNF bindings method * @param xmlInput the XML document * @return a list of network policy values @@ -845,40 +611,6 @@ class NetworkUtils { return xmlNetwork } - def buildSubnets(requeryIdAAIResponse, createNetworkResponse) { - def rebuildingSubnets = "" - if (requeryIdAAIResponse != null && utils.nodeExists(requeryIdAAIResponse, 'subnets')) { - def subnetIdMapValue = "" - def subnetsGroup = utils.getNodeXml(requeryIdAAIResponse, "subnets", false) - def subnetsData = new XmlSlurper().parseText(subnetsGroup) - rebuildingSubnets += "<subnets>" - try { - def subnets = subnetsData.'**'.findAll {it.name() == "subnet"} - def subnetsSize = subnets.size() - for (i in 0..subnetsSize-1) { - def subnet = subnets[i] - def subnetXml = XmlUtil.serialize(subnet) - def orchestrationStatus = utils.getNodeText(subnetXml, "orchestration-status") - if (orchestrationStatus == "PendingDelete" || orchestrationStatus == "pending-delete") { - // skip, do not include in processing, remove!!! - } else { - def subnetList = ["subnet-id", "neutron-subnet-id", "gateway-address", "network-start-address", "cidr-mask", "ip-version", "orchestration-status", "dhcp-enabled", "dhcp-start", "dhcp-end", "subnet-role", "resource-version", "subnet-name", "ip-assignment-direction", "host-routes"] - rebuildingSubnets += buildSubNetworkElements(subnetXml, createNetworkResponse, subnetList, "subnet") - } - } - if (utils.nodeExists(subnetsData, 'relationship')) { - rebuildingSubnets = rebuildRelationship(requeryIdAAIResponse) - } - - } catch (Exception ex) { - // error - } finally { - rebuildingSubnets += "</subnets>" - } - } - return rebuildingSubnets - } - def buildSubnets(L3Network network) { def rebuildingSubnets = "" Subnets subnets = network.getSubnets() @@ -1056,74 +788,6 @@ class NetworkUtils { } - // rebuild ctag-assignments - def rebuildCtagAssignments(xmlInput) { - def rebuildingCtagAssignments = "" - if (xmlInput!=null) { - def ctagAssignmentsData = new XmlSlurper().parseText(xmlInput) - rebuildingCtagAssignments += "<ctag-assignments>" - def ctagAssignments = ctagAssignmentsData.'**'.findAll {it.name() == "ctag-assignment"} - def ctagAssignmentsSize = ctagAssignments.size() - for (i in 0..ctagAssignmentsSize-1) { - def ctagAssignment = ctagAssignments[i] - def ctagAssignmentXml = XmlUtil.serialize(ctagAssignment) - rebuildingCtagAssignments += "<ctag-assignment>" - List elementList = ["vlan-id-inner", "resource-version"] - rebuildingCtagAssignments += buildXMLElements(ctagAssignmentXml, "" , "", elementList) - if (utils.nodeExists(ctagAssignmentXml, 'relationship')) { - rebuildingCtagAssignments += rebuildRelationship(ctagAssignmentXml) - } - rebuildingCtagAssignments += "</ctag-assignment>" - } - rebuildingCtagAssignments += "</ctag-assignments>" - } - return rebuildingCtagAssignments - } - - // rebuild 'relationship-list' - def rebuildRelationship(xmlInput) { - def rebuildingSubnets = "" - if (xmlInput!=null) { - def subnetsData = new XmlSlurper().parseText(xmlInput) - rebuildingSubnets += "<relationship-list>" - def relationships = subnetsData.'**'.findAll {it.name() == "relationship"} - def relationshipsSize = relationships.size() - for (i in 0..relationshipsSize-1) { - def relationship = relationships[i] - def relationshipXml = XmlUtil.serialize(relationship) - rebuildingSubnets += "<relationship>" - def relationshipList = ["related-to", "related-link"] - rebuildingSubnets += buildSubNetworkElements(relationshipXml, "", relationshipList, "") - if (utils.nodeExists(relationshipXml, 'relationship-data')) { - def relationshipDataXmlData = new XmlSlurper().parseText(relationshipXml) - def relationshipsData = relationshipDataXmlData.'**'.findAll {it.name() == "relationship-data"} - def relationshipsDataSize = relationshipsData.size() - for (j in 0..relationshipsDataSize-1) { - def relationshipData = relationshipsData[j] - def relationshipDataXml = XmlUtil.serialize(relationshipData) - def relationshipDataList = ["relationship-key", "relationship-value"] - rebuildingSubnets += buildXMLElements(relationshipDataXml, "", "relationship-data", relationshipDataList) - } - } - if (utils.nodeExists(relationshipXml, 'related-to-property')) { - def relationshipDataXmlData = new XmlSlurper().parseText(relationshipXml) - def relationshipsData = relationshipDataXmlData.'**'.findAll {it.name() == "related-to-property"} - def relationshipsDataSize = relationshipsData.size() - for (j in 0..relationshipsDataSize-1) { - def relationshipData = relationshipsData[j] - def relationshipDataXml = XmlUtil.serialize(relationshipData) - def relationshipDataList = ["property-key", "property-value"] - rebuildingSubnets += buildXMLElements(relationshipDataXml, "", "related-to-property", relationshipDataList) - } - } - - rebuildingSubnets += "</relationship>" - } - rebuildingSubnets += "</relationship-list>" - } - return rebuildingSubnets - } - def buildVlans(queryIdResponse) { def rebuildingSubnets = "<vlans>" def subnetsData = new XmlSlurper().parseText(queryIdResponse) diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy index d7fc6ac995..0cefae526e 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy @@ -207,7 +207,10 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor { URL url = new URL(sdncAdapterUrl); - HttpClient httpClient = new HttpClient(url, "application/json", TargetEntity.SDNC_ADAPTER) + HttpClient httpClient = new HttpClient(url, "application/json", TargetEntity.SDNC_ADAPTER) + httpClient.addAdditionalHeader("X-ONAP-RequestID", execution.getVariable("mso-request-id")) + httpClient.addAdditionalHeader("X-ONAP-InvocationID", UUID.randomUUID().toString()) + httpClient.addAdditionalHeader("X-ONAP-PartnerName", "SO-SDNCAdapter") httpClient.addAdditionalHeader("mso-request-id", execution.getVariable("mso-request-id")) httpClient.addAdditionalHeader("mso-service-instance-id", execution.getVariable("mso-service-instance-id")) httpClient.addAdditionalHeader("Authorization", execution.getVariable(prefix + "basicAuthHeaderValue")) diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy index 6691a82352..a6568fb80a 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy @@ -174,14 +174,12 @@ public class UpdateAAIVfModule extends AbstractServiceTaskProcessor { personaModelVersionEntry = updateVfModuleNode(origRequest, 'persona-model-version') } String contrailServiceInstanceFqdnEntry = updateVfModuleNode(origRequest, 'contrail-service-instance-fqdn') - def payload = """ - { ${orchestrationStatusEntry} - ${heatStackIdEntry} - ${personaModelVersionEntry} - ${contrailServiceInstanceFqdnEntry} - "vf-module-id": "${vfModuleId}" - } - """ + org.onap.aai.domain.yang.VfModule payload = new org.onap.aai.domain.yang.VfModule(); + payload.setVfModuleId(vfModuleId) + payload.setOrchestrationStatus(orchestrationStatusEntry) + payload.setHeatStackId(heatStackIdEntry) + payload.setPersonaModelVersion(personaModelVersionEntry) + payload.setContrailServiceInstanceFqdn(contrailServiceInstanceFqdnEntry) try { AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId) @@ -210,87 +208,19 @@ public class UpdateAAIVfModule extends AbstractServiceTaskProcessor { private String updateVfModuleNode(String origRequest, String elementName) { if (!utils.nodeExists(origRequest, elementName)) { - return "" + return null } def elementValue = utils.getNodeText(origRequest, elementName) if (elementValue.equals('DELETE')) { - // Set the element being deleted to null - return """"${elementName}": null,""" + // Set the element being deleted to empty string + return "" } else { - return """"${elementName}": "${elementValue}",""" + return elementValue } } - - /** - * Check the Volume Group ID from the incoming update request against the Volume Group ID from the - * given VF Module. If they are equal or if they are both 'null', then that is acceptable and 'null' - * is returned. Otherwise a message describing how the values are unacceptable/incompatible is returned. - * - * @param origRequest Incoming update request with VF Module elements to be updated. - * @param vfModuleNode VF Module (as a Node) retrieved from AAI. - * @param isDebugLogEnabled Is DEBUG log enabled? - * @return 'null' if the Volume Group IDs are acceptable. Otherwise return a message describing how the - * values are unacceptable/incompatible. - */ - private String checkVolumeGroupId(String origRequest, Node vfModuleNode, String isDebugLogEnabled) { - def requestVolumeGroupId = utils.getNodeText(origRequest, 'volume-group-id') - def currVolumeGroupId = getCurrVolumeGroupId(vfModuleNode) - - msoLogger.debug('Check volume-group-id: volume-group-id in original request is \'' + requestVolumeGroupId + '\', volume-group-id from VF Module is \'' + currVolumeGroupId + '\'') - - def result = null - - if (requestVolumeGroupId == null) { - if (currVolumeGroupId == null) { - // This is OK - } else { - result = 'Cannot detach a volume group from an existing VF Module' - } - } else { - if (currVolumeGroupId == null) { - result = 'Cannot add a volume gruop to an existing VF Module' - } else { - if (!requestVolumeGroupId.equals(currVolumeGroupId)) { - result = 'Cannot change the volume group on an existing VF Module' - } - } - } - - return result - } - - /** - * Find and return the value of the Volume Group ID for the specified VF Module. If - * the value of the Volume Group ID cannot be found for any reason, 'null' is returned. - * - * @param vfModuleNode VF Module (as a Node) retrieved from AAI. - * @return the value of the Volume Group ID for the specified VF Module. If the - * value of the Volume Group ID cannot be found for any reason, 'null' is returned. - */ - private String getCurrVolumeGroupId(Node vfModuleNode) { - def Node relationshipList = utils.getChildNode(vfModuleNode, 'relationship-list') - if (relationshipList == null) { - return null - } - def NodeList relationships = utils.getIdenticalChildren(relationshipList, 'relationship') - for (Node relationshipNode in relationships) { - def String relatedTo = utils.getChildNodeText(relationshipNode, 'related-to') - if ((relatedTo != null) && relatedTo.equals('volume-group')) { - def NodeList relationshipDataList = utils.getIdenticalChildren(relationshipNode, 'relationship-data') - for (Node relationshipDataNode in relationshipDataList) { - def String relationshipKey = utils.getChildNodeText(relationshipDataNode, 'relationship-key') - if ((relationshipKey != null) && relationshipKey.equals('volume-group.volume-group-id')) { - return utils.getChildNodeText(relationshipDataNode, 'relationship-value') - } - } - } - } - return null - } - /** * Generates a WorkflowException if the AAI query returns a response code other than 200. * diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VfModuleBase.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VfModuleBase.groovy index fec140da33..c1cd42e893 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VfModuleBase.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VfModuleBase.groovy @@ -20,16 +20,9 @@ package org.onap.so.bpmn.common.scripts; -import java.io.ObjectInputStream.BlockDataInputStream - -import java.io.ObjectInputStream.BlockDataInputStream - -//import groovy.util.Node; - import javax.xml.parsers.DocumentBuilder import javax.xml.parsers.DocumentBuilderFactory -import org.apache.commons.lang3.* import org.w3c.dom.Document import org.w3c.dom.Element import org.w3c.dom.Node @@ -38,9 +31,6 @@ import org.xml.sax.InputSource import org.onap.so.logger.MessageEnum import org.onap.so.logger.MsoLogger - - - public abstract class VfModuleBase extends AbstractServiceTaskProcessor { private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VfModuleBase.class); @@ -195,39 +185,7 @@ public abstract class VfModuleBase extends AbstractServiceTaskProcessor { } return entries } - - /** - * Extract the Tenant Id from the Volume Group information returned by AAI. - * - * @param volumeGroupXml Volume Group XML returned by AAI. - * @return the Tenant Id extracted from the Volume Group information. 'null' is returned if - * the Tenant Id is missing or could not otherwise be extracted. - */ - protected String getTenantIdFromVolumeGroup(String volumeGroupXml) { - def groovy.util.Node volumeGroupNode = xmlParser.parseText(volumeGroupXml) - def groovy.util.Node relationshipList = utils.getChildNode(volumeGroupNode, 'relationship-list') - if (relationshipList != null) { - def groovy.util.NodeList relationships = utils.getIdenticalChildren(relationshipList, 'relationship') - for (groovy.util.Node relationship in relationships) { - def groovy.util.Node relatedTo = utils.getChildNode(relationship, 'related-to') - if ((relatedTo != null) && (relatedTo.text().equals('tenant'))) { - def groovy.util.NodeList relationshipDataList = utils.getIdenticalChildren(relationship, 'relationship-data') - for (groovy.util.Node relationshipData in relationshipDataList) { - def groovy.util.Node relationshipKey = utils.getChildNode(relationshipData, 'relationship-key') - if ((relationshipKey != null) && (relationshipKey.text().equals('tenant.tenant-id'))) { - def groovy.util.Node relationshipValue = utils.getChildNode(relationshipData, 'relationship-value') - if (relationshipValue != null) { - return relationshipValue.text() - } - } - } - } - } - } - return null - } - - + /* * Parses VNF parameters passed in on the incoming requests and SDNC parameters returned from SDNC get response * and puts them into the format expected by VNF adapter. diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy index 13cc7f8d11..1452a9ad8d 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy @@ -29,6 +29,8 @@ import org.onap.so.client.HttpClient import org.onap.so.logger.MessageEnum import org.onap.so.logger.MsoLogger import org.onap.so.utils.TargetEntity +import java.util.UUID + @@ -311,7 +313,10 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor { HttpClient httpClient = new HttpClient(url, "application/xml", TargetEntity.VNF_ADAPTER) httpClient.addAdditionalHeader("Authorization", execution.getVariable(prefix + "basicAuthHeaderValue")) - + + httpClient.addAdditionalHeader("X-ONAP-RequestID", execution.getVariable("mso-request-id")) + httpClient.addAdditionalHeader("X-ONAP-InvocationID", UUID.randomUUID().toString()) + httpClient.addAdditionalHeader("X-ONAP-PartnerName", "SO-VNFAdapter") Response response; if ("GET".equals(vnfAdapterMethod)) { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index c0f1c48b76..b1e5d0d208 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -115,7 +115,7 @@ public class BBInputSetup implements JavaDelegate { private BBInputSetupMapperLayer mapperLayer; @Autowired - private CloudInfoFromAAI bbInputSetupHelper; + private CloudInfoFromAAI cloudInfoFromAAI; @Autowired private ExceptionBuilder exceptionUtil; @@ -125,6 +125,10 @@ public class BBInputSetup implements JavaDelegate { public BBInputSetupUtils getBbInputSetupUtils() { return bbInputSetupUtils; } + + public void setCloudInfoFromAAI(CloudInfoFromAAI cloudInfoFromAAI) { + this.cloudInfoFromAAI = cloudInfoFromAAI; + } public void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils) { this.bbInputSetupUtils = bbInputSetupUtils; @@ -987,7 +991,7 @@ public class BBInputSetup implements JavaDelegate { ServiceInstance serviceInstance = gBB.getServiceInstance(); CloudRegion cloudRegion = null; if(cloudConfiguration == null) { - Optional<CloudRegion> cloudRegionOp = bbInputSetupHelper.getCloudInfoFromAAI(serviceInstance); + Optional<CloudRegion> cloudRegionOp = cloudInfoFromAAI.getCloudInfoFromAAI(serviceInstance); if(cloudRegionOp.isPresent()) { cloudRegion = cloudRegionOp.get(); } @@ -1040,9 +1044,9 @@ public class BBInputSetup implements JavaDelegate { vnfModelInfo.setModelCustomizationUuid(vnfModelCustomizationUUID); this.mapCatalogVnf(vnf, vnfModelInfo, service); lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, vnf.getVnfId()); - if (cloudConfiguration != null) { - String volumeGroupCustomizationUUID = this.bbInputSetupUtils.getAAIVolumeGroup(cloudConfiguration.getCloudOwner(), - cloudConfiguration.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId()) + if (cloudRegion != null) { + String volumeGroupCustomizationUUID = this.bbInputSetupUtils.getAAIVolumeGroup(cloudRegion.getCloudOwner(), + cloudRegion.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId()) .getModelCustomizationId(); ModelInfo volumeGroupModelInfo = new ModelInfo(); volumeGroupModelInfo.setModelCustomizationId(volumeGroupCustomizationUUID); diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn index 990863ec93..6914e7575f 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn @@ -70,6 +70,7 @@ falloutHandler.postProcessResponse(execution)]]></bpmn2:script> <camunda:map> <camunda:entry key="content-type">application/soap+xml</camunda:entry> <camunda:entry key="Authorization">#{BasicAuthHeaderValueDB}</camunda:entry> + <camunda:entry key="X-ONAP-RequestID">#{FH_request_id}</camunda:entry> </camunda:map> </camunda:inputParameter> <camunda:inputParameter name="payload"> diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn index 2ae2ff7f8b..91c38241a2 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_l2hJ8CccEeW3d--PaFJMbg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.13.1" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_l2hJ8CccEeW3d--PaFJMbg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.1" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="sdncAdapter" name="SDNC Adapter" isExecutable="true"> <bpmn2:exclusiveGateway id="isResponseOK" name="is Response Ok?" default="badSynchronousResponse"> <bpmn2:incoming>SequenceFlow_15</bpmn2:incoming> @@ -8,28 +8,29 @@ </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="badSynchronousResponse" name="Bad synchronous response" sourceRef="isResponseOK" targetRef="setBadResponse" /> <bpmn2:sequenceFlow id="goodSynchronousResponse" name="Good synchronous response" sourceRef="isResponseOK" targetRef="resetCallbackRequest"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("SDNCA_ResponseCode")=='200'}</bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("SDNCA_ResponseCode")=='200'}]]></bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:scriptTask id="setBadResponse" name="Set Bad Response Exception" scriptFormat="groovy"> <bpmn2:incoming>badSynchronousResponse</bpmn2:incoming> <bpmn2:outgoing>Exception</bpmn2:outgoing> - <bpmn2:script>import org.onap.so.bpmn.common.scripts.* + <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* int responseCode = execution.getVariable("SDNCA_ResponseCode") ExceptionUtil exceptionUtil = new ExceptionUtil() -exceptionUtil.buildWorkflowException(execution, 7000, "Could not communicate with the SDNC Adapter" )</bpmn2:script> +exceptionUtil.buildWorkflowException(execution, 7000, "Could not communicate with the SDNC Adapter" )]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="Exception" name="Exception" sourceRef="setBadResponse" targetRef="badResponseEndFlow" /> <bpmn2:serviceTask id="invokeSDNCAdapter" name="Invoke SDNC Adapter" camunda:asyncAfter="true" camunda:class=""> <bpmn2:extensionElements> <camunda:connector> <camunda:inputOutput> - <camunda:inputParameter name="url">${execution.getVariable("mso.adapters.sdnc.endpoint")}</camunda:inputParameter> + <camunda:inputParameter name="url"><![CDATA[${execution.getVariable("mso.adapters.sdnc.endpoint")}]]></camunda:inputParameter> <camunda:inputParameter name="method">POST</camunda:inputParameter> <camunda:inputParameter name="headers"> <camunda:map> <camunda:entry key="content-type">application/soap+xml</camunda:entry> <camunda:entry key="Authorization">#{BasicAuthHeaderValue}</camunda:entry> + <camunda:entry key="X-ONAP-RequestID">#{mso-request-id}</camunda:entry> </camunda:map> </camunda:inputParameter> <camunda:inputParameter name="payload">${sdncAdapterRequest}</camunda:inputParameter> @@ -65,20 +66,18 @@ exceptionUtil.buildWorkflowException(execution, 7000, "Could not communicate wit </bpmn2:extensionElements> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_8</bpmn2:outgoing> - <bpmn2:script>import org.onap.so.bpmn.common.scripts.* + <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* def sdnc= new SDNCAdapter() -sdnc.preProcessRequest(execution) -</bpmn2:script> +sdnc.preProcessRequest(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_8" sourceRef="processMessage" targetRef="invokeSDNCAdapter" /> <bpmn2:scriptTask id="returnWorkflowResult" name="Return workflow result" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_11ah5pw</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing> - <bpmn2:script>import org.onap.so.bpmn.common.scripts.* + <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* def sdnc= new SDNCAdapter() -sdnc.postProcessResponse(execution) -</bpmn2:script> +sdnc.postProcessResponse(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_14" sourceRef="returnWorkflowResult" targetRef="timeoutError" /> <bpmn2:exclusiveGateway id="timeoutError" name="Did Timeout occur?" default="noTimeoutError"> @@ -88,7 +87,7 @@ sdnc.postProcessResponse(execution) </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="noTimeoutError" name="No Timeout" sourceRef="timeoutError" targetRef="ExclusiveGateway_1" /> <bpmn2:sequenceFlow id="SequenceFlow_19" name="Timeout" sourceRef="timeoutError" targetRef="endEventException"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("asynchronousResponseTimeout")==true}</bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("asynchronousResponseTimeout")==true}]]></bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:subProcess id="SubProcess" name="Wait for asynchronous message" camunda:asyncAfter="true"> <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> @@ -111,17 +110,17 @@ sdnc.postProcessResponse(execution) <bpmn2:scriptTask id="setTimeoutEx" name="Set Timeout and Stop Listening for Callback" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0mzs1ze</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_11ah5pw</bpmn2:outgoing> - <bpmn2:script>import org.onap.so.bpmn.common.scripts.* + <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* def sdnc= new SDNCAdapter() -sdnc.setTimeout(execution)</bpmn2:script> +sdnc.setTimeout(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:scriptTask id="resetCallbackRequest" name="Reset callback request and set timer value" scriptFormat="groovy"> <bpmn2:incoming>goodSynchronousResponse</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_26</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> - <bpmn2:script>import org.onap.so.bpmn.common.scripts.* + <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* def sdnc= new SDNCAdapter() -sdnc.resetCallbackRequest(execution)</bpmn2:script> +sdnc.resetCallbackRequest(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="resetCallbackRequest" targetRef="SubProcess" /> <bpmn2:exclusiveGateway id="ExclusiveGateway_1" name="Check final indicator" default="Done"> @@ -131,14 +130,14 @@ sdnc.resetCallbackRequest(execution)</bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="Done" name="Done" sourceRef="ExclusiveGateway_1" targetRef="ResetInterimNotificationFlag" /> <bpmn2:sequenceFlow id="SequenceFlow_30" name="Not Done" sourceRef="ExclusiveGateway_1" targetRef="ParallelGateway_3"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("continueListening")==true}</bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("continueListening")==true}]]></bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:scriptTask id="toggleSuccessIndicator" name="Toggle Success Indicator" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1w1za5m</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_17</bpmn2:outgoing> - <bpmn2:script>import org.onap.so.bpmn.common.scripts.* + <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* def sdnc= new SDNCAdapter() -sdnc.toggleSuccessIndicator(execution)</bpmn2:script> +sdnc.toggleSuccessIndicator(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_17" name="" sourceRef="toggleSuccessIndicator" targetRef="endEventFlow" /> <bpmn2:endEvent id="endEventFlow" name="End Event Flow"> @@ -168,9 +167,9 @@ sdnc.toggleSuccessIndicator(execution)</bpmn2:script> <bpmn2:scriptTask id="assignError" name="Assign Error" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_22</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_27</bpmn2:outgoing> - <bpmn2:script>import org.onap.so.bpmn.common.scripts.* + <bpmn2:script><![CDATA[import org.onap.so.bpmn.common.scripts.* def sdnc= new SDNCAdapter() -sdnc.assignError(execution)</bpmn2:script> +sdnc.assignError(execution)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_27" name="" sourceRef="assignError" targetRef="EndEvent_5" /> <bpmn2:endEvent id="EndEvent_5"> @@ -183,7 +182,7 @@ sdnc.assignError(execution)</bpmn2:script> <bpmn2:outgoing>SequenceFlow_23</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_4" name="Yes" sourceRef="ExclusiveGateway_2" targetRef="SetInterimNotificationFlag"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("serviceConfigActivate")==true}</bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("serviceConfigActivate")==true}]]></bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_23" name="No" sourceRef="ExclusiveGateway_2" targetRef="EndEvent_1" /> <bpmn2:endEvent id="EndEvent_1"> @@ -215,7 +214,7 @@ sdnc.assignError(execution)</bpmn2:script> <bpmn2:scriptTask id="SetInterimNotificationFlag" name="Set Interim Notification Flag" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_193cb6p</bpmn2:outgoing> - <bpmn2:script>execution.setVariable("SDNCA_InterimNotify", true)</bpmn2:script> + <bpmn2:script><![CDATA[execution.setVariable("SDNCA_InterimNotify", true)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_193cb6p" sourceRef="SetInterimNotificationFlag" targetRef="CallActivity_11xgv33" /> <bpmn2:endEvent id="EndEvent_18rq0b6"> @@ -225,7 +224,7 @@ sdnc.assignError(execution)</bpmn2:script> <bpmn2:scriptTask id="ResetInterimNotificationFlag" name="Reset Interim Notification Flag" scriptFormat="groovy"> <bpmn2:incoming>Done</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1w1za5m</bpmn2:outgoing> - <bpmn2:script>execution.setVariable("SDNCA_InterimNotify", false)</bpmn2:script> + <bpmn2:script><![CDATA[execution.setVariable("SDNCA_InterimNotify", false)]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1w1za5m" sourceRef="ResetInterimNotificationFlag" targetRef="toggleSuccessIndicator" /> </bpmn2:process> @@ -264,23 +263,23 @@ sdnc.assignError(execution)</bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="badSynchronousResponse" sourceElement="_BPMNShape_ExclusiveGateway_29" targetElement="_BPMNShape_ScriptTask_24"> - <di:waypoint x="544" y="153" /> - <di:waypoint x="544" y="122" /> - <di:waypoint x="600" y="122" /> + <di:waypoint xsi:type="dc:Point" x="544" y="153" /> + <di:waypoint xsi:type="dc:Point" x="544" y="122" /> + <di:waypoint xsi:type="dc:Point" x="600" y="122" /> <bpmndi:BPMNLabel> <dc:Bounds x="441" y="99" width="164" height="22" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="_BPMNShape_StartEvent_33" targetElement="_BPMNShape_ScriptTask_3"> - <di:waypoint x="147" y="179" /> - <di:waypoint x="194" y="179" /> + <di:waypoint xsi:type="dc:Point" x="147" y="179" /> + <di:waypoint xsi:type="dc:Point" x="194" y="179" /> <bpmndi:BPMNLabel> <dc:Bounds x="171" y="179" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="goodSynchronousResponse" sourceElement="_BPMNShape_ExclusiveGateway_29" targetElement="_BPMNShape_ScriptTask_27"> - <di:waypoint x="544" y="203" /> - <di:waypoint x="544" y="246" /> + <di:waypoint xsi:type="dc:Point" x="544" y="203" /> + <di:waypoint xsi:type="dc:Point" x="544" y="246" /> <bpmndi:BPMNLabel> <dc:Bounds x="459" y="208" width="172" height="22" /> </bpmndi:BPMNLabel> @@ -292,24 +291,24 @@ sdnc.assignError(execution)</bpmn2:script> <dc:Bounds x="194" y="139" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="SequenceFlow_8" sourceElement="_BPMNShape_ScriptTask_3" targetElement="_BPMNShape_ServiceTask_62"> - <di:waypoint x="294" y="179" /> - <di:waypoint x="342" y="179" /> + <di:waypoint xsi:type="dc:Point" x="294" y="179" /> + <di:waypoint xsi:type="dc:Point" x="342" y="179" /> <bpmndi:BPMNLabel> <dc:Bounds x="300" y="153" width="30" height="22" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ServiceTask_68" targetElement="_BPMNShape_ExclusiveGateway_53"> - <di:waypoint x="1204" y="277" /> - <di:waypoint x="1248" y="276" /> + <di:waypoint xsi:type="dc:Point" x="1204" y="277" /> + <di:waypoint xsi:type="dc:Point" x="1248" y="276" /> <bpmndi:BPMNLabel> <dc:Bounds x="1211" y="251" width="37" height="22" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_15" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ServiceTask_62" targetElement="_BPMNShape_ExclusiveGateway_29"> - <di:waypoint x="442" y="179" /> - <di:waypoint x="480" y="179" /> - <di:waypoint x="480" y="178" /> - <di:waypoint x="519" y="178" /> + <di:waypoint xsi:type="dc:Point" x="442" y="179" /> + <di:waypoint xsi:type="dc:Point" x="480" y="179" /> + <di:waypoint xsi:type="dc:Point" x="480" y="178" /> + <di:waypoint xsi:type="dc:Point" x="519" y="178" /> <bpmndi:BPMNLabel> <dc:Bounds x="468" y="153" width="37" height="22" /> </bpmndi:BPMNLabel> @@ -330,8 +329,8 @@ sdnc.assignError(execution)</bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_SubProcess_11"> - <di:waypoint x="998" y="278" /> - <di:waypoint x="1104" y="277" /> + <di:waypoint xsi:type="dc:Point" x="998" y="278" /> + <di:waypoint xsi:type="dc:Point" x="1104" y="277" /> <bpmndi:BPMNLabel> <dc:Bounds x="1051" y="262.5" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -340,8 +339,8 @@ sdnc.assignError(execution)</bpmn2:script> <dc:Bounds x="600" y="82" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="Exception" sourceElement="_BPMNShape_ScriptTask_24" targetElement="_BPMNShape_EndEvent_65"> - <di:waypoint x="700" y="122" /> - <di:waypoint x="762" y="122" /> + <di:waypoint xsi:type="dc:Point" x="700" y="122" /> + <di:waypoint xsi:type="dc:Point" x="762" y="122" /> <bpmndi:BPMNLabel> <dc:Bounds x="699" y="99" width="64" height="22" /> </bpmndi:BPMNLabel> @@ -350,8 +349,8 @@ sdnc.assignError(execution)</bpmn2:script> <dc:Bounds x="941" y="372" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_16" bpmnElement="SequenceFlow_16" sourceElement="_BPMNShape_IntermediateCatchEvent_16"> - <di:waypoint x="817" y="275" /> - <di:waypoint x="926" y="275" /> + <di:waypoint xsi:type="dc:Point" x="817" y="275" /> + <di:waypoint xsi:type="dc:Point" x="926" y="275" /> <bpmndi:BPMNLabel> <dc:Bounds x="872" y="260" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -363,16 +362,16 @@ sdnc.assignError(execution)</bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_17" bpmnElement="noTimeoutError" sourceElement="_BPMNShape_ExclusiveGateway_53" targetElement="_BPMNShape_ExclusiveGateway_54"> - <di:waypoint x="1273" y="301" /> - <di:waypoint x="1273" y="359" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="301" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="359" /> <bpmndi:BPMNLabel> <dc:Bounds x="1280" y="324" width="72" height="22" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_19" sourceElement="_BPMNShape_ExclusiveGateway_53" targetElement="_BPMNShape_ScriptTask_25"> - <di:waypoint x="1273" y="251" /> - <di:waypoint x="1273" y="95" /> - <di:waypoint x="1560" y="95" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="251" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="95" /> + <di:waypoint xsi:type="dc:Point" x="1560" y="95" /> <bpmndi:BPMNLabel> <dc:Bounds x="1301" y="169.45283018867923" width="39" height="12" /> </bpmndi:BPMNLabel> @@ -384,8 +383,8 @@ sdnc.assignError(execution)</bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="Done" sourceElement="_BPMNShape_ExclusiveGateway_54" targetElement="_BPMNShape_ScriptTask_247"> - <di:waypoint x="1298" y="384" /> - <di:waypoint x="1386" y="385" /> + <di:waypoint xsi:type="dc:Point" x="1298" y="384" /> + <di:waypoint xsi:type="dc:Point" x="1386" y="385" /> <bpmndi:BPMNLabel> <dc:Bounds x="1322" y="384.219838851959" width="27" height="13" /> </bpmndi:BPMNLabel> @@ -394,17 +393,17 @@ sdnc.assignError(execution)</bpmn2:script> <dc:Bounds x="494" y="246" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_12" bpmnElement="SequenceFlow_2" sourceElement="_BPMNShape_ScriptTask_27" targetElement="_BPMNShape_SubProcess_11"> - <di:waypoint x="594" y="286" /> - <di:waypoint x="607" y="286" /> - <di:waypoint x="607" y="275" /> - <di:waypoint x="619" y="275" /> + <di:waypoint xsi:type="dc:Point" x="594" y="286" /> + <di:waypoint xsi:type="dc:Point" x="607" y="286" /> + <di:waypoint xsi:type="dc:Point" x="607" y="275" /> + <di:waypoint xsi:type="dc:Point" x="619" y="275" /> <bpmndi:BPMNLabel> <dc:Bounds x="622" y="280.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_38" bpmnElement="SequenceFlow_30" sourceElement="_BPMNShape_ExclusiveGateway_54" targetElement="_BPMNShape_ParallelGateway_14"> - <di:waypoint x="1273" y="409" /> - <di:waypoint x="1273" y="467" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="409" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="467" /> <bpmndi:BPMNLabel> <dc:Bounds x="1273" y="423" width="60" height="22" /> </bpmndi:BPMNLabel> @@ -416,8 +415,8 @@ sdnc.assignError(execution)</bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="SequenceFlow_4" sourceElement="_BPMNShape_ExclusiveGateway_55" targetElement="CallActivity_11xgv33_di"> - <di:waypoint x="1273" y="602" /> - <di:waypoint x="1273" y="664" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="602" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="664" /> <bpmndi:BPMNLabel> <dc:Bounds x="1237" y="635.9906427957554" width="18" height="13" /> </bpmndi:BPMNLabel> @@ -429,8 +428,8 @@ sdnc.assignError(execution)</bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="SequenceFlow_21" sourceElement="_BPMNShape_ParallelGateway_14"> - <di:waypoint x="1272" y="516" /> - <di:waypoint x="1273" y="552" /> + <di:waypoint xsi:type="dc:Point" x="1272" y="516" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="552" /> <bpmndi:BPMNLabel> <dc:Bounds x="1273" y="519" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -442,17 +441,17 @@ sdnc.assignError(execution)</bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_30" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_ExclusiveGateway_55" targetElement="_BPMNShape_EndEvent_96"> - <di:waypoint x="1298" y="577" /> - <di:waypoint x="1330" y="577" /> - <di:waypoint x="1440" y="577" /> + <di:waypoint xsi:type="dc:Point" x="1298" y="577" /> + <di:waypoint xsi:type="dc:Point" x="1330" y="577" /> + <di:waypoint xsi:type="dc:Point" x="1440" y="577" /> <bpmndi:BPMNLabel> <dc:Bounds x="1309" y="590.5" width="14" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_33" bpmnElement="SequenceFlow_26" sourceElement="_BPMNShape_ParallelGateway_14" targetElement="_BPMNShape_ScriptTask_27"> - <di:waypoint x="1248" y="492" /> - <di:waypoint x="544" y="492" /> - <di:waypoint x="544" y="326" /> + <di:waypoint xsi:type="dc:Point" x="1248" y="492" /> + <di:waypoint xsi:type="dc:Point" x="544" y="492" /> + <di:waypoint xsi:type="dc:Point" x="544" y="326" /> <bpmndi:BPMNLabel> <dc:Bounds x="782" y="467" width="73" height="48" /> </bpmndi:BPMNLabel> @@ -461,8 +460,8 @@ sdnc.assignError(execution)</bpmn2:script> <dc:Bounds x="1540" y="344" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_26" bpmnElement="SequenceFlow_17" sourceElement="_BPMNShape_ScriptTask_247" targetElement="_BPMNShape_EndEvent_64"> - <di:waypoint x="1640" y="384" /> - <di:waypoint x="1699" y="384" /> + <di:waypoint xsi:type="dc:Point" x="1640" y="384" /> + <di:waypoint xsi:type="dc:Point" x="1699" y="384" /> <bpmndi:BPMNLabel> <dc:Bounds x="1670" y="369" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -486,22 +485,22 @@ sdnc.assignError(execution)</bpmn2:script> <dc:Bounds x="326" y="749" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_22" sourceElement="_BPMNShape_StartEvent_63" targetElement="_BPMNShape_ScriptTask_249"> - <di:waypoint x="278" y="789" /> - <di:waypoint x="326" y="789" /> + <di:waypoint xsi:type="dc:Point" x="278" y="789" /> + <di:waypoint xsi:type="dc:Point" x="326" y="789" /> <bpmndi:BPMNLabel> <dc:Bounds x="263" y="789" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_34" bpmnElement="SequenceFlow_27" sourceElement="_BPMNShape_ScriptTask_249" targetElement="_BPMNShape_EndEvent_213"> - <di:waypoint x="426" y="789" /> - <di:waypoint x="482" y="789" /> + <di:waypoint xsi:type="dc:Point" x="426" y="789" /> + <di:waypoint xsi:type="dc:Point" x="482" y="789" /> <bpmndi:BPMNLabel> <dc:Bounds x="409" y="789" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1eciucn_di" bpmnElement="SequenceFlow_1eciucn"> - <di:waypoint x="691" y="275" /> - <di:waypoint x="781" y="275" /> + <di:waypoint xsi:type="dc:Point" x="691" y="275" /> + <di:waypoint xsi:type="dc:Point" x="781" y="275" /> <bpmndi:BPMNLabel> <dc:Bounds x="736" y="260" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -519,17 +518,17 @@ sdnc.assignError(execution)</bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0mzs1ze_di" bpmnElement="SequenceFlow_0mzs1ze"> - <di:waypoint x="800" y="364" /> - <di:waypoint x="800" y="412" /> - <di:waypoint x="941" y="412" /> + <di:waypoint xsi:type="dc:Point" x="800" y="364" /> + <di:waypoint xsi:type="dc:Point" x="800" y="412" /> + <di:waypoint xsi:type="dc:Point" x="941" y="412" /> <bpmndi:BPMNLabel> <dc:Bounds x="815" y="388" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_11ah5pw_di" bpmnElement="SequenceFlow_11ah5pw"> - <di:waypoint x="1041" y="412" /> - <di:waypoint x="1154" y="412" /> - <di:waypoint x="1154" y="317" /> + <di:waypoint xsi:type="dc:Point" x="1041" y="412" /> + <di:waypoint xsi:type="dc:Point" x="1154" y="412" /> + <di:waypoint xsi:type="dc:Point" x="1154" y="317" /> <bpmndi:BPMNLabel> <dc:Bounds x="1098" y="397" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -547,8 +546,8 @@ sdnc.assignError(execution)</bpmn2:script> <dc:Bounds x="1223" y="666" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_193cb6p_di" bpmnElement="SequenceFlow_193cb6p"> - <di:waypoint x="1273" y="746" /> - <di:waypoint x="1273" y="795" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="746" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="795" /> <bpmndi:BPMNLabel> <dc:Bounds x="1288" y="770.5" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -560,8 +559,8 @@ sdnc.assignError(execution)</bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1em7gys_di" bpmnElement="SequenceFlow_1em7gys"> - <di:waypoint x="1273" y="875" /> - <di:waypoint x="1273" y="920" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="875" /> + <di:waypoint xsi:type="dc:Point" x="1273" y="920" /> <bpmndi:BPMNLabel> <dc:Bounds x="1288" y="897.5" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -570,8 +569,8 @@ sdnc.assignError(execution)</bpmn2:script> <dc:Bounds x="1386" y="345" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1w1za5m_di" bpmnElement="SequenceFlow_1w1za5m"> - <di:waypoint x="1486" y="385" /> - <di:waypoint x="1540" y="384" /> + <di:waypoint xsi:type="dc:Point" x="1486" y="385" /> + <di:waypoint xsi:type="dc:Point" x="1540" y="384" /> <bpmndi:BPMNLabel> <dc:Bounds x="1513" y="369.5" width="0" height="0" /> </bpmndi:BPMNLabel> diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy new file mode 100644 index 0000000000..5f428f1f9f --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/ExternalAPIUtilTest.groovy @@ -0,0 +1,199 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2018 Nokia. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.bpmn.common.scripts + +import org.assertj.core.api.AbstractAssert +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.junit.Test +import org.onap.logging.ref.slf4j.ONAPLogConstants +import org.onap.so.client.HttpClient +import org.onap.so.client.HttpClientFactory +import org.onap.so.utils.TargetEntity +import org.springframework.http.HttpStatus + +import javax.ws.rs.core.MediaType +import javax.ws.rs.core.Response + +import static org.assertj.core.api.Assertions.assertThat +import static org.assertj.core.api.Assertions.catchThrowableOfType +import static org.mockito.BDDMockito.given +import static org.mockito.BDDMockito.then +import static org.mockito.BDDMockito.willThrow +import static org.mockito.Mockito.mock +import static org.mockito.Mockito.times + +class ExternalAPIUtilTest { + + private static final String URL = "http://someUrl" + private static final String UUID_STR = UUID.nameUUIDFromBytes("deterministic_uuid".getBytes()) + private static final String BODY_PAYLOAD = "payload" + + @Test + void executeExternalAPIGetCall_shouldPerformRestGetCall_withAuthorizationHeaderSet() { + // GIVEN + Response expectedResponse = createExpectedResponse(HttpStatus.ACCEPTED, BODY_PAYLOAD) + HttpClient httpClient = mock(HttpClient.class) + given(httpClient.get()).willReturn(expectedResponse) + HttpClientFactory httpClientFactory = mock(HttpClientFactory.class) + given(httpClientFactory.create(new URL(URL), MediaType.APPLICATION_JSON, TargetEntity.EXTERNAL)).willReturn(httpClient) + + // WHEN + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(httpClientFactory, new DummyMsoUtils(UUID_STR), new ExceptionUtil()) + Response apiResponse = externalAPIUtil.executeExternalAPIGetCall(createDelegateExecution(), URL) + + // THEN + then(httpClient).should(times(1)).addBasicAuthHeader("value_externalapi_auth", "value_mso_msoKey") + then(httpClient).should(times(1)).addAdditionalHeader("X-FromAppId", "MSO") + then(httpClient).should(times(1)).addAdditionalHeader(ONAPLogConstants.Headers.REQUEST_ID, UUID_STR) + then(httpClient).should(times(1)).addAdditionalHeader("Accept", MediaType.APPLICATION_JSON) + ResponseAssert.assertThat(apiResponse) + .hasStatusCode(HttpStatus.ACCEPTED) + .hasBody(BODY_PAYLOAD) + } + + @Test + void executeExternalAPIGetCall_shouldHandleExceptionsThrownByGetCall_andRethrowAsBpmnError() { + // GIVEN + HttpClient httpClient = mock(HttpClient.class) + willThrow(new RuntimeException("error occurred")).given(httpClient).get() + HttpClientFactory httpClientFactory = mock(HttpClientFactory.class) + given(httpClientFactory.create(new URL(URL), MediaType.APPLICATION_JSON, TargetEntity.EXTERNAL)).willReturn(httpClient) + DelegateExecution delegateExecution = createDelegateExecution() + DummyExceptionUtil exceptionUtil = new DummyExceptionUtil() + + // WHEN + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(httpClientFactory, new DummyMsoUtils(UUID_STR), exceptionUtil) + BpmnError bpmnError = catchThrowableOfType({ -> externalAPIUtil.executeExternalAPIGetCall(delegateExecution, URL) + }, BpmnError.class) + + // THEN + assertThat(exceptionUtil.getDelegateExecution()).isSameAs(delegateExecution) + assertThat(bpmnError.getMessage()).isEqualTo("error occurred") + assertThat(bpmnError.getErrorCode()).isEqualTo("9999") + } + + @Test + void executeExternalAPIPostCall_shouldHandleExceptionsThrownByPostCall_andRethrowAsBpmnError() { + // GIVEN + HttpClient httpClient = mock(HttpClient.class) + willThrow(new RuntimeException("error occurred")).given(httpClient).post(BODY_PAYLOAD) + HttpClientFactory httpClientFactory = mock(HttpClientFactory.class) + given(httpClientFactory.create(new URL(URL), MediaType.APPLICATION_JSON, TargetEntity.AAI)).willReturn(httpClient) + DelegateExecution delegateExecution = createDelegateExecution() + DummyExceptionUtil exceptionUtil = new DummyExceptionUtil() + + // WHEN + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(httpClientFactory, new DummyMsoUtils(UUID_STR), exceptionUtil) + BpmnError bpmnError = catchThrowableOfType({ -> + externalAPIUtil.executeExternalAPIPostCall(delegateExecution, URL, BODY_PAYLOAD) + }, BpmnError.class) + + // THEN + assertThat(exceptionUtil.getDelegateExecution()).isSameAs(delegateExecution) + assertThat(bpmnError.getMessage()).isEqualTo("error occurred") + assertThat(bpmnError.getErrorCode()).isEqualTo("9999") + } + + @Test + void executeExternalAPIPostCall_shouldPerformRestPostCall_withPayloadAndAuthorizationHeaderSet() { + // GIVEN + Response expectedResponse = createExpectedResponse(HttpStatus.ACCEPTED, BODY_PAYLOAD) + HttpClient httpClient = mock(HttpClient.class) + given(httpClient.post(BODY_PAYLOAD)).willReturn(expectedResponse) + HttpClientFactory httpClientFactory = mock(HttpClientFactory.class) + given(httpClientFactory.create(new URL(URL), MediaType.APPLICATION_JSON, TargetEntity.AAI)).willReturn(httpClient) + + // WHEN + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil(httpClientFactory, new DummyMsoUtils(UUID_STR), new ExceptionUtil()) + Response apiResponse = externalAPIUtil.executeExternalAPIPostCall(createDelegateExecution(), URL, BODY_PAYLOAD) + + // THEN + then(httpClient).should(times(1)).addBasicAuthHeader("value_externalapi_auth", "value_mso_msoKey") + then(httpClient).should(times(1)).addAdditionalHeader("X-FromAppId", "MSO") + then(httpClient).should(times(1)).addAdditionalHeader("X-TransactionId", UUID_STR) + ResponseAssert.assertThat(apiResponse) + .hasStatusCode(HttpStatus.ACCEPTED) + .hasBody(BODY_PAYLOAD) + } + + private Response createExpectedResponse(HttpStatus httpStatus, String body) { + Response expectedResponse = mock(Response.class) + given(expectedResponse.getStatus()).willReturn(httpStatus.value()) + given(expectedResponse.getEntity()).willReturn(body) + return expectedResponse + } + + private DelegateExecution createDelegateExecution() { + DelegateExecution delegateExecution = mock(DelegateExecution.class) + given(delegateExecution.getVariable("URN_externalapi_auth")).willReturn("value_externalapi_auth") + given(delegateExecution.getVariable("URN_mso_msoKey")).willReturn("value_mso_msoKey") + return delegateExecution + } + + private static class ResponseAssert extends AbstractAssert<ResponseAssert, Response> { + + ResponseAssert(Response response) { + super(response, ResponseAssert.class) + } + + static ResponseAssert assertThat(Response response) { + return new ResponseAssert(response) + } + + ResponseAssert hasStatusCode(HttpStatus httpStatus) { + assertThat(actual.getStatus()).isEqualTo(httpStatus.value()) + return this + } + + ResponseAssert hasBody(String responseBody) { + assertThat(actual.getEntity()).isEqualTo(responseBody) + return this + } + } + + private static class DummyMsoUtils extends MsoUtils { + + private final String uuid + + DummyMsoUtils(String uuid) { + this.uuid = uuid + } + + String getRequestID() { + return uuid + } + } + + private static class DummyExceptionUtil extends ExceptionUtil { + + private DelegateExecution delegateExecution + + @Override + void buildAndThrowWorkflowException(DelegateExecution delegateExecution, int errorCode, String errorMessage) { + this.delegateExecution = delegateExecution + throw new BpmnError(String.valueOf(errorCode), errorMessage) + } + + DelegateExecution getDelegateExecution() { + return delegateExecution + } + } +}
\ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index 8399fe15a3..1654aa06de 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -40,6 +40,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.junit.Before; @@ -130,6 +131,9 @@ public class BBInputSetupTest { @Mock private BBInputSetupUtils SPY_bbInputSetupUtils; + @Mock + private CloudInfoFromAAI SPY_cloudInfoFromAAI; + @Spy private BBInputSetupMapperLayer bbInputSetupMapperLayer; @@ -137,6 +141,7 @@ public class BBInputSetupTest { public void setup(){ SPY_bbInputSetup.setBbInputSetupUtils(SPY_bbInputSetupUtils); SPY_bbInputSetup.setMapperLayer(bbInputSetupMapperLayer); + SPY_bbInputSetup.setCloudInfoFromAAI(SPY_cloudInfoFromAAI); } @Test @@ -2270,19 +2275,22 @@ public class BBInputSetupTest { verify(SPY_bbInputSetup, times(1)).mapCatalogVfModule(any(VfModule.class), any(ModelInfo.class), any(Service.class), any(String.class)); - org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = Mockito.mock(org.onap.aai.domain.yang.CloudRegion.class); + CloudRegion cloudRegion = new CloudRegion(); + cloudRegion.setLcpCloudRegionId("cloudRegionId"); + cloudRegion.setCloudOwner("CloudOwner"); + doReturn(Optional.of(cloudRegion)).when(SPY_cloudInfoFromAAI).getCloudInfoFromAAI(gBB.getServiceInstance()); VolumeGroup volumeGroup = new VolumeGroup(); volumeGroup.setVolumeGroupId("volumeGroupId"); gBB.getServiceInstance().getVnfs().get(0).getVolumeGroups().add(volumeGroup); org.onap.aai.domain.yang.VolumeGroup aaiVolumeGroup = new org.onap.aai.domain.yang.VolumeGroup(); aaiVolumeGroup.setModelCustomizationId("modelCustId"); - doReturn(aaiVolumeGroup).when(SPY_bbInputSetupUtils).getAAIVolumeGroup(Defaults.CLOUD_OWNER.toString(), - cloudConfiguration.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId()); + doReturn(aaiVolumeGroup).when(SPY_bbInputSetupUtils).getAAIVolumeGroup(cloudRegion.getCloudOwner(), + cloudRegion.getLcpCloudRegionId(), volumeGroup.getVolumeGroupId()); executeBB.getBuildingBlock().setBpmnFlowName("UnassignVolumeGroupBB"); executeBB.getBuildingBlock().setKey("72d9d1cd-f46d-447a-abdb-451d6fb05fa8"); SPY_bbInputSetup.getGBBMacroExistingService(executeBB, lookupKeyMap, - executeBB.getBuildingBlock().getBpmnFlowName(), gBB, service, requestAction, cloudConfiguration); + executeBB.getBuildingBlock().getBpmnFlowName(), gBB, service, requestAction, null); verify(SPY_bbInputSetup, times(3)).mapCatalogVnf(any(GenericVnf.class), any(ModelInfo.class), any(Service.class)); verify(SPY_bbInputSetup, times(1)).mapCatalogVolumeGroup(isA(VolumeGroup.class), isA(ModelInfo.class), diff --git a/bpmn/mso-infrastructure-bpmn/pom.xml b/bpmn/mso-infrastructure-bpmn/pom.xml index e22125bee6..fb5d0108ba 100644 --- a/bpmn/mso-infrastructure-bpmn/pom.xml +++ b/bpmn/mso-infrastructure-bpmn/pom.xml @@ -249,12 +249,12 @@ <artifactId>camunda-bpm-assert</artifactId> <version>2.0-alpha2</version> <scope>test</scope> - </dependency> + </dependency> <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>1.7.0</version> - <scope>test</scope> - </dependency> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> + <version>1.7.0</version> + <scope>test</scope> + </dependency> </dependencies> </project> diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java index 335f3468a7..4e45aafc9e 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/WorkflowTest.java @@ -56,6 +56,7 @@ import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.history.HistoricProcessInstance; import org.camunda.bpm.engine.history.HistoricVariableInstance; import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.camunda.bpm.engine.runtime.ProcessInstanceQuery; import org.camunda.bpm.engine.test.ProcessEngineRule; import org.camunda.bpm.engine.variable.impl.VariableMapImpl; import org.custommonkey.xmlunit.DetailedDiff; @@ -884,11 +885,20 @@ public abstract class WorkflowTest { return null; } + ProcessInstanceQuery processInstanceQuery = null; if (processInstance == null) { - processInstance = runtimeService + processInstanceQuery = runtimeService .createProcessInstanceQuery() - .processDefinitionKey(processKey) - .singleResult(); + .processDefinitionKey(processKey); + } + + if(processInstanceQuery.count() <= 1){ + processInstance = processInstanceQuery.singleResult(); + }else{ + //TODO There shouldnt be more than one in the list but seems to be happening, need to figure out why happening and best way to get correct one from list + msoLogger.debug("Process Instance Query returned " + processInstanceQuery.count() + " instance. Getting the last instance in the list"); + List<ProcessInstance> processList = processInstanceQuery.list(); + processInstance = processList.get((processList.size() - 1)); } if (processInstance != null) { @@ -927,7 +937,7 @@ public abstract class WorkflowTest { protected boolean injectSDNCRestCallback(String contentType, String content, long timeout) { String sdncRequestId = (String) getProcessVariable("SDNCAdapterRestV1", "SDNCAResponse_CORRELATOR", timeout); - + if (sdncRequestId == null) { sdncRequestId = (String) getProcessVariable("SDNCAdapterRestV2", "SDNCAResponse_CORRELATOR", timeout); @@ -1693,7 +1703,7 @@ public abstract class WorkflowTest { /** * Checks to see if the specified process is ended. - * + * * @param processInstanceId the process Instance Id * @return true if the process is ended */ @@ -1705,7 +1715,7 @@ public abstract class WorkflowTest { /** * Checks to see if the specified process is ended. - * + * * @author cb645j */ //TODO combine into 1 diff --git a/bpmn/pom.xml b/bpmn/pom.xml index a7b49bc52a..c66178b182 100644 --- a/bpmn/pom.xml +++ b/bpmn/pom.xml @@ -64,7 +64,7 @@ <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> - <version>1.7.0</version> + <version>3.11.1</version> <scope>test</scope> </dependency> </dependencies> diff --git a/bpmn/so-bpmn-building-blocks/pom.xml b/bpmn/so-bpmn-building-blocks/pom.xml index 8f1f2bf56e..4fe02ee3ac 100644 --- a/bpmn/so-bpmn-building-blocks/pom.xml +++ b/bpmn/so-bpmn-building-blocks/pom.xml @@ -107,6 +107,12 @@ <scope>test</scope> </dependency> <dependency> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> + <version>1.7.0</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy index 2ae7686703..05fd517e47 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy @@ -23,6 +23,7 @@ package org.onap.so.bpmn.infrastructure.scripts import org.json.JSONArray import org.json.JSONObject import org.json.XML +import org.onap.so.bpmn.common.scripts.ExternalAPIUtilFactory import static org.apache.commons.lang3.StringUtils.* import groovy.xml.XmlUtil @@ -381,7 +382,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso valueMap.put("serviceName", '"' + serviceName + '"') valueMap.put("serviceUuId", '"' + serviceUuId + '"') - ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil() + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create() // insert CallSource='ExternalAPI' to uuiRequest Map<String, String> requestInputsMap = new HashMap<>() @@ -426,7 +427,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso msoLogger.debug("doCreateE2ESIin3rdONAP externalAPIURL is: " + extAPIPath) msoLogger.debug("doCreateE2ESIin3rdONAP payload is: " + payload) - ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil() + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create() execution.setVariable("ServiceOrderId", "") Response response = externalAPIUtil.executeExternalAPIPostCall(execution, extAPIPath, payload) @@ -471,7 +472,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso extAPIPath += "/" + execution.getVariable("ServiceOrderId") msoLogger.debug("getE2ESIProgressin3rdONAP create externalAPIURL is: " + extAPIPath) - ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil() + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create() Response response = externalAPIUtil.executeExternalAPIGetCall(execution, extAPIPath) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy index 078d68bd75..b718e4a2e0 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy @@ -20,6 +20,8 @@ package org.onap.so.bpmn.infrastructure.scripts +import org.onap.so.bpmn.common.scripts.ExternalAPIUtilFactory + import javax.ws.rs.NotFoundException import javax.ws.rs.core.Response @@ -249,7 +251,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso valueMap.put("serviceName", "null") valueMap.put("serviceUuId", '"' + serviceSpecificationId + '"') - ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil() + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create() valueMap.put("_requestInputs_", "") @@ -271,7 +273,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso String extAPIPath = sppartnerUrl + "/service?relatedParty.id=" + globalSubscriberId msoLogger.debug("queryServicefrom3rdONAP externalAPIURL is: " + extAPIPath) - ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil() + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create() Response response = externalAPIUtil.executeExternalAPIGetCall(execution, extAPIPath) @@ -317,7 +319,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso msoLogger.debug("doDeleteE2ESIin3rdONAP externalAPIURL is: " + extAPIPath) msoLogger.debug("doDeleteE2ESIin3rdONAP payload is: " + payload) - ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil() + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create() execution.setVariable("ServiceOrderId", "") Response response = externalAPIUtil.executeExternalAPIPostCall(execution, extAPIPath, payload) @@ -361,7 +363,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso extAPIPath += "/" + execution.getVariable("ServiceOrderId") msoLogger.debug("getE2ESIProgressin3rdONAP delete externalAPIURL is: " + extAPIPath) - ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil() + ExternalAPIUtil externalAPIUtil = new ExternalAPIUtilFactory().create() Response response = externalAPIUtil.executeExternalAPIGetCall(execution, extAPIPath) diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstance.bpmn index 2f5fa39dbc..c049eaafa0 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateNetworkInstance.bpmn @@ -1,16 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="2.0.3" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="DoCreateNetworkInstance" name="DoCreateNetworkInstance" isExecutable="true"> <bpmn2:startEvent id="createNetwork_startEvent" name="Start Flow"> <bpmn2:outgoing>SequenceFlow_1n61wit</bpmn2:outgoing> </bpmn2:startEvent> - <bpmn2:endEvent id="aai_Error_EndEvent" name="AAI Name Error"> - <bpmn2:incoming>isReturnCode404_No_SequenceFlow</bpmn2:incoming> - <bpmn2:errorEventDefinition id="_ErrorEventDefinition_53" errorRef="Error_2" /> - </bpmn2:endEvent> <bpmn2:inclusiveGateway id="InclusiveGateway"> <bpmn2:incoming>isNetworkActiveNo_SequenceFlow</bpmn2:incoming> - <bpmn2:incoming>isReturnCode404_Yes_SequenceFlow</bpmn2:incoming> + <bpmn2:incoming>isAAIQueryNameNo_SequenceFlow</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_21</bpmn2:outgoing> </bpmn2:inclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_21" sourceRef="InclusiveGateway" targetRef="callRESTQueryCloudRegion_ScriptTask" /> @@ -18,27 +14,27 @@ <bpmn2:incoming>SequenceFlow_21</bpmn2:incoming> <bpmn2:incoming>isNameSentNo_SequenceFlow</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_32</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.callRESTQueryAAICloudRegion(execution)]]></bpmn2:script> +DoCreateNetworkInstance.callRESTQueryAAICloudRegion(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_32" name="" sourceRef="callRESTQueryCloudRegion_ScriptTask" targetRef="isSdncRpc1_ExclusiveGateway1" /> <bpmn2:scriptTask id="prepareSDNCTopoRequest_ScriptTask" name="Prepare Assign SDNC Request" scriptFormat="groovy"> <bpmn2:incoming>isSdncRpc1No_SequenceFlow1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_11</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareSDNCRequest(execution) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_11" name="" sourceRef="prepareSDNCTopoRequest_ScriptTask" targetRef="callAssignSDNCAdapter_CallActivity" /> <bpmn2:scriptTask id="validateSDNCResponse_ScriptTask" name="Validate SDNC Assign Response" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_12</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_0d93bqw</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.validateSDNCResponse(execution)]]></bpmn2:script> +DoCreateNetworkInstance.validateSDNCResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="isSdncTopoOk_ExclusiveGateway" name="Is SDNC Ok?" default="sdncTopoNo_SequenceFlow"> <bpmn2:incoming>SequenceFlow_5</bpmn2:incoming> @@ -47,7 +43,7 @@ DoCreateNetworkInstance.validateSDNCResponse(execution)]]></bpmn2:script> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="sdncTopoNo_SequenceFlow" name="No" sourceRef="isSdncTopoOk_ExclusiveGateway" targetRef="sndcError_EndEvent" /> <bpmn2:sequenceFlow id="sdncTopoYes_SequenceFlow" name="Yes" sourceRef="isSdncTopoOk_ExclusiveGateway" targetRef="callRESTQueryNetworkId_ScriptTask"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKI_sdncResponseSuccess" ) == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("CRENWKI_sdncResponseSuccess" ) == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_5" name="" sourceRef="validateSDNCResponse_ScriptTask" targetRef="isSdncTopoOk_ExclusiveGateway" /> <bpmn2:boundaryEvent id="BoundaryEvent_4" name="" attachedToRef="validateSDNCResponse_ScriptTask"> @@ -63,9 +59,9 @@ DoCreateNetworkInstance.validateSDNCResponse(execution)]]></bpmn2:script> <bpmn2:scriptTask id="callRESTQueryNetworkId_ScriptTask" name="Call REST Query Network Id In AAI" scriptFormat="groovy"> <bpmn2:incoming>sdncTopoYes_SequenceFlow</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_16</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.callRESTQueryAAINetworkId(execution)]]></bpmn2:script> +DoCreateNetworkInstance.callRESTQueryAAINetworkId(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_16" name="" sourceRef="callRESTQueryNetworkId_ScriptTask" targetRef="callRESTQueryVpnBinding_ScriptTask" /> <bpmn2:callActivity id="callAssignSDNCAdapter_CallActivity" name="Call SDNC Assign Adapter V1 " calledElement="sdncAdapter"> @@ -85,9 +81,9 @@ DoCreateNetworkInstance.callRESTQueryAAINetworkId(execution)]]></bpmn2:script> <bpmn2:scriptTask id="validateCreatePONetwork_ScriptTask" name="Validate Create PO Network" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_59</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_13</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.validateCreateNetworkResponse(execution)]]></bpmn2:script> +DoCreateNetworkInstance.validateCreateNetworkResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="isNetworkActive_ExclusiveGateway" name="Is Network Active?" default="isNetworkActiveNo_SequenceFlow"> <bpmn2:incoming>isAAIQueryNameYes_SequenceFlow</bpmn2:incoming> @@ -95,7 +91,7 @@ DoCreateNetworkInstance.validateCreateNetworkResponse(execution)]]></bpmn2:scrip <bpmn2:outgoing>isNetworkActiveNo_SequenceFlow</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isNetworkActiveYes_SequenceFlow" name="Yes" sourceRef="isNetworkActive_ExclusiveGateway" targetRef="ScriptTask_0p3v749"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKI_orchestrationStatus") == "ACTIVE"}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("CRENWKI_orchestrationStatus") == "ACTIVE"}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="isNetworkActiveNo_SequenceFlow" name="No" sourceRef="isNetworkActive_ExclusiveGateway" targetRef="InclusiveGateway" /> <bpmn2:exclusiveGateway id="isAAIQueryNameOk_ExclusiveGateway" name="Is Query Name Ok? " default="isAAIQueryNameNo_SequenceFlow"> @@ -103,20 +99,9 @@ DoCreateNetworkInstance.validateCreateNetworkResponse(execution)]]></bpmn2:scrip <bpmn2:outgoing>isAAIQueryNameNo_SequenceFlow</bpmn2:outgoing> <bpmn2:outgoing>isAAIQueryNameYes_SequenceFlow</bpmn2:outgoing> </bpmn2:exclusiveGateway> - <bpmn2:sequenceFlow id="isAAIQueryNameNo_SequenceFlow" name="No" sourceRef="isAAIQueryNameOk_ExclusiveGateway" targetRef="isReturnCode404_ExclusiveGateway" /> + <bpmn2:sequenceFlow id="isAAIQueryNameNo_SequenceFlow" name="No" sourceRef="isAAIQueryNameOk_ExclusiveGateway" targetRef="InclusiveGateway" /> <bpmn2:sequenceFlow id="isAAIQueryNameYes_SequenceFlow" name="Yes" sourceRef="isAAIQueryNameOk_ExclusiveGateway" targetRef="isNetworkActive_ExclusiveGateway"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKI_isAAIqueryNameGood") == true}]]></bpmn2:conditionExpression> - </bpmn2:sequenceFlow> - <bpmn2:exclusiveGateway id="isReturnCode404_ExclusiveGateway" name="Is Code 404?" default="isReturnCode404_No_SequenceFlow"> - <bpmn2:incoming>isAAIQueryNameNo_SequenceFlow</bpmn2:incoming> - <bpmn2:outgoing>isReturnCode404_No_SequenceFlow</bpmn2:outgoing> - <bpmn2:outgoing>isReturnCode404_Yes_SequenceFlow</bpmn2:outgoing> - </bpmn2:exclusiveGateway> - <bpmn2:sequenceFlow id="isReturnCode404_No_SequenceFlow" name="No" sourceRef="isReturnCode404_ExclusiveGateway" targetRef="aai_Error_EndEvent" /> - <bpmn2:sequenceFlow id="isReturnCode404_Yes_SequenceFlow" name="Yes" sourceRef="isReturnCode404_ExclusiveGateway" targetRef="InclusiveGateway"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKI_aaiNameReturnCode" ) == "404"} - -]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("CRENWKI_isAAIqueryNameGood") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:subProcess id="subProcessException_SubProcess" name="Subprocess For Prepare Rollback Data" triggeredByEvent="true"> <bpmn2:startEvent id="subProcessStart_StartEvent" name="Fault Start"> @@ -130,7 +115,7 @@ DoCreateNetworkInstance.validateCreateNetworkResponse(execution)]]></bpmn2:scrip <bpmn2:outgoing>isPONR_No_SequenceFlow</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isPONR_Yes_SequenceFlow" name="Yes" sourceRef="isPONR_ExclusiveGateway" targetRef="ExclusiveGateway_1umhuft"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKI_isPONR") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("CRENWKI_isPONR") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="isPONR_No_SequenceFlow" name="No" sourceRef="isPONR_ExclusiveGateway" targetRef="isSDNCActivate_ExclusiveGateway" /> <bpmn2:exclusiveGateway id="sdncOk_ExclusiveGateway" name="is SDNC Topo Ok?" default="sdncOk_No_ExclusiveGateway"> @@ -139,15 +124,15 @@ DoCreateNetworkInstance.validateCreateNetworkResponse(execution)]]></bpmn2:scrip <bpmn2:outgoing>sdncOk_No_ExclusiveGateway</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="sdncOk_Yeso_ExclusiveGateway" name="Yes" sourceRef="sdncOk_ExclusiveGateway" targetRef="isSdncRpc4_ExclusiveGateway4"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKI_isSdncRollbackNeeded" ) == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("CRENWKI_isSdncRollbackNeeded" ) == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="sdncOk_No_ExclusiveGateway" name="No" sourceRef="sdncOk_ExclusiveGateway" targetRef="ExclusiveGateway_1qb2vwe" /> <bpmn2:scriptTask id="prepareSDNCRollbackRequest_ScriptTask" name="Prepare SDNCRollback Request" scriptFormat="groovy"> <bpmn2:incoming>isSdncRpc4No_SequenceFlow4</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0lndbvr</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.prepareSDNCRollbackRequest(execution)]]></bpmn2:script> +DoCreateNetworkInstance.prepareSDNCRollbackRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="isSDNCActivate_ExclusiveGateway" name="is SDNC Activate Ok?" default="SequenceFlow_12tlymf"> <bpmn2:incoming>isPONR_No_SequenceFlow</bpmn2:incoming> @@ -155,7 +140,7 @@ DoCreateNetworkInstance.prepareSDNCRollbackRequest(execution)]]></bpmn2:script> <bpmn2:outgoing>SequenceFlow_12tlymf</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="SequenceFlow_0cly7z2" name="Yes" sourceRef="isSDNCActivate_ExclusiveGateway" targetRef="Task_1imzwi3"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKI_isSdncActivateRollbackNeeded" ) == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("CRENWKI_isSdncActivateRollbackNeeded" ) == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_12tlymf" name="No" sourceRef="isSDNCActivate_ExclusiveGateway" targetRef="ExclusiveGateway_1bk0tqd" /> <bpmn2:exclusiveGateway id="isSdncRpc4_ExclusiveGateway4" name="is not '1610' SNDC Call?" default="isSdncRpc4No_SequenceFlow4"> @@ -164,15 +149,15 @@ DoCreateNetworkInstance.prepareSDNCRollbackRequest(execution)]]></bpmn2:script> <bpmn2:outgoing>isSdncRpc4No_SequenceFlow4</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isSdncRpc4Yes_SequenceFlow4" name="Yes" sourceRef="isSdncRpc4_ExclusiveGateway4" targetRef="Task_0q6pzpn"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("sdncVersion") != '1610'} ]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'} </bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="isSdncRpc4No_SequenceFlow4" name="No" sourceRef="isSdncRpc4_ExclusiveGateway4" targetRef="prepareSDNCRollbackRequest_ScriptTask" /> <bpmn2:scriptTask id="Task_0q6pzpn" name="Prepare RSRC SDNCRollback Request" scriptFormat="groovy"> <bpmn2:incoming>isSdncRpc4Yes_SequenceFlow4</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0bwpkkb</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.prepareRpcSDNCRollbackRequest(execution)]]></bpmn2:script> +DoCreateNetworkInstance.prepareRpcSDNCRollbackRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:endEvent id="EndEvent_1kpt4kc"> <bpmn2:incoming>SequenceFlow_1qwubew</bpmn2:incoming> @@ -180,17 +165,17 @@ DoCreateNetworkInstance.prepareRpcSDNCRollbackRequest(execution)]]></bpmn2:scrip <bpmn2:scriptTask id="ScriptTask_0myjg9k" name="Prepare RollbackData" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_15sffxc</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_096tad6</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.prepareRollbackData(execution)]]></bpmn2:script> +DoCreateNetworkInstance.prepareRollbackData(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_0b8j5rw" sourceRef="Task_1imzwi3" targetRef="ExclusiveGateway_1bk0tqd" /> <bpmn2:scriptTask id="Task_1imzwi3" name="Prepare RSRC SDNC Activate Rollback Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0cly7z2</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0b8j5rw</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.prepareRpcSDNCActivateRollback(execution)]]></bpmn2:script> +DoCreateNetworkInstance.prepareRpcSDNCActivateRollback(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:callActivity id="CallActivity_1u07hp7" name="DoCreate NetworkInstanceRollback " calledElement="DoCreateNetworkInstanceRollback"> <bpmn2:extensionElements> @@ -218,9 +203,9 @@ DoCreateNetworkInstance.prepareRpcSDNCActivateRollback(execution)]]></bpmn2:scri <bpmn2:incoming>SequenceFlow_0vzsyrd</bpmn2:incoming> <bpmn2:incoming>SequenceFlow_17nx822</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1qwubew</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> +DoCreateNetworkInstance.postProcessResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1qwubew" sourceRef="ScriptTask_0w2ekuz" targetRef="EndEvent_1kpt4kc" /> <bpmn2:exclusiveGateway id="isRollbackOn_ExclusiveGateway" name="Is Rollback On?" default="isRollbackOn_SequenceFlow_No"> @@ -229,7 +214,7 @@ DoCreateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> <bpmn2:outgoing>isRollbackOn_SequenceFlow_No</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isRollbackOn_SequenceFlow_Yes" name="Yes" sourceRef="isRollbackOn_ExclusiveGateway" targetRef="isPONR_ExclusiveGateway"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKI_rollbackEnabled") == true && execution.getVariable("CRENWKI_isSdncRollbackNeeded") == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("CRENWKI_rollbackEnabled") == true && execution.getVariable("CRENWKI_isSdncRollbackNeeded") == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="isRollbackOn_SequenceFlow_No" name="No" sourceRef="isRollbackOn_ExclusiveGateway" targetRef="ExclusiveGateway_1umhuft" /> <bpmn2:inclusiveGateway id="ExclusiveGateway_1qb2vwe"> @@ -254,24 +239,26 @@ DoCreateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> <bpmn2:scriptTask id="ScriptTask_0j3058g" name="Set Exception Flag" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_23</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_10ttvwn</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.setExceptionFlag(execution) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_10ttvwn" sourceRef="ScriptTask_0j3058g" targetRef="isRollbackOn_ExclusiveGateway" /> - <bpmn2:textAnnotation id="TextAnnotation_1py1p84"> <bpmn2:text><![CDATA[Â Â + <bpmn2:textAnnotation id="TextAnnotation_1py1p84"> + <bpmn2:text>Â Â Include ONLY inputs/varrables: Â rollbackData, as Map -rollbackSDNCRequest -rollbackActivateSDNCRequest -rollbackNetworkRequest WorkflowException -Â ]]></bpmn2:text> -</bpmn2:textAnnotation> +Â </bpmn2:text> + </bpmn2:textAnnotation> <bpmn2:association id="Association_0nketgd" sourceRef="CallActivity_1u07hp7" targetRef="TextAnnotation_1py1p84" /> - <bpmn2:textAnnotation id="TextAnnotation_0wjpv6r"> <bpmn2:text>PO Network Rollback is created in validation.</bpmn2:text> -</bpmn2:textAnnotation> + <bpmn2:textAnnotation id="TextAnnotation_0wjpv6r"> + <bpmn2:text>PO Network Rollback is created in validation.</bpmn2:text> + </bpmn2:textAnnotation> <bpmn2:association id="Association_0eolbkz" sourceRef="ExclusiveGateway_1bk0tqd" targetRef="TextAnnotation_0wjpv6r" /> </bpmn2:subProcess> <bpmn2:serviceTask id="callCreateNetwork_ServiceTask" name="Call Create Network"> @@ -279,8 +266,8 @@ WorkflowException <camunda:connector> <camunda:inputOutput> <camunda:inputParameter name="payload">${CRENWKI_createNetworkRequest}</camunda:inputParameter> - <camunda:inputParameter name="url"><![CDATA[${UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint", execution)} -]]></camunda:inputParameter> + <camunda:inputParameter name="url">${UrnPropertiesReader.getVariable("mso.adapters.network.rest.endpoint", execution)} +</camunda:inputParameter> <camunda:inputParameter name="headers"> <camunda:map> <camunda:entry key="Authorization">#{BasicAuthHeaderValuePO}</camunda:entry> @@ -302,25 +289,25 @@ WorkflowException <bpmn2:scriptTask id="callRESTReQueryNetworkID_ScriptTask" name="Call REST ReQuery Network Id in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_13</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_35</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.callRESTReQueryAAINetworkId(execution)]]></bpmn2:script> +DoCreateNetworkInstance.callRESTReQueryAAINetworkId(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_35" name="" sourceRef="callRESTReQueryNetworkID_ScriptTask" targetRef="callRESTUpdateContrailNetwork_ScriptTask" /> <bpmn2:scriptTask id="callRESTUpdateContrailNetwork_ScriptTask" name="Call REST Update Contrail Network in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_35</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1ipz2ze</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.callRESTUpdateContrailAAINetwork(execution)]]></bpmn2:script> +DoCreateNetworkInstance.callRESTUpdateContrailAAINetwork(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:subProcess id="unexpectedErrors_SubProcess" name="Sub-process for UnexpectedErrors" triggeredByEvent="true"> <bpmn2:scriptTask id="ScriptTask_1" name="Log / Print Unexpected Error" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_10</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_14</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.processJavaException(execution)]]></bpmn2:script> +DoCreateNetworkInstance.processJavaException(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_14" name="" sourceRef="ScriptTask_1" targetRef="EndEvent_1" /> <bpmn2:startEvent id="StartEvent_1"> @@ -335,52 +322,52 @@ DoCreateNetworkInstance.processJavaException(execution)]]></bpmn2:script> <bpmn2:scriptTask id="callAAIQuery_scriptTask" name="Call REST Query Network Name In AAI" scriptFormat="groovy"> <bpmn2:incoming>isNameSentYes_SequenceFlow</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.callRESTQueryAAINetworkName(execution)]]></bpmn2:script> +DoCreateNetworkInstance.callRESTQueryAAINetworkName(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_6" name="" sourceRef="callAAIQuery_scriptTask" targetRef="isAAIQueryNameOk_ExclusiveGateway" /> <bpmn2:sequenceFlow id="SequenceFlow_3" name="" sourceRef="callGetServiceInstance" targetRef="isNameSent_ExclusiveGateway" /> <bpmn2:scriptTask id="callRESTQueryVpnBinding_ScriptTask" name="Call REST Query Vpn Binding in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_16</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_15</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(execution)]]></bpmn2:script> +DoCreateNetworkInstance.callRESTQueryAAINetworkVpnBinding(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_15" name="" sourceRef="callRESTQueryVpnBinding_ScriptTask" targetRef="callRESTQueryNetworkPolicy_ScriptTask" /> <bpmn2:scriptTask id="callRESTQueryNetworkPolicy_ScriptTask" name="Call REST Query Network Policy in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_15</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_38</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.callRESTQueryAAINetworkPolicy(execution)]]></bpmn2:script> +DoCreateNetworkInstance.callRESTQueryAAINetworkPolicy(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_38" name="" sourceRef="callRESTQueryNetworkPolicy_ScriptTask" targetRef="callRESTQueryNetworkTableRef_ScriptTask" /> <bpmn2:scriptTask id="prepareNetworkRequest_ScriptTask" name="Prepare Create Network Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_20</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_61</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareCreateNetworkRequest(execution) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_61" name="" sourceRef="prepareNetworkRequest_ScriptTask" targetRef="callCreateNetwork_ServiceTask" /> <bpmn2:scriptTask id="callRESTQueryNetworkTableRef_ScriptTask" name="Call REST Query Network TableRef in AAI" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_38</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_20</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.callRESTQueryAAINetworkTableRef(execution)]]></bpmn2:script> +DoCreateNetworkInstance.callRESTQueryAAINetworkTableRef(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_20" name="" sourceRef="callRESTQueryNetworkTableRef_ScriptTask" targetRef="prepareNetworkRequest_ScriptTask" /> <bpmn2:sequenceFlow id="SequenceFlow_1n61wit" sourceRef="createNetwork_startEvent" targetRef="ScriptTask_preprocess" /> <bpmn2:scriptTask id="ScriptTask_preprocess" name="PreProcess Incoming Request" scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_1n61wit</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0ftylq3</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.preProcessRequest(execution)]]></bpmn2:script> +DoCreateNetworkInstance.preProcessRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_0ftylq3" sourceRef="ScriptTask_preprocess" targetRef="callGetServiceInstance" /> <bpmn2:exclusiveGateway id="isNameSent_ExclusiveGateway" name="is Network Name Sent? " default="isNameSentNo_SequenceFlow"> @@ -389,7 +376,7 @@ DoCreateNetworkInstance.preProcessRequest(execution)]]></bpmn2:script> <bpmn2:outgoing>isNameSentNo_SequenceFlow</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isNameSentYes_SequenceFlow" name="Yes" sourceRef="isNameSent_ExclusiveGateway" targetRef="callAAIQuery_scriptTask"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKI_networkName") != ""}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("CRENWKI_networkName") != ""}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="isNameSentNo_SequenceFlow" name="No" sourceRef="isNameSent_ExclusiveGateway" targetRef="callRESTQueryCloudRegion_ScriptTask" /> <bpmn2:callActivity id="Task_1ipbwbj" name="Call SDNC RSRC Activate Adapter V1 " calledElement="sdncAdapter"> @@ -408,9 +395,9 @@ DoCreateNetworkInstance.preProcessRequest(execution)]]></bpmn2:script> <bpmn2:scriptTask id="Task_1rd6dg6" name="Prepare SDNC RSRC Activate Request" scriptFormat="groovy"> <bpmn2:incoming>isSdncRpc2Yes_SequenceFlow2</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_13deudk</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.prepareRpcSDNCActivateRequest(execution)]]></bpmn2:script> +DoCreateNetworkInstance.prepareRpcSDNCActivateRequest(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:exclusiveGateway id="ExclusiveGateway_0n0ptg6" name="is SDNC PRC Activate Ok? " default="SequenceFlow_18ybfu5"> <bpmn2:incoming>SequenceFlow_1t03rs2</bpmn2:incoming> @@ -421,15 +408,15 @@ DoCreateNetworkInstance.prepareRpcSDNCActivateRequest(execution)]]></bpmn2:scrip <bpmn2:sequenceFlow id="SequenceFlow_08qibb9" sourceRef="Task_1ipbwbj" targetRef="validateSDNCActivate_Task" /> <bpmn2:sequenceFlow id="SequenceFlow_1t03rs2" sourceRef="validateSDNCActivate_Task" targetRef="ExclusiveGateway_0n0ptg6" /> <bpmn2:sequenceFlow id="SequenceFlow_1jia57e" name="Yes" sourceRef="ExclusiveGateway_0n0ptg6" targetRef="Task_0zzobg6"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("CRENWKI_sdncResponseSuccess" ) == true}]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("CRENWKI_sdncResponseSuccess" ) == true}</bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="SequenceFlow_18ybfu5" name="No" sourceRef="ExclusiveGateway_0n0ptg6" targetRef="EndEvent_13v46cq" /> <bpmn2:scriptTask id="validateSDNCActivate_Task" name="Validate SDNCRSRC Activate Response " scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_08qibb9</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1t03rs2</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.validateRpcSDNCActivateResponse(execution)]]></bpmn2:script> +DoCreateNetworkInstance.validateRpcSDNCActivateResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:boundaryEvent id="BoundaryEvent_0vb26bm" attachedToRef="validateSDNCActivate_Task"> <bpmn2:outgoing>SequenceFlow_0s51ns0</bpmn2:outgoing> @@ -448,7 +435,7 @@ DoCreateNetworkInstance.validateRpcSDNCActivateResponse(execution)]]></bpmn2:scr </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isSdncRpc1No_SequenceFlow1" name="No" sourceRef="isSdncRpc1_ExclusiveGateway1" targetRef="prepareSDNCTopoRequest_ScriptTask" /> <bpmn2:sequenceFlow id="isSdncRpc1Yes_SequenceFlow1" name="Yes" sourceRef="isSdncRpc1_ExclusiveGateway1" targetRef="Task_10lubzj"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("sdncVersion") != '1610'} ]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'} </bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:callActivity id="Task_0pbtywn" name="Call SDNC RSRC Assign Adapter V1 " calledElement="sdncAdapter"> <bpmn2:extensionElements> @@ -471,16 +458,16 @@ DoCreateNetworkInstance.validateRpcSDNCActivateResponse(execution)]]></bpmn2:scr <bpmn2:outgoing>isSdncRpc2No_SequenceFlow2</bpmn2:outgoing> </bpmn2:exclusiveGateway> <bpmn2:sequenceFlow id="isSdncRpc2Yes_SequenceFlow2" name="Yes" sourceRef="isSdncRpc2_ExclusiveGateway2" targetRef="Task_1rd6dg6"> - <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("sdncVersion") != '1610'} ]]></bpmn2:conditionExpression> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{execution.getVariable("sdncVersion") != '1610'} </bpmn2:conditionExpression> </bpmn2:sequenceFlow> <bpmn2:sequenceFlow id="isSdncRpc2No_SequenceFlow2" name="No" sourceRef="isSdncRpc2_ExclusiveGateway2" targetRef="Task_0zzobg6" /> <bpmn2:scriptTask id="Task_10lubzj" name="Prepare Assign SDNC RPC Request" scriptFormat="groovy"> <bpmn2:incoming>isSdncRpc1Yes_SequenceFlow1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0j8bxnb</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() DoCreateNetworkInstance.prepareRpcSDNCRequest(execution) -]]></bpmn2:script> +</bpmn2:script> </bpmn2:scriptTask> <bpmn2:endEvent id="EndEvent_1te02c4"> <bpmn2:incoming>SequenceFlow_1s8b1m1</bpmn2:incoming> @@ -493,28 +480,29 @@ DoCreateNetworkInstance.prepareRpcSDNCRequest(execution) <bpmn2:incoming>SequenceFlow_1jia57e</bpmn2:incoming> <bpmn2:incoming>isSdncRpc2No_SequenceFlow2</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_1s8b1m1</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> +DoCreateNetworkInstance.postProcessResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_1ipz2ze" sourceRef="callRESTUpdateContrailNetwork_ScriptTask" targetRef="isSdncRpc2_ExclusiveGateway2" /> <bpmn2:scriptTask id="ScriptTask_0p3v749" name="Post Process Response" scriptFormat="groovy"> <bpmn2:incoming>isNetworkActiveYes_SequenceFlow</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_18ylufb</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.postProcessResponse(execution)]]></bpmn2:script> +DoCreateNetworkInstance.postProcessResponse(execution)</bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="SequenceFlow_18ylufb" sourceRef="ScriptTask_0p3v749" targetRef="EndEvent_0ti2ctu" /> <bpmn2:scriptTask id="callGetServiceInstance" name=" AAI Query (svc instance) " scriptFormat="groovy"> <bpmn2:incoming>SequenceFlow_0ftylq3</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing> - <bpmn2:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.* + <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.* def DoCreateNetworkInstance = new DoCreateNetworkInstance() -DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> +DoCreateNetworkInstance.getServiceInstance(execution)</bpmn2:script> </bpmn2:scriptTask> - <bpmn2:textAnnotation id="TextAnnotation_1orb6o6"> <bpmn2:text><![CDATA[if '200', Prepare PO Network Rollback]]></bpmn2:text> -</bpmn2:textAnnotation> + <bpmn2:textAnnotation id="TextAnnotation_1orb6o6"> + <bpmn2:text>if '200', Prepare PO Network Rollback</bpmn2:text> + </bpmn2:textAnnotation> <bpmn2:association id="Association_0c315jr" sourceRef="validateCreatePONetwork_ScriptTask" targetRef="TextAnnotation_1orb6o6" /> </bpmn2:process> <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> @@ -537,8 +525,8 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="_BPMNShape_ScriptTask_62" targetElement="_BPMNShape_ExclusiveGateway_62"> - <di:waypoint xsi:type="dc:Point" x="1026" y="8" /> - <di:waypoint xsi:type="dc:Point" x="1098" y="9" /> + <di:waypoint x="1026" y="8" /> + <di:waypoint x="1098" y="9" /> <bpmndi:BPMNLabel> <dc:Bounds x="1062" y="-6.5" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -546,50 +534,23 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <bpmndi:BPMNShape id="_BPMNShape_ScriptTask_63" bpmnElement="validateCreatePONetwork_ScriptTask"> <dc:Bounds x="1457" y="1258" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="isAAIQueryNameNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_62" targetElement="_BPMNShape_ExclusiveGateway_64"> - <di:waypoint xsi:type="dc:Point" x="1123" y="34" /> - <di:waypoint xsi:type="dc:Point" x="1123" y="91" /> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="isAAIQueryNameNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_62" targetElement="_BPMNShape_InclusiveGateway_4"> + <di:waypoint x="1123" y="34" /> + <di:waypoint x="1123" y="116" /> + <di:waypoint x="1224" y="116" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1131" y="39.0514827586207" width="14" height="12" /> + <dc:Bounds x="1131" y="44" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_8" bpmnElement="isAAIQueryNameYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_62" targetElement="_BPMNShape_ExclusiveGateway_73"> - <di:waypoint xsi:type="dc:Point" x="1148" y="9" /> - <di:waypoint xsi:type="dc:Point" x="1186" y="9" /> - <di:waypoint xsi:type="dc:Point" x="1186" y="9" /> - <di:waypoint xsi:type="dc:Point" x="1224" y="9" /> + <di:waypoint x="1148" y="9" /> + <di:waypoint x="1186" y="9" /> + <di:waypoint x="1186" y="9" /> + <di:waypoint x="1224" y="9" /> <bpmndi:BPMNLabel> <dc:Bounds x="1151" y="14.164179104477611" width="18" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_ExclusiveGateway_64" bpmnElement="isReturnCode404_ExclusiveGateway" isMarkerVisible="true"> - <dc:Bounds x="1098" y="91" width="50" height="50" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1026" y="110" width="65" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="isReturnCode404_No_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_64" targetElement="_BPMNShape_EndEvent_118"> - <di:waypoint xsi:type="dc:Point" x="1123" y="141" /> - <di:waypoint xsi:type="dc:Point" x="1123" y="187" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1132" y="138.4109225063519" width="14" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_9" bpmnElement="isReturnCode404_Yes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_64" targetElement="_BPMNShape_InclusiveGateway_4"> - <di:waypoint xsi:type="dc:Point" x="1148" y="116" /> - <di:waypoint xsi:type="dc:Point" x="1186" y="116" /> - <di:waypoint xsi:type="dc:Point" x="1186" y="116" /> - <di:waypoint xsi:type="dc:Point" x="1224" y="116" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1151" y="118.55844155844156" width="18" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="_BPMNShape_EndEvent_118" bpmnElement="aai_Error_EndEvent"> - <dc:Bounds x="1105" y="187" width="36" height="36" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="1085" y="228" width="77" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> <bpmndi:BPMNShape id="_BPMNShape_ServiceTask_83" bpmnElement="callCreateNetwork_ServiceTask"> <dc:Bounds x="1454" y="1135" width="100" height="80" /> </bpmndi:BPMNShape> @@ -612,15 +573,15 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_26" bpmnElement="sdncTopoNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_67" targetElement="_BPMNShape_EndEvent_124"> - <di:waypoint xsi:type="dc:Point" x="1665" y="545" /> - <di:waypoint xsi:type="dc:Point" x="1739" y="545" /> + <di:waypoint x="1665" y="545" /> + <di:waypoint x="1739" y="545" /> <bpmndi:BPMNLabel> <dc:Bounds x="1670" y="545.8651480742376" width="14" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="sdncTopoYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_67" targetElement="_BPMNShape_ScriptTask_133"> - <di:waypoint xsi:type="dc:Point" x="1615" y="545" /> - <di:waypoint xsi:type="dc:Point" x="1554" y="546" /> + <di:waypoint x="1615" y="545" /> + <di:waypoint x="1554" y="546" /> <bpmndi:BPMNLabel> <dc:Bounds x="1587" y="549.9992641545633" width="18" height="12" /> </bpmndi:BPMNLabel> @@ -635,22 +596,22 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1590" y="276" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_24" bpmnElement="SequenceFlow_11" sourceElement="_BPMNShape_ScriptTask_67" targetElement="_BPMNShape_CallActivity_19"> - <di:waypoint xsi:type="dc:Point" x="1640" y="235" /> - <di:waypoint xsi:type="dc:Point" x="1640" y="276" /> + <di:waypoint x="1640" y="235" /> + <di:waypoint x="1640" y="276" /> <bpmndi:BPMNLabel> <dc:Bounds x="1655" y="255.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_12" sourceElement="_BPMNShape_CallActivity_19" targetElement="_BPMNShape_ScriptTask_131"> - <di:waypoint xsi:type="dc:Point" x="1640" y="356" /> - <di:waypoint xsi:type="dc:Point" x="1640" y="395" /> + <di:waypoint x="1640" y="356" /> + <di:waypoint x="1640" y="395" /> <bpmndi:BPMNLabel> <dc:Bounds x="1655" y="375.5" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_35" bpmnElement="SequenceFlow_23" sourceElement="_BPMNShape_StartEvent_50"> - <di:waypoint xsi:type="dc:Point" x="143" y="1184" /> - <di:waypoint xsi:type="dc:Point" x="170" y="1184" /> + <di:waypoint x="143" y="1184" /> + <di:waypoint x="170" y="1184" /> <bpmndi:BPMNLabel> <dc:Bounds x="157" y="1169" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -659,10 +620,10 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1590" y="395" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_11" bpmnElement="SequenceFlow_5" sourceElement="_BPMNShape_ScriptTask_131" targetElement="_BPMNShape_ExclusiveGateway_67"> - <di:waypoint xsi:type="dc:Point" x="1640" y="475" /> - <di:waypoint xsi:type="dc:Point" x="1640" y="498" /> - <di:waypoint xsi:type="dc:Point" x="1640" y="498" /> - <di:waypoint xsi:type="dc:Point" x="1640" y="520" /> + <di:waypoint x="1640" y="475" /> + <di:waypoint x="1640" y="498" /> + <di:waypoint x="1640" y="498" /> + <di:waypoint x="1640" y="520" /> <bpmndi:BPMNLabel> <dc:Bounds x="1655" y="498" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -674,22 +635,22 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_39" bpmnElement="isNetworkActiveYes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_73"> - <di:waypoint xsi:type="dc:Point" x="1274" y="9" /> - <di:waypoint xsi:type="dc:Point" x="1335" y="9" /> + <di:waypoint x="1274" y="9" /> + <di:waypoint x="1335" y="9" /> <bpmndi:BPMNLabel> <dc:Bounds x="1275" y="14.380425096632202" width="18" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_44" bpmnElement="isNetworkActiveNo_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_73" targetElement="_BPMNShape_InclusiveGateway_4"> - <di:waypoint xsi:type="dc:Point" x="1249" y="34" /> - <di:waypoint xsi:type="dc:Point" x="1249" y="91" /> + <di:waypoint x="1249" y="34" /> + <di:waypoint x="1249" y="91" /> <bpmndi:BPMNLabel> <dc:Bounds x="1258" y="37.520779498373976" width="14" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_45" bpmnElement="SequenceFlow_21" sourceElement="_BPMNShape_InclusiveGateway_4" targetElement="_BPMNShape_ScriptTask_245"> - <di:waypoint xsi:type="dc:Point" x="1249" y="141" /> - <di:waypoint xsi:type="dc:Point" x="1249" y="276" /> + <di:waypoint x="1249" y="141" /> + <di:waypoint x="1249" y="276" /> <bpmndi:BPMNLabel> <dc:Bounds x="1264" y="208.5" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -710,8 +671,8 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1454" y="1538" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_54" bpmnElement="SequenceFlow_35" sourceElement="_BPMNShape_ScriptTask_134" targetElement="_BPMNShape_ScriptTask_135"> - <di:waypoint xsi:type="dc:Point" x="1504" y="1472" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="1538" /> + <di:waypoint x="1504" y="1472" /> + <di:waypoint x="1504" y="1538" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="1505" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -720,28 +681,28 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1454" y="627" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_18" bpmnElement="SequenceFlow_15" sourceElement="_BPMNShape_ScriptTask_156" targetElement="_BPMNShape_ScriptTask_215"> - <di:waypoint xsi:type="dc:Point" x="1504" y="707" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="727" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="727" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="750" /> + <di:waypoint x="1504" y="707" /> + <di:waypoint x="1504" y="727" /> + <di:waypoint x="1504" y="727" /> + <di:waypoint x="1504" y="750" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="727" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_49" bpmnElement="SequenceFlow_16" sourceElement="_BPMNShape_ScriptTask_133" targetElement="_BPMNShape_ScriptTask_156"> - <di:waypoint xsi:type="dc:Point" x="1504" y="585" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="606" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="606" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="627" /> + <di:waypoint x="1504" y="585" /> + <di:waypoint x="1504" y="606" /> + <di:waypoint x="1504" y="606" /> + <di:waypoint x="1504" y="627" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="606" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_87" bpmnElement="SequenceFlow_59" sourceElement="_BPMNShape_ServiceTask_83" targetElement="_BPMNShape_ScriptTask_63"> - <di:waypoint xsi:type="dc:Point" x="1505" y="1215" /> - <di:waypoint xsi:type="dc:Point" x="1505" y="1237" /> - <di:waypoint xsi:type="dc:Point" x="1505" y="1237" /> - <di:waypoint xsi:type="dc:Point" x="1505" y="1258" /> + <di:waypoint x="1505" y="1215" /> + <di:waypoint x="1505" y="1237" /> + <di:waypoint x="1505" y="1237" /> + <di:waypoint x="1505" y="1258" /> <bpmndi:BPMNLabel> <dc:Bounds x="1520" y="1237" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -750,10 +711,10 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1454" y="1009" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_89" bpmnElement="SequenceFlow_61" sourceElement="_BPMNShape_ScriptTask_157" targetElement="_BPMNShape_ServiceTask_83"> - <di:waypoint xsi:type="dc:Point" x="1504" y="1089" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="1111" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="1111" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="1135" /> + <di:waypoint x="1504" y="1089" /> + <di:waypoint x="1504" y="1111" /> + <di:waypoint x="1504" y="1111" /> + <di:waypoint x="1504" y="1135" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="1111" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -762,8 +723,8 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1454" y="750" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_60" bpmnElement="SequenceFlow_38" sourceElement="_BPMNShape_ScriptTask_215" targetElement="_BPMNShape_ScriptTask_333"> - <di:waypoint xsi:type="dc:Point" x="1504" y="830" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="879" /> + <di:waypoint x="1504" y="830" /> + <di:waypoint x="1504" y="879" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="854.5" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -775,16 +736,16 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_77" bpmnElement="isPONR_Yes_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_215"> - <di:waypoint xsi:type="dc:Point" x="354" y="1085" /> - <di:waypoint xsi:type="dc:Point" x="457" y="1085" /> - <di:waypoint xsi:type="dc:Point" x="457" y="1159" /> + <di:waypoint x="354" y="1085" /> + <di:waypoint x="457" y="1085" /> + <di:waypoint x="457" y="1159" /> <bpmndi:BPMNLabel> <dc:Bounds x="351" y="1088" width="18" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_85" bpmnElement="isPONR_No_SequenceFlow" sourceElement="_BPMNShape_ExclusiveGateway_215"> - <di:waypoint xsi:type="dc:Point" x="329" y="1060" /> - <di:waypoint xsi:type="dc:Point" x="329" y="1003" /> + <di:waypoint x="329" y="1060" /> + <di:waypoint x="329" y="1003" /> <bpmndi:BPMNLabel> <dc:Bounds x="339" y="1051" width="14" height="12" /> </bpmndi:BPMNLabel> @@ -796,17 +757,17 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_92" bpmnElement="sdncOk_Yeso_ExclusiveGateway" sourceElement="_BPMNShape_ExclusiveGateway_217" targetElement="_BPMNShape_ScriptTask_261"> - <di:waypoint xsi:type="dc:Point" x="552" y="845" /> - <di:waypoint xsi:type="dc:Point" x="552" y="776" /> - <di:waypoint xsi:type="dc:Point" x="713" y="776" /> + <di:waypoint x="552" y="845" /> + <di:waypoint x="552" y="776" /> + <di:waypoint x="713" y="776" /> <bpmndi:BPMNLabel> <dc:Bounds x="559" y="829" width="18" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_93" bpmnElement="sdncOk_No_ExclusiveGateway" sourceElement="_BPMNShape_ExclusiveGateway_217"> - <di:waypoint xsi:type="dc:Point" x="551" y="894" /> - <di:waypoint xsi:type="dc:Point" x="551" y="978" /> - <di:waypoint xsi:type="dc:Point" x="713" y="978" /> + <di:waypoint x="551" y="894" /> + <di:waypoint x="551" y="978" /> + <di:waypoint x="713" y="978" /> <bpmndi:BPMNLabel> <dc:Bounds x="559" y="895" width="14" height="12" /> </bpmndi:BPMNLabel> @@ -815,8 +776,8 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1199" y="276" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_53" bpmnElement="SequenceFlow_32" sourceElement="_BPMNShape_ScriptTask_245" targetElement="_BPMNShape_ScriptTask_67"> - <di:waypoint xsi:type="dc:Point" x="1299" y="316" /> - <di:waypoint xsi:type="dc:Point" x="1337" y="316" /> + <di:waypoint x="1299" y="316" /> + <di:waypoint x="1337" y="316" /> <bpmndi:BPMNLabel> <dc:Bounds x="1318" y="301" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -828,8 +789,8 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_69" bpmnElement="SequenceFlow_34" sourceElement="_BPMNShape_BoundaryEvent_38" targetElement="_BPMNShape_EndEvent_124"> - <di:waypoint xsi:type="dc:Point" x="1702" y="488" /> - <di:waypoint xsi:type="dc:Point" x="1745" y="533" /> + <di:waypoint x="1702" y="488" /> + <di:waypoint x="1745" y="533" /> <bpmndi:BPMNLabel> <dc:Bounds x="1724" y="495.5" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -838,8 +799,8 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="886" y="830" width="100" height="79" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_19" bpmnElement="SequenceFlow_13" sourceElement="_BPMNShape_ScriptTask_63" targetElement="_BPMNShape_ScriptTask_134"> - <di:waypoint xsi:type="dc:Point" x="1507" y="1338" /> - <di:waypoint xsi:type="dc:Point" x="1505" y="1392" /> + <di:waypoint x="1507" y="1338" /> + <di:waypoint x="1505" y="1392" /> <bpmndi:BPMNLabel> <dc:Bounds x="1506" y="1350" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -863,23 +824,23 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_10" sourceElement="_BPMNShape_StartEvent_71" targetElement="_BPMNShape_ScriptTask_270"> - <di:waypoint xsi:type="dc:Point" x="90" y="476" /> - <di:waypoint xsi:type="dc:Point" x="169" y="476" /> + <di:waypoint x="90" y="476" /> + <di:waypoint x="169" y="476" /> <bpmndi:BPMNLabel> <dc:Bounds x="129" y="476" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_13" bpmnElement="SequenceFlow_14" sourceElement="_BPMNShape_ScriptTask_270" targetElement="_BPMNShape_EndEvent_220"> - <di:waypoint xsi:type="dc:Point" x="269" y="476" /> - <di:waypoint xsi:type="dc:Point" x="330" y="476" /> + <di:waypoint x="269" y="476" /> + <di:waypoint x="330" y="476" /> <bpmndi:BPMNLabel> <dc:Bounds x="301" y="476" width="6" height="6" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="ScriptTask_0z2n0hl_di" targetElement="ExclusiveGateway_0lw40k5_di"> - <di:waypoint xsi:type="dc:Point" x="809" y="235" /> - <di:waypoint xsi:type="dc:Point" x="809" y="316" /> - <di:waypoint xsi:type="dc:Point" x="951" y="316" /> + <di:waypoint x="809" y="235" /> + <di:waypoint x="809" y="316" /> + <di:waypoint x="951" y="316" /> <bpmndi:BPMNLabel> <dc:Bounds x="779" y="275.5" width="90" height="0" /> </bpmndi:BPMNLabel> @@ -888,19 +849,19 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1454" y="879" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_14" bpmnElement="SequenceFlow_20" sourceElement="_BPMNShape_ScriptTask_333" targetElement="_BPMNShape_ScriptTask_157"> - <di:waypoint xsi:type="dc:Point" x="1504" y="959" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="981" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="981" /> - <di:waypoint xsi:type="dc:Point" x="1504" y="1009" /> + <di:waypoint x="1504" y="959" /> + <di:waypoint x="1504" y="981" /> + <di:waypoint x="1504" y="981" /> + <di:waypoint x="1504" y="1009" /> <bpmndi:BPMNLabel> <dc:Bounds x="1519" y="981" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1n61wit_di" bpmnElement="SequenceFlow_1n61wit"> - <di:waypoint xsi:type="dc:Point" x="433" y="195" /> - <di:waypoint xsi:type="dc:Point" x="492" y="195" /> - <di:waypoint xsi:type="dc:Point" x="492" y="195" /> - <di:waypoint xsi:type="dc:Point" x="546" y="195" /> + <di:waypoint x="433" y="195" /> + <di:waypoint x="492" y="195" /> + <di:waypoint x="492" y="195" /> + <di:waypoint x="546" y="195" /> <bpmndi:BPMNLabel> <dc:Bounds x="507" y="195" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -909,10 +870,10 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="546" y="155" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0ftylq3_di" bpmnElement="SequenceFlow_0ftylq3"> - <di:waypoint xsi:type="dc:Point" x="646" y="195" /> - <di:waypoint xsi:type="dc:Point" x="706" y="195" /> - <di:waypoint xsi:type="dc:Point" x="706" y="195" /> - <di:waypoint xsi:type="dc:Point" x="759" y="195" /> + <di:waypoint x="646" y="195" /> + <di:waypoint x="706" y="195" /> + <di:waypoint x="706" y="195" /> + <di:waypoint x="759" y="195" /> <bpmndi:BPMNLabel> <dc:Bounds x="676" y="195" width="90" height="0" /> </bpmndi:BPMNLabel> @@ -924,17 +885,17 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0635hhm_di" bpmnElement="isNameSentYes_SequenceFlow"> - <di:waypoint xsi:type="dc:Point" x="976" y="291" /> - <di:waypoint xsi:type="dc:Point" x="976" y="170" /> - <di:waypoint xsi:type="dc:Point" x="976" y="170" /> - <di:waypoint xsi:type="dc:Point" x="976" y="49" /> + <di:waypoint x="976" y="291" /> + <di:waypoint x="976" y="170" /> + <di:waypoint x="976" y="170" /> + <di:waypoint x="976" y="49" /> <bpmndi:BPMNLabel> <dc:Bounds x="988" y="275" width="18" height="13" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1sirjgc_di" bpmnElement="isNameSentNo_SequenceFlow"> - <di:waypoint xsi:type="dc:Point" x="1001" y="316" /> - <di:waypoint xsi:type="dc:Point" x="1199" y="316" /> + <di:waypoint x="1001" y="316" /> + <di:waypoint x="1199" y="316" /> <bpmndi:BPMNLabel> <dc:Bounds x="1005" y="328" width="14" height="13" /> </bpmndi:BPMNLabel> @@ -952,36 +913,36 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_13deudk_di" bpmnElement="SequenceFlow_13deudk"> - <di:waypoint xsi:type="dc:Point" x="1183" y="1578" /> - <di:waypoint xsi:type="dc:Point" x="1114" y="1578" /> + <di:waypoint x="1183" y="1578" /> + <di:waypoint x="1114" y="1578" /> <bpmndi:BPMNLabel> <dc:Bounds x="1149" y="1563" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_08qibb9_di" bpmnElement="SequenceFlow_08qibb9"> - <di:waypoint xsi:type="dc:Point" x="1014" y="1578" /> - <di:waypoint xsi:type="dc:Point" x="953" y="1578" /> + <di:waypoint x="1014" y="1578" /> + <di:waypoint x="953" y="1578" /> <bpmndi:BPMNLabel> <dc:Bounds x="984" y="1563" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1t03rs2_di" bpmnElement="SequenceFlow_1t03rs2"> - <di:waypoint xsi:type="dc:Point" x="853" y="1578" /> - <di:waypoint xsi:type="dc:Point" x="774" y="1578" /> + <di:waypoint x="853" y="1578" /> + <di:waypoint x="774" y="1578" /> <bpmndi:BPMNLabel> <dc:Bounds x="814" y="1563" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1jia57e_di" bpmnElement="SequenceFlow_1jia57e"> - <di:waypoint xsi:type="dc:Point" x="749" y="1553" /> - <di:waypoint xsi:type="dc:Point" x="749" y="1484" /> + <di:waypoint x="749" y="1553" /> + <di:waypoint x="749" y="1484" /> <bpmndi:BPMNLabel> <dc:Bounds x="757" y="1537.7047949008065" width="18" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_18ybfu5_di" bpmnElement="SequenceFlow_18ybfu5"> - <di:waypoint xsi:type="dc:Point" x="749" y="1603" /> - <di:waypoint xsi:type="dc:Point" x="749" y="1669" /> + <di:waypoint x="749" y="1603" /> + <di:waypoint x="749" y="1669" /> <bpmndi:BPMNLabel> <dc:Bounds x="758" y="1603.7606668519034" width="14" height="12" /> </bpmndi:BPMNLabel> @@ -996,9 +957,9 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0s51ns0_di" bpmnElement="SequenceFlow_0s51ns0"> - <di:waypoint xsi:type="dc:Point" x="877" y="1636" /> - <di:waypoint xsi:type="dc:Point" x="877" y="1687" /> - <di:waypoint xsi:type="dc:Point" x="767" y="1687" /> + <di:waypoint x="877" y="1636" /> + <di:waypoint x="877" y="1687" /> + <di:waypoint x="767" y="1687" /> <bpmndi:BPMNLabel> <dc:Bounds x="892" y="1661.5" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1016,16 +977,16 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0cly7z2_di" bpmnElement="SequenceFlow_0cly7z2"> - <di:waypoint xsi:type="dc:Point" x="329" y="953" /> - <di:waypoint xsi:type="dc:Point" x="329" y="910" /> + <di:waypoint x="329" y="953" /> + <di:waypoint x="329" y="910" /> <bpmndi:BPMNLabel> <dc:Bounds x="335" y="937" width="18" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_12tlymf_di" bpmnElement="SequenceFlow_12tlymf"> - <di:waypoint xsi:type="dc:Point" x="354" y="978" /> - <di:waypoint xsi:type="dc:Point" x="457" y="978" /> - <di:waypoint xsi:type="dc:Point" x="457" y="895" /> + <di:waypoint x="354" y="978" /> + <di:waypoint x="457" y="978" /> + <di:waypoint x="457" y="895" /> <bpmndi:BPMNLabel> <dc:Bounds x="350" y="988" width="14" height="12" /> </bpmndi:BPMNLabel> @@ -1037,16 +998,16 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1r5sja0_di" bpmnElement="isSdncRpc1No_SequenceFlow1"> - <di:waypoint xsi:type="dc:Point" x="1362" y="291" /> - <di:waypoint xsi:type="dc:Point" x="1362" y="195" /> - <di:waypoint xsi:type="dc:Point" x="1590" y="195" /> + <di:waypoint x="1362" y="291" /> + <di:waypoint x="1362" y="195" /> + <di:waypoint x="1590" y="195" /> <bpmndi:BPMNLabel> <dc:Bounds x="1371" y="273" width="14" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1ow57qy_di" bpmnElement="isSdncRpc1Yes_SequenceFlow1"> - <di:waypoint xsi:type="dc:Point" x="1362" y="341" /> - <di:waypoint xsi:type="dc:Point" x="1362" y="395" /> + <di:waypoint x="1362" y="341" /> + <di:waypoint x="1362" y="395" /> <bpmndi:BPMNLabel> <dc:Bounds x="1373" y="341" width="18" height="12" /> </bpmndi:BPMNLabel> @@ -1055,15 +1016,15 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1454" y="395" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0j8bxnb_di" bpmnElement="SequenceFlow_0j8bxnb"> - <di:waypoint xsi:type="dc:Point" x="1412" y="435" /> - <di:waypoint xsi:type="dc:Point" x="1454" y="435" /> + <di:waypoint x="1412" y="435" /> + <di:waypoint x="1454" y="435" /> <bpmndi:BPMNLabel> <dc:Bounds x="1433" y="420" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0d93bqw_di" bpmnElement="SequenceFlow_0d93bqw"> - <di:waypoint xsi:type="dc:Point" x="1554" y="435" /> - <di:waypoint xsi:type="dc:Point" x="1590" y="435" /> + <di:waypoint x="1554" y="435" /> + <di:waypoint x="1590" y="435" /> <bpmndi:BPMNLabel> <dc:Bounds x="1572" y="420" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1075,16 +1036,16 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0suu90e_di" bpmnElement="isSdncRpc4Yes_SequenceFlow4"> - <di:waypoint xsi:type="dc:Point" x="738" y="801" /> - <di:waypoint xsi:type="dc:Point" x="738" y="830" /> + <di:waypoint x="738" y="801" /> + <di:waypoint x="738" y="830" /> <bpmndi:BPMNLabel> <dc:Bounds x="743" y="800" width="18" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0xnyl6e_di" bpmnElement="isSdncRpc4No_SequenceFlow4"> - <di:waypoint xsi:type="dc:Point" x="763" y="776" /> - <di:waypoint xsi:type="dc:Point" x="936" y="776" /> - <di:waypoint xsi:type="dc:Point" x="936" y="830" /> + <di:waypoint x="763" y="776" /> + <di:waypoint x="936" y="776" /> + <di:waypoint x="936" y="830" /> <bpmndi:BPMNLabel> <dc:Bounds x="772" y="755" width="14" height="12" /> </bpmndi:BPMNLabel> @@ -1096,16 +1057,16 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1lphs99_di" bpmnElement="isSdncRpc2Yes_SequenceFlow2"> - <di:waypoint xsi:type="dc:Point" x="1360" y="1578" /> - <di:waypoint xsi:type="dc:Point" x="1283" y="1578" /> + <di:waypoint x="1360" y="1578" /> + <di:waypoint x="1283" y="1578" /> <bpmndi:BPMNLabel> <dc:Bounds x="1337" y="1580.0388981849903" width="18" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0lk1uut_di" bpmnElement="isSdncRpc2No_SequenceFlow2"> - <di:waypoint xsi:type="dc:Point" x="1385" y="1553" /> - <di:waypoint xsi:type="dc:Point" x="1385" y="1444" /> - <di:waypoint xsi:type="dc:Point" x="799" y="1444" /> + <di:waypoint x="1385" y="1553" /> + <di:waypoint x="1385" y="1444" /> + <di:waypoint x="799" y="1444" /> <bpmndi:BPMNLabel> <dc:Bounds x="1362" y="1543.660178848007" width="14" height="12" /> </bpmndi:BPMNLabel> @@ -1135,10 +1096,10 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1s8b1m1_di" bpmnElement="SequenceFlow_1s8b1m1"> - <di:waypoint xsi:type="dc:Point" x="699" y="1444" /> - <di:waypoint xsi:type="dc:Point" x="597" y="1444" /> - <di:waypoint xsi:type="dc:Point" x="597" y="1444" /> - <di:waypoint xsi:type="dc:Point" x="503" y="1444" /> + <di:waypoint x="699" y="1444" /> + <di:waypoint x="597" y="1444" /> + <di:waypoint x="597" y="1444" /> + <di:waypoint x="503" y="1444" /> <bpmndi:BPMNLabel> <dc:Bounds x="612" y="1444" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1150,8 +1111,8 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="688" y="1053" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0b8j5rw_di" bpmnElement="SequenceFlow_0b8j5rw"> - <di:waypoint xsi:type="dc:Point" x="379" y="870" /> - <di:waypoint xsi:type="dc:Point" x="432" y="870" /> + <di:waypoint x="379" y="870" /> + <di:waypoint x="432" y="870" /> <bpmndi:BPMNLabel> <dc:Bounds x="406" y="855" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1160,10 +1121,10 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="279" y="830" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1ipz2ze_di" bpmnElement="SequenceFlow_1ipz2ze"> - <di:waypoint xsi:type="dc:Point" x="1454" y="1578" /> - <di:waypoint xsi:type="dc:Point" x="1432" y="1578" /> - <di:waypoint xsi:type="dc:Point" x="1432" y="1578" /> - <di:waypoint xsi:type="dc:Point" x="1410" y="1578" /> + <di:waypoint x="1454" y="1578" /> + <di:waypoint x="1432" y="1578" /> + <di:waypoint x="1432" y="1578" /> + <di:waypoint x="1410" y="1578" /> <bpmndi:BPMNLabel> <dc:Bounds x="1447" y="1578" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1172,30 +1133,30 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="841" y="1053" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0vzsyrd_di" bpmnElement="SequenceFlow_0vzsyrd"> - <di:waypoint xsi:type="dc:Point" x="941" y="1093" /> - <di:waypoint xsi:type="dc:Point" x="1007" y="1093" /> + <di:waypoint x="941" y="1093" /> + <di:waypoint x="1007" y="1093" /> <bpmndi:BPMNLabel> <dc:Bounds x="974" y="1078" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0bwpkkb_di" bpmnElement="SequenceFlow_0bwpkkb"> - <di:waypoint xsi:type="dc:Point" x="738" y="910" /> - <di:waypoint xsi:type="dc:Point" x="738" y="953" /> + <di:waypoint x="738" y="910" /> + <di:waypoint x="738" y="953" /> <bpmndi:BPMNLabel> <dc:Bounds x="753" y="922" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0lndbvr_di" bpmnElement="SequenceFlow_0lndbvr"> - <di:waypoint xsi:type="dc:Point" x="936" y="909" /> - <di:waypoint xsi:type="dc:Point" x="936" y="978" /> - <di:waypoint xsi:type="dc:Point" x="763" y="978" /> + <di:waypoint x="936" y="909" /> + <di:waypoint x="936" y="978" /> + <di:waypoint x="763" y="978" /> <bpmndi:BPMNLabel> <dc:Bounds x="951" y="944" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_096tad6_di" bpmnElement="SequenceFlow_096tad6"> - <di:waypoint xsi:type="dc:Point" x="788" y="1093" /> - <di:waypoint xsi:type="dc:Point" x="841" y="1093" /> + <di:waypoint x="788" y="1093" /> + <di:waypoint x="841" y="1093" /> <bpmndi:BPMNLabel> <dc:Bounds x="815" y="1078" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1204,15 +1165,15 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1036" y="901" width="252" height="119" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="Association_0nketgd_di" bpmnElement="Association_0nketgd"> - <di:waypoint xsi:type="dc:Point" x="941" y="1069" /> - <di:waypoint xsi:type="dc:Point" x="1041" y="1020" /> + <di:waypoint x="941" y="1069" /> + <di:waypoint x="1041" y="1020" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0w2ekuz_di" bpmnElement="ScriptTask_0w2ekuz"> <dc:Bounds x="1007" y="1053" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1qwubew_di" bpmnElement="SequenceFlow_1qwubew"> - <di:waypoint xsi:type="dc:Point" x="1107" y="1093" /> - <di:waypoint xsi:type="dc:Point" x="1160" y="1093" /> + <di:waypoint x="1107" y="1093" /> + <di:waypoint x="1160" y="1093" /> <bpmndi:BPMNLabel> <dc:Bounds x="1134" y="1068" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1224,15 +1185,15 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_19kcbiw_di" bpmnElement="isRollbackOn_SequenceFlow_Yes"> - <di:waypoint xsi:type="dc:Point" x="329" y="1159" /> - <di:waypoint xsi:type="dc:Point" x="329" y="1110" /> + <di:waypoint x="329" y="1159" /> + <di:waypoint x="329" y="1110" /> <bpmndi:BPMNLabel> <dc:Bounds x="337" y="1142" width="18" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0pl3e54_di" bpmnElement="isRollbackOn_SequenceFlow_No"> - <di:waypoint xsi:type="dc:Point" x="354" y="1184" /> - <di:waypoint xsi:type="dc:Point" x="432" y="1184" /> + <di:waypoint x="354" y="1184" /> + <di:waypoint x="432" y="1184" /> <bpmndi:BPMNLabel> <dc:Bounds x="355" y="1190" width="14" height="12" /> </bpmndi:BPMNLabel> @@ -1244,8 +1205,8 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_15sffxc_di" bpmnElement="SequenceFlow_15sffxc"> - <di:waypoint xsi:type="dc:Point" x="738" y="1003" /> - <di:waypoint xsi:type="dc:Point" x="738" y="1053" /> + <di:waypoint x="738" y="1003" /> + <di:waypoint x="738" y="1053" /> <bpmndi:BPMNLabel> <dc:Bounds x="753" y="1028" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1257,8 +1218,8 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0k7y7b5_di" bpmnElement="SequenceFlow_0k7y7b5"> - <di:waypoint xsi:type="dc:Point" x="482" y="870" /> - <di:waypoint xsi:type="dc:Point" x="527" y="870" /> + <di:waypoint x="482" y="870" /> + <di:waypoint x="527" y="870" /> <bpmndi:BPMNLabel> <dc:Bounds x="505" y="845" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1267,8 +1228,8 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1335" y="-31" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_18ylufb_di" bpmnElement="SequenceFlow_18ylufb"> - <di:waypoint xsi:type="dc:Point" x="1435" y="9" /> - <di:waypoint xsi:type="dc:Point" x="1486" y="9" /> + <di:waypoint x="1435" y="9" /> + <di:waypoint x="1486" y="9" /> <bpmndi:BPMNLabel> <dc:Bounds x="1461" y="-6" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1280,9 +1241,9 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_17nx822_di" bpmnElement="SequenceFlow_17nx822"> - <di:waypoint xsi:type="dc:Point" x="482" y="1184" /> - <di:waypoint xsi:type="dc:Point" x="1057" y="1184" /> - <di:waypoint xsi:type="dc:Point" x="1057" y="1133" /> + <di:waypoint x="482" y="1184" /> + <di:waypoint x="1057" y="1184" /> + <di:waypoint x="1057" y="1133" /> <bpmndi:BPMNLabel> <dc:Bounds x="770" y="1169" width="0" height="0" /> </bpmndi:BPMNLabel> @@ -1291,22 +1252,22 @@ DoCreateNetworkInstance.getServiceInstance(execution)]]></bpmn2:script> <dc:Bounds x="1606" y="1241" width="233" height="37" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="Association_0c315jr_di" bpmnElement="Association_0c315jr"> - <di:waypoint xsi:type="dc:Point" x="1557" y="1289" /> - <di:waypoint xsi:type="dc:Point" x="1621" y="1278" /> + <di:waypoint x="1557" y="1289" /> + <di:waypoint x="1621" y="1278" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="TextAnnotation_0wjpv6r_di" bpmnElement="TextAnnotation_0wjpv6r"> <dc:Bounds x="341" y="735" width="180" height="36" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="Association_0eolbkz_di" bpmnElement="Association_0eolbkz"> - <di:waypoint xsi:type="dc:Point" x="452" y="850" /> - <di:waypoint xsi:type="dc:Point" x="435" y="771" /> + <di:waypoint x="452" y="850" /> + <di:waypoint x="435" y="771" /> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ScriptTask_0j3058g_di" bpmnElement="ScriptTask_0j3058g"> <dc:Bounds x="170" y="1144" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_10ttvwn_di" bpmnElement="SequenceFlow_10ttvwn"> - <di:waypoint xsi:type="dc:Point" x="270" y="1184" /> - <di:waypoint xsi:type="dc:Point" x="304" y="1184" /> + <di:waypoint x="270" y="1184" /> + <di:waypoint x="304" y="1184" /> <bpmndi:BPMNLabel> <dc:Bounds x="287" y="1159" width="0" height="0" /> </bpmndi:BPMNLabel> diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java index fedec4f732..58c6db109c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java @@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.PathNotFoundException; @Component public class SDNCRequestTasks { @@ -61,6 +62,9 @@ public class SDNCRequestTasks { String response = sdncClient.post(request.getSDNCPayload(),request.getTopology()); String finalMessageIndicator = JsonPath.read(response, "$.output.ack-final-indicator"); execution.setVariable("isSDNCCompleted", convertIndicatorToBoolean(finalMessageIndicator)); + } catch(PathNotFoundException e) { + logger.error("Error Parsing SDNC Response", e); + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,"Error Parsing SDNC Response"); } catch (MapperException e) { logger.error("Error Parsing SDNC Response", e); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,"Error Parsing SDNC Response"); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index 66e2694db6..7670e0245d 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -311,8 +311,14 @@ public class WorkflowActionBBTasks { InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); String errorMsg = null; String rollbackErrorMsg = null; - boolean rollbackCompleted = (boolean) execution.getVariable("isRollbackComplete"); - boolean isRollbackFailure = (boolean) execution.getVariable("isRollback"); + Boolean rollbackCompleted = (Boolean) execution.getVariable("isRollbackComplete"); + Boolean isRollbackFailure = (Boolean) execution.getVariable("isRollback"); + + if(rollbackCompleted==null) + rollbackCompleted = false; + + if(isRollbackFailure==null) + isRollbackFailure = false; if(rollbackCompleted){ rollbackErrorMsg = "Rollback has been completed successfully."; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java index 37e13fb8d8..13ba107576 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java @@ -105,12 +105,20 @@ public class SdnCommonTasks { responseCode = (String) embeddedResponse.get(RESPONSE_CODE); responseMessage = (String) embeddedResponse.get(RESPONSE_MESSAGE); } - + ObjectMapper objMapper = new ObjectMapper(); + String jsonResponse; + try { + jsonResponse = objMapper.writeValueAsString(output); + msoLogger.debug(jsonResponse); + } catch (JsonProcessingException e) { + msoLogger.warnSimple("Could not convert SDNC Response to String", e); + jsonResponse = ""; + } msoLogger.info("ResponseCode: " + responseCode + " ResponseMessage: " + responseMessage); int code = StringUtils.isNotEmpty(responseCode) ? Integer.parseInt(responseCode) : 0; if (isHttpCodeSuccess(code)) { msoLogger.info("Successful Response from SDNC"); - return responseMessage; + return jsonResponse; } else { String errorMessage = String.format(SDNC_CODE_NOT_0_OR_IN_200_299, responseMessage); msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, errorMessage, "BPMN", MsoLogger.getServiceName(), diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java index fc269cd7cc..0ef764ac99 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java @@ -39,8 +39,10 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.mockito.InjectMocks; import org.mockito.Mock; +import org.mockito.Mockito; import org.mockito.Spy; import org.onap.so.bpmn.BaseTaskTest; +import org.onap.so.bpmn.core.WorkflowException; import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.db.request.beans.InfraActiveRequests; @@ -54,6 +56,9 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { @Spy protected WorkflowActionBBTasks workflowActionBBTasks; + @Mock + InfraActiveRequests reqMock; + private DelegateExecution execution; @Rule @@ -284,4 +289,23 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { workflowActionBBTasks.checkRetryStatus(execution); assertEquals(0,execution.getVariable("retryCount")); } + + + @Test + public void updateRequestStatusToFailed_Null_Rollback(){ + String reqId = "reqId123"; + execution.setVariable("mso-request-id", reqId); + execution.setVariable("retryCount", 3); + execution.setVariable("handlingCode","Success"); + execution.setVariable("gCurrentSequence",1); + WorkflowException we = new WorkflowException("WorkflowAction",1231,"Error Case"); + execution.setVariable("WorkflowException",we); + + doReturn(reqMock).when(requestsDbClient).getInfraActiveRequestbyRequestId(reqId); + workflowActionBBTasks.updateRequestStatusToFailed(execution); + Mockito.verify( reqMock, Mockito.times(1)).setStatusMessage("Error Case"); + Mockito.verify( reqMock, Mockito.times(1)).setRequestStatus("FAILED"); + Mockito.verify( reqMock, Mockito.times(1)).setProgress(Long.valueOf(100)); + Mockito.verify( reqMock, Mockito.times(1)).setLastModifiedBy("CamundaBPMN"); + } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java index e30fe660c3..2636aec4a7 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdn/common/SdnCommonTasksTest.java @@ -60,12 +60,13 @@ public class SdnCommonTasksTest{ @Test public void validateSDNResponseTest() throws BadResponseException { + String jsonResponse = "{\"output\":{\"response-code\":\"0\",\"response-message\":\"success\"}}"; LinkedHashMap<String, Object> responseMap = new LinkedHashMap<>(); LinkedHashMap<String, Object> output = new LinkedHashMap<>(); output.put("response-code", "0"); output.put("response-message", "success"); responseMap.put("output", output); - assertEquals("success", sdnCommonTasks.validateSDNResponse(responseMap)); + assertEquals(jsonResponse, sdnCommonTasks.validateSDNResponse(responseMap)); } @Test diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java index cc1c5c5329..9117b8ea64 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/SDNCClientIT.java @@ -77,6 +77,6 @@ public class SDNCClientIT extends BaseIntegrationTest { .withHeader("Content-Type", "application/json").withBody(responseJson))); String response = SPY_sdncClient.post("", SDNCTopology.NETWORK); - JSONAssert.assertEquals("", response, false); + JSONAssert.assertEquals(responseJson, response, true); } } diff --git a/common/src/main/java/org/onap/so/client/HttpClientFactory.java b/common/src/main/java/org/onap/so/client/HttpClientFactory.java new file mode 100644 index 0000000000..9705d7d0c4 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/HttpClientFactory.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2018 Nokia. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.client; + +import java.net.URL; +import org.onap.so.utils.TargetEntity; + +public class HttpClientFactory { + + public HttpClient create(URL host, String contentType, TargetEntity targetEntity) { + return new HttpClient(host, contentType, targetEntity); + } +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java index 79d2a867e8..32693c356e 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java @@ -692,7 +692,7 @@ public class ServiceInstances { sir = convertJsonToServiceInstanceRequest(requestJSON, action, startTime, sir, msoRequest, requestId, requestUri); String requestScope = deriveRequestScope(action, sir, requestUri); - InfraActiveRequests currentActiveReq = msoRequest.createRequestObject (sir, action, requestId, Status.PENDING, requestJSON, requestScope); + InfraActiveRequests currentActiveReq = msoRequest.createRequestObject (sir, action, requestId, Status.IN_PROGRESS, requestJSON, requestScope); if(sir.getRequestDetails().getRequestParameters() != null){ aLaCarte = sir.getRequestDetails().getRequestParameters().getALaCarte(); } @@ -864,7 +864,7 @@ public class ServiceInstances { sir.setInstanceGroupId(instanceGroupId); String requestScope = ModelType.instanceGroup.toString(); - InfraActiveRequests currentActiveReq = msoRequest.createRequestObject (sir, action, requestId, Status.PENDING, null, requestScope); + InfraActiveRequests currentActiveReq = msoRequest.createRequestObject (sir, action, requestId, Status.IN_PROGRESS, null, requestScope); setInstanceId(currentActiveReq, requestScope, null, instanceIdMap); try { validateHeaders(requestContext); @@ -1018,19 +1018,7 @@ public class ServiceInstances { .errorInfo(errorLoggerInfo).build(); updateStatus(currentActiveReq, Status.FAILED, validateException.getMessage()); throw validateException; - } - - currentActiveReq.setRequestStatus(Status.IN_PROGRESS.name()); - setInstanceId(currentActiveReq, requestScope, jsonResponse.getRequestReferences().getInstanceId(), new HashMap<>()); - - try{ - infraActiveRequestsClient.save(currentActiveReq); - }catch(Exception e){ - ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, MsoLogger.ErrorCode.DataError).errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); - throw new RequestDbFailureException.Builder(SAVE_TO_DB, e.toString(), HttpStatus.SC_INTERNAL_SERVER_ERROR, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e) - .errorInfo(errorLoggerInfo).build(); - } - + } return builder.buildResponse(HttpStatus.SC_ACCEPTED, requestClientParameter.getRequestId(), jsonResponse, requestClientParameter.getApiVersion()); } } @@ -641,6 +641,7 @@ <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> + <version>3.11.1</version> <scope>test</scope> </dependency> <dependency> |