diff options
33 files changed, 965 insertions, 584 deletions
@@ -60,6 +60,11 @@ committers: company: 'Nokia' id: 'lukaszM' timezone: 'Europe/Warsaw' + - name: 'Ramesh Parthasarathy' + email: 'ramesh.parthasarathy@att.com' + company: 'ATT' + id: 'parthasram' + timezone: 'PST' tsc: approval: 'https://lists.onap.org/pipermail/onap-tsc' changes: @@ -96,3 +101,6 @@ tsc: name: 'Marcus Williams' name: 'Sanchita Pathak' name: 'Subhash Kumar Singh' + - type: 'addition' + name: 'Ramesh Parthasarathy' + link: 'https://wiki.onap.org/display/Meetings/TSC+2020-12-03' diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java index a7c47f8f53..c4ef3678c3 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java @@ -363,7 +363,8 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin { if (latestStack == null && notFoundIsSuccess) { return null; } else if (latestStack != null) { - statusHandler.updateStackStatus(latestStack); + String requestId = MDC.get(ONAPLogConstants.MDCs.REQUEST_ID); + statusHandler.updateStackStatus(latestStack, requestId); if (stackStatus.equals(latestStack.getStackStatus())) { if (LocalDateTime.now().isAfter(stopPolling)) { logger.error("Polling of stack timed out with Status: {}", latestStack.getStackStatus()); diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneUtils.java index b875c2c8bb..c8fae84479 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneUtils.java @@ -6,6 +6,8 @@ * ================================================================================ * Modifications Copyright (c) 2019 Samsung * ================================================================================ + * Modifications Copyright (c) 2020 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 @@ -26,7 +28,6 @@ package org.onap.so.openstack.utils; import java.util.HashMap; import java.util.Map; import java.util.Optional; -import org.onap.so.cloud.authentication.AuthenticationMethodFactory; import org.onap.so.db.catalog.beans.CloudIdentity; import org.onap.so.db.catalog.beans.CloudSite; import org.onap.logging.filter.base.ErrorCode; @@ -39,7 +40,6 @@ import org.onap.so.openstack.exceptions.MsoOpenstackException; import org.onap.so.openstack.exceptions.MsoTenantAlreadyExists; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.woorea.openstack.base.client.OpenStackBaseException; import com.woorea.openstack.base.client.OpenStackConnectException; @@ -59,19 +59,7 @@ import com.woorea.openstack.keystone.utils.KeystoneUtils; public class MsoKeystoneUtils extends MsoTenantUtils { public static final String DELETE_TENANT = "Delete Tenant"; - private static Logger logger = LoggerFactory.getLogger(MsoKeystoneUtils.class); - - @Autowired - private AuthenticationMethodFactory authenticationMethodFactory; - - @Autowired - private MsoHeatUtils msoHeatUtils; - - @Autowired - private MsoNeutronUtils msoNeutronUtils; - - @Autowired - private MsoTenantUtilsFactory tenantUtilsFactory; + private static final Logger LOGGER = LoggerFactory.getLogger(MsoKeystoneUtils.class); /** * Create a tenant with the specified name in the given cloud. If the tenant already exists, an Exception will be @@ -94,7 +82,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { // Obtain the cloud site information where we will create the tenant Optional<CloudSite> cloudSiteOpt = cloudConfig.getCloudSite(cloudSiteId); if (!cloudSiteOpt.isPresent()) { - logger.error("{} MSOCloudSite {} not found {} ", MessageEnum.RA_CREATE_TENANT_ERR, cloudSiteId, + LOGGER.error("{} MSOCloudSite {} not found {} ", MessageEnum.RA_CREATE_TENANT_ERR, cloudSiteId, ErrorCode.DataError.getValue()); throw new MsoCloudSiteNotFound(cloudSiteId); } @@ -106,7 +94,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { if (tenant != null) { // Tenant already exists. Throw an exception - logger.error("{} Tenant name {} already exists on Cloud site id {}, {}", + LOGGER.error("{} Tenant name {} already exists on Cloud site id {}, {}", MessageEnum.RA_TENANT_ALREADY_EXIST, tenantName, cloudSiteId, ErrorCode.DataError.getValue()); throw new MsoTenantAlreadyExists(tenantName, cloudSiteId); } @@ -153,7 +141,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { // Failed to attach MSO User to the new tenant. Can't operate without access, // so roll back the tenant. if (!backout) { - logger.warn("{} Create Tenant errored, Tenant deletion suppressed {} ", + LOGGER.warn("{} Create Tenant errored, Tenant deletion suppressed {} ", MessageEnum.RA_CREATE_TENANT_ERR, ErrorCode.DataError.getValue()); } else { try { @@ -161,7 +149,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { executeAndRecordOpenstackRequest(request); } catch (Exception e2) { // Just log this one. We will report the original exception. - logger.error("{} Nested exception rolling back tenant {} ", MessageEnum.RA_CREATE_TENANT_ERR, + LOGGER.error("{} Nested exception rolling back tenant {} ", MessageEnum.RA_CREATE_TENANT_ERR, ErrorCode.DataError.getValue(), e2); } } @@ -295,14 +283,14 @@ public class MsoKeystoneUtils extends MsoTenantUtils { // Check that the tenant exists. Also, need the ID to delete Tenant tenant = findTenantById(keystoneAdminClient, tenantId); if (tenant == null) { - logger.error("{} Tenant id {} not found on cloud site id {}, {}", MessageEnum.RA_TENANT_NOT_FOUND, + LOGGER.error("{} Tenant id {} not found on cloud site id {}, {}", MessageEnum.RA_TENANT_NOT_FOUND, tenantId, cloudSiteId, ErrorCode.DataError.getValue()); return false; } OpenStackRequest<Void> request = keystoneAdminClient.tenants().delete(tenant.getId()); executeAndRecordOpenstackRequest(request); - logger.debug("Deleted Tenant {} ({})", tenant.getId(), tenant.getName()); + LOGGER.debug("Deleted Tenant {} ({})", tenant.getId(), tenant.getName()); } catch (OpenStackBaseException e) { // Convert Keystone OpenStackResponseException to MsoOpenstackException throw keystoneErrorToMsoException(e, DELETE_TENANT); @@ -341,7 +329,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { Tenant tenant = findTenantByName(keystoneAdminClient, tenantName); if (tenant == null) { // OK if tenant already doesn't exist. - logger.error("{} Tenant {} not found on Cloud site id {}, {}", MessageEnum.RA_TENANT_NOT_FOUND, + LOGGER.error("{} Tenant {} not found on Cloud site id {}, {}", MessageEnum.RA_TENANT_NOT_FOUND, tenantName, cloudSiteId, ErrorCode.DataError.getValue()); return false; } @@ -350,7 +338,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { OpenStackRequest<Void> request = keystoneAdminClient.tenants().delete(tenant.getId()); executeAndRecordOpenstackRequest(request); - logger.debug("Deleted Tenant {} ({})", tenant.getId(), tenant.getName()); + LOGGER.debug("Deleted Tenant {} ({})", tenant.getId(), tenant.getName()); } catch (OpenStackBaseException e) { // Note: It doesn't seem to matter if tenant doesn't exist, no exception is thrown. @@ -419,7 +407,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { } catch (RuntimeException e) { String error = "Identity service not found: region=" + region + ",cloud=" + cloudIdentity.getId(); - logger.error("{} Region: {} Cloud identity {} {} Exception in findEndpointURL ", + LOGGER.error("{} Region: {} Cloud identity {} {} Exception in findEndpointURL ", MessageEnum.IDENTITY_SERVICE_NOT_FOUND, region, cloudIdentity.getId(), ErrorCode.DataError.getValue(), e); throw new MsoAdapterException(error, e); @@ -476,7 +464,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { if (e.getStatus() == 404) { return null; } else { - logger.error("{} {} Openstack Error, GET Tenant by Id ({}): ", MessageEnum.RA_CONNECTION_EXCEPTION, + LOGGER.error("{} {} Openstack Error, GET Tenant by Id ({}): ", MessageEnum.RA_CONNECTION_EXCEPTION, ErrorCode.DataError.getValue(), tenantId, e); throw e; } @@ -505,7 +493,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { if (e.getStatus() == 404) { return null; } else { - logger.error("{} {} Openstack Error, GET Tenant By Name ({}) ", MessageEnum.RA_CONNECTION_EXCEPTION, + LOGGER.error("{} {} Openstack Error, GET Tenant By Name ({}) ", MessageEnum.RA_CONNECTION_EXCEPTION, ErrorCode.DataError.getValue(), tenantName, e); throw e; } @@ -534,7 +522,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { // Not found by ID. Search for name return findUserByName(adminClient, userNameOrId); } else { - logger.error("{} {} Openstack Error, GET User ({}) ", MessageEnum.RA_CONNECTION_EXCEPTION, + LOGGER.error("{} {} Openstack Error, GET User ({}) ", MessageEnum.RA_CONNECTION_EXCEPTION, ErrorCode.DataError.getValue(), userNameOrId, e); throw e; } @@ -562,7 +550,7 @@ public class MsoKeystoneUtils extends MsoTenantUtils { if (e.getStatus() == 404) { return null; } else { - logger.error("{} {} Openstack Error, GET User By Name ({}): ", MessageEnum.RA_CONNECTION_EXCEPTION, + LOGGER.error("{} {} Openstack Error, GET User By Name ({}): ", MessageEnum.RA_CONNECTION_EXCEPTION, ErrorCode.DataError.getValue(), userName, e); throw e; } diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/StackStatusHandler.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/StackStatusHandler.java index bf29c39f99..8f1543e561 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/StackStatusHandler.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/StackStatusHandler.java @@ -43,9 +43,8 @@ public class StackStatusHandler { private RequestsDbClient requestDBClient; @Async - public void updateStackStatus(Stack stack) { + public void updateStackStatus(Stack stack, String requestId) { try { - String requestId = MDC.get(ONAPLogConstants.MDCs.REQUEST_ID); String stackStatus = mapper.writeValueAsString(stack); RequestProcessingData requestProcessingData = requestDBClient.getRequestProcessingDataBySoRequestIdAndNameAndGrouping(requestId, diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java index 4f7fed7df4..5bd7c29313 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsTest.java @@ -36,7 +36,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -46,6 +45,7 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.Spy; import org.mockito.junit.MockitoJUnitRunner; +import org.onap.logging.ref.slf4j.ONAPLogConstants; import org.onap.so.db.request.beans.CloudApiRequests; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.client.RequestsDbClient; @@ -53,6 +53,7 @@ import org.onap.so.openstack.beans.CreateStackRequest; import org.onap.so.openstack.exceptions.MsoException; import org.onap.so.openstack.exceptions.MsoOpenstackException; import org.onap.so.openstack.exceptions.MsoStackAlreadyExists; +import org.slf4j.MDC; import org.springframework.core.env.Environment; import com.fasterxml.jackson.databind.ObjectMapper; import com.woorea.openstack.base.client.OpenStackResponseException; @@ -63,6 +64,7 @@ import com.woorea.openstack.heat.StackResource.DeleteStack; import com.woorea.openstack.heat.model.CreateStackParam; import com.woorea.openstack.heat.model.Resources; import com.woorea.openstack.heat.model.Stack; +import java.util.UUID; @RunWith(MockitoJUnitRunner.class) public class MsoHeatUtilsTest extends MsoHeatUtils { @@ -104,9 +106,15 @@ public class MsoHeatUtilsTest extends MsoHeatUtils { private String cloudSiteId = "cloudSiteId"; private String tenantId = "tenantId"; + private String getRequestId() { + return MDC.get(ONAPLogConstants.MDCs.REQUEST_ID); + } + @Before public void setup() { doReturn("15").when(env).getProperty("org.onap.so.adapters.po.pollInterval", "15"); + String requestId = UUID.randomUUID().toString(); + MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestId); } @Test @@ -117,6 +125,7 @@ public class MsoHeatUtilsTest extends MsoHeatUtils { stack.setStackStatus("CREATE_IN_PROGRESS"); stack.setStackStatusReason("Stack Finished"); + String requestId = getRequestId(); Stack latestStack = new Stack(); latestStack.setId("id"); latestStack.setStackName("stackName"); @@ -125,7 +134,7 @@ public class MsoHeatUtilsTest extends MsoHeatUtils { doReturn(latestStack).when(heatUtils).queryHeatStack(isA(Heat.class), eq("stackName/id")); doReturn(heatClient).when(heatUtils).getHeatClient(cloudSiteId, tenantId); Stack actual = heatUtils.pollStackForStatus(1, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId, false); - Mockito.verify(stackStatusHandler, times(1)).updateStackStatus(latestStack); + Mockito.verify(stackStatusHandler, times(1)).updateStackStatus(latestStack, requestId); Mockito.verify(heatUtils, times(1)).queryHeatStack(isA(Heat.class), eq("stackName/id")); assertEquals(true, actual != null); } @@ -137,12 +146,13 @@ public class MsoHeatUtilsTest extends MsoHeatUtils { stack.setStackName("stackName"); stack.setStackStatus("CREATE_IN_PROGRESS"); stack.setStackStatusReason("Stack Finished"); - doNothing().when(stackStatusHandler).updateStackStatus(stack); + String requestId = getRequestId(); + doNothing().when(stackStatusHandler).updateStackStatus(stack, requestId); doReturn(stack).when(heatUtils).queryHeatStack(isA(Heat.class), eq("stackName/id")); doReturn(heatClient).when(heatUtils).getHeatClient(cloudSiteId, tenantId); doReturn("61").when(env).getProperty("org.onap.so.adapters.po.pollInterval", "15"); Stack actual = heatUtils.pollStackForStatus(1, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId, false); - Mockito.verify(stackStatusHandler, times(1)).updateStackStatus(stack); + Mockito.verify(stackStatusHandler, times(1)).updateStackStatus(stack, requestId); Mockito.verify(heatUtils, times(1)).queryHeatStack(isA(Heat.class), eq("stackName/id")); assertEquals(true, actual != null); } @@ -154,11 +164,12 @@ public class MsoHeatUtilsTest extends MsoHeatUtils { stack.setStackName("stackName"); stack.setStackStatus("CREATE_IN_PROGRESS"); stack.setStackStatusReason("Stack Finished"); - doNothing().when(stackStatusHandler).updateStackStatus(stack); + String requestId = getRequestId(); + doNothing().when(stackStatusHandler).updateStackStatus(stack, requestId); doReturn(stack).when(heatUtils).queryHeatStack(isA(Heat.class), eq("stackName/id")); doReturn(heatClient).when(heatUtils).getHeatClient(cloudSiteId, tenantId); Stack actual = heatUtils.pollStackForStatus(1, stack, "CREATE_IN_PROGRESS", cloudSiteId, tenantId, false); - Mockito.verify(stackStatusHandler, times(5)).updateStackStatus(stack); + Mockito.verify(stackStatusHandler, times(5)).updateStackStatus(stack, requestId); Mockito.verify(heatUtils, times(5)).queryHeatStack(isA(Heat.class), eq("stackName/id")); assertEquals(true, actual != null); } @@ -417,6 +428,7 @@ public class MsoHeatUtilsTest extends MsoHeatUtils { CreateStackParam createStackParam = new CreateStackParam(); createStackParam.setStackName("stackName"); + String requestId = getRequestId(); doReturn(heatClient).when(heatUtils).getHeatClient(cloudSiteId, tenantId); doReturn(stackResource).when(heatClient).getStacks(); doReturn(mockCreateStack).when(stackResource).create(createStackParam); @@ -425,7 +437,7 @@ public class MsoHeatUtilsTest extends MsoHeatUtils { heatUtils.createStack(createStackParam, cloudSiteId, tenantId); Mockito.verify(stackResource, times(1)).create(createStackParam); - Mockito.verify(heatUtils, times(1)).saveStackRequest(eq(createStackParam), isNull(), eq("stackName")); + Mockito.verify(heatUtils, times(1)).saveStackRequest(eq(createStackParam), eq(requestId), eq("stackName")); Mockito.verify(heatClient, times(1)).getStacks(); Mockito.verify(stackResource, times(1)).create(createStackParam); } diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/StackStatusHandlerTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/StackStatusHandlerTest.java index 985a39a76b..c210a8b6ad 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/StackStatusHandlerTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/StackStatusHandlerTest.java @@ -26,6 +26,7 @@ import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.times; import java.io.IOException; +import java.util.UUID; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; @@ -47,35 +48,41 @@ public class StackStatusHandlerTest { @Mock RequestsDbClient requestDBClient; + private String getRequestId() { + return UUID.randomUUID().toString(); + } + @Test public final void recordExists_Test() throws MsoException, IOException { RequestProcessingData requestProcessingData = new RequestProcessingData(); requestProcessingData.setValue("testMe"); + String requestId = getRequestId(); doReturn(requestProcessingData).when(requestDBClient) - .getRequestProcessingDataBySoRequestIdAndNameAndGrouping(null, "stackName", "id"); + .getRequestProcessingDataBySoRequestIdAndNameAndGrouping(requestId, "stackName", "id"); Stack latestStack = new Stack(); latestStack.setId("id"); latestStack.setStackName("stackName"); latestStack.setStackStatus("CREATE_COMPLETE"); latestStack.setStackStatusReason("Stack Finished"); - statusHandler.updateStackStatus(latestStack); + statusHandler.updateStackStatus(latestStack, requestId); Mockito.verify(requestDBClient, times(1)).updateRequestProcessingData(requestProcessingData); assertNotEquals("testMe", requestProcessingData.getValue()); } @Test public final void record_Not_Exists_Test() throws MsoException, IOException { + String requestId = getRequestId(); ArgumentCaptor<RequestProcessingData> requestCaptor = ArgumentCaptor.forClass(RequestProcessingData.class); - doReturn(null).when(requestDBClient).getRequestProcessingDataBySoRequestIdAndNameAndGrouping(null, "stackName", - "id"); + doReturn(null).when(requestDBClient).getRequestProcessingDataBySoRequestIdAndNameAndGrouping(requestId, + "stackName", "id"); Stack latestStack = new Stack(); latestStack.setId("id"); latestStack.setStackName("stackName"); latestStack.setStackStatus("CREATE_COMPLETE"); latestStack.setStackStatusReason("Stack Finished"); - statusHandler.updateStackStatus(latestStack); + statusHandler.updateStackStatus(latestStack, requestId); Mockito.verify(requestDBClient, times(1)).saveRequestProcessingData(requestCaptor.capture()); RequestProcessingData actualRequest = requestCaptor.getValue(); assertEquals("id", actualRequest.getGroupingId()); diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java index 1e3c76cdde..8f029e7075 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java @@ -122,7 +122,7 @@ public class NssmfAdapterConsts { urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.CORE, ActionType.ACTIVATE), new NssmfUrlInfo(EXTERNAL_CN_ACTIVATE_URL, HttpMethod.PUT)); urlInfoMap.put(generateKey(ExecutorType.INTERNAL, null, ActionType.ACTIVATE), - new NssmfUrlInfo(INTERNAL_ACTIVATE_URL, HttpMethod.PUT)); + new NssmfUrlInfo(INTERNAL_ACTIVATE_URL, HttpMethod.POST)); urlInfoMap.put(generateKey(ExecutorType.EXTERNAL, NetworkType.ACCESS, ActionType.DEACTIVATE), new NssmfUrlInfo(EXTERNAL_AN_DEACTIVATE_URL, HttpMethod.PUT)); diff --git a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalTnNssmfManager.java b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalTnNssmfManager.java index 8bfbd55387..1b4a9e9fca 100644 --- a/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalTnNssmfManager.java +++ b/adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/internal/InternalTnNssmfManager.java @@ -37,6 +37,6 @@ public class InternalTnNssmfManager extends InternalNssmfManager { @Override protected String doWrapModifyReqBody(NssmfAdapterNBIRequest nbiRequest) throws ApplicationException { // TODO - return null; + return doWrapAllocateReqBody(nbiRequest); } } diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java index f5a6355529..f904788de3 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/tasks/inventory/DeleteAAIInventory.java @@ -48,10 +48,16 @@ public class DeleteAAIInventory { @Autowired protected Environment env; + private static final String MULTICLOUD_MODE = "MULTICLOUD"; + public void heatbridge(CloudInformation cloudInformation) throws MsoCloudSiteNotFound, HeatBridgeException { logger.debug("Heatbridge delete executing"); CloudSite cloudSite = cloudConfig.getCloudSite(cloudInformation.getRegionId()) .orElseThrow(() -> new MsoCloudSiteNotFound(cloudInformation.getRegionId())); + if (cloudSite.getOrchestrator() != null && MULTICLOUD_MODE.equalsIgnoreCase(cloudSite.getOrchestrator())) { + logger.debug("Skipping Heatbridge as CloudSite orchestrator is: " + MULTICLOUD_MODE); + return; + } CloudIdentity cloudIdentity = cloudSite.getIdentityService(); HeatBridgeApi heatBridgeClient = new HeatBridgeImpl(new AAIResourcesClient(), cloudIdentity, cloudInformation.getOwner(), cloudInformation.getRegionId(), cloudSite.getRegionId(), diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java index 6b979833eb..58c43be36a 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java @@ -1120,7 +1120,9 @@ public class MsoVnfPluginAdapterImpl { long subStartTime = System.currentTimeMillis(); try { // TODO: Get an appropriate timeout value - require access to the model - vduPlugin.deleteVdu(cloudInfo, vfModuleId, 5); + if (!vduInstance.getStatus().getState().equals(VduStateType.NOTFOUND)) { + vduPlugin.deleteVdu(cloudInfo, vfModuleId, 5); + } } catch (VduException me) { me.addContext("DeleteVfModule"); // Convert to a generic VnfException diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java index a8fa6535c3..1f6c0df90f 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/helpers/AaiHelper.java @@ -108,6 +108,13 @@ public class AaiHelper { * if (!StringUtils.isEmpty(server.getName())) { * relationships.add(createVnfRelationshiptoVserver(server.getName(), genericVnfId, vfModuleId)); } */ + + // vserver to generic-vnf relationship + Relationship genericVnfRelationship = buildRelationship( + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(genericVnfId))); + relationships.add(genericVnfRelationship); + + // vserver to vf-module relationship Relationship vfModuleRelationship = buildRelationship(AAIUriFactory .createResourceUri(AAIFluentTypeBuilder.network().genericVnf(genericVnfId).vfModule(vfModuleId))); diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java index a18904f8f4..fab7df5345 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/heatbridge/HeatBridgeImplTest.java @@ -371,15 +371,15 @@ public class HeatBridgeImplTest { org.onap.aai.domain.yang.RelationshipList relList = aaiHelper.getVserverRelationshipList(CLOUD_OWNER, REGION_ID, "test-genericVnf-id", "test-vfModule-id", server1); - assertEquals(2, relList.getRelationship().size()); + assertEquals(3, relList.getRelationship().size()); org.onap.aai.domain.yang.RelationshipList relList2 = aaiHelper.getVserverRelationshipList(CLOUD_OWNER, REGION_ID, "test-genericVnf-id", "test-vfModule-id", server2); - assertEquals(1, relList2.getRelationship().size()); + assertEquals(2, relList2.getRelationship().size()); org.onap.aai.domain.yang.RelationshipList relList3 = aaiHelper.getVserverRelationshipList(CLOUD_OWNER, REGION_ID, "test-genericVnf-id", "test-vfModule-id", server3); - assertEquals(1, relList3.getRelationship().size()); + assertEquals(2, relList3.getRelationship().size()); } 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 2f6713dcd1..4cd1d7dcb0 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 @@ -1478,6 +1478,11 @@ public class BBInputSetup implements JavaDelegate { lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, volumeGroupIdOp.get()); } } + if (vfModule.getModelInfoVfModule() != null + && vfModule.getModelInfoVfModule().getModelName() != null + && vfModule.getModelInfoVfModule().getModelName().contains("helm")) { + gBB.getRequestContext().setIsHelm(true); + } break; } } diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn index fba1139117..36d1708a45 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn @@ -1,18 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1"> <bpmn:process id="DeleteVfModuleBB" name="DeleteVfModuleBB" isExecutable="true"> <bpmn:startEvent id="DeleteVfModuleBB_Start"> - <bpmn:outgoing>Flow_02lmh6f</bpmn:outgoing> + <bpmn:outgoing>Flow_069drgn</bpmn:outgoing> </bpmn:startEvent> <bpmn:serviceTask id="DeleteVfModuleVnfAdapter" name="Prepare Request" camunda:expression="${VnfAdapterDeleteTasks.deleteVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>Flow_02lmh6f</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_08tvhtf</bpmn:outgoing> + <bpmn:incoming>Flow_1c15ua4</bpmn:incoming> + <bpmn:outgoing>Flow_0yz0t7z</bpmn:outgoing> </bpmn:serviceTask> <bpmn:serviceTask id="UpdateVfModuleDeleteStatus" name=" AAI Update (vf module) " camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusDeleteVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_01vfwtp</bpmn:incoming> <bpmn:outgoing>SequenceFlow_09l7pcg</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_08tvhtf" sourceRef="DeleteVfModuleVnfAdapter" targetRef="VnfAdapter" /> <bpmn:endEvent id="DeleteVfModuleBB_End"> <bpmn:incoming>SequenceFlow_09l7pcg</bpmn:incoming> </bpmn:endEvent> @@ -28,7 +27,7 @@ <camunda:out source="contrailNetworkPolicyFqdnList" target="contrailNetworkPolicyFqdnList" /> <camunda:out source="contrailServiceInstanceFqdn" target="contrailServiceInstanceFqdn" /> </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_08tvhtf</bpmn:incoming> + <bpmn:incoming>Flow_0yz0t7z</bpmn:incoming> <bpmn:outgoing>Flow_0hlvlw2</bpmn:outgoing> </bpmn:callActivity> <bpmn:serviceTask id="UpdateVfModuleHeatStackId" name=" AAI Update (vf module) " camunda:expression="${AAIUpdateTasks.updateHeatStackIdVfModule(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> @@ -59,6 +58,7 @@ </bpmn:serviceTask> <bpmn:intermediateThrowEvent id="aaiThrow" name="Update AAI"> <bpmn:incoming>Flow_0plbl7p</bpmn:incoming> + <bpmn:incoming>Flow_1ktykz6</bpmn:incoming> <bpmn:linkEventDefinition name="AAI" /> </bpmn:intermediateThrowEvent> <bpmn:intermediateCatchEvent id="aaiCatch" name="Update AAI"> @@ -77,7 +77,6 @@ <bpmn:sequenceFlow id="Flow_0n2pqrr" sourceRef="aaiCatch" targetRef="DeleteNetworkPolicies" /> <bpmn:sequenceFlow id="Flow_0plbl7p" sourceRef="ServiceTask_0itw3by" targetRef="aaiThrow" /> <bpmn:sequenceFlow id="Flow_0hlvlw2" sourceRef="VnfAdapter" targetRef="ServiceTask_08ulmzc" /> - <bpmn:sequenceFlow id="Flow_02lmh6f" sourceRef="DeleteVfModuleBB_Start" targetRef="DeleteVfModuleVnfAdapter" /> <bpmn:subProcess id="Activity_1thbmzc" name="Inventory Error Handling" triggeredByEvent="true"> <bpmn:endEvent id="Event_00dlrto"> <bpmn:incoming>Flow_0yqo5xu</bpmn:incoming> @@ -93,155 +92,197 @@ <bpmn:sequenceFlow id="Flow_0qyhv7c" sourceRef="Event_0dfwcfl" targetRef="Activity_025387k" /> <bpmn:sequenceFlow id="Flow_0yqo5xu" sourceRef="Activity_025387k" targetRef="Event_00dlrto" /> </bpmn:subProcess> + <bpmn:serviceTask id="Activity_1aqardy" name="Cnf Adapter" camunda:expression="${CnfAdapterDeleteTasks.deleteInstance(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn:incoming>Flow_10r76pp</bpmn:incoming> + <bpmn:outgoing>Flow_1ktykz6</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="Flow_1ktykz6" sourceRef="Activity_1aqardy" targetRef="aaiThrow" /> + <bpmn:exclusiveGateway id="CheckIfIsHelm" name="Check if is helm"> + <bpmn:incoming>Flow_069drgn</bpmn:incoming> + <bpmn:outgoing>Flow_10r76pp</bpmn:outgoing> + <bpmn:outgoing>Flow_1c15ua4</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:sequenceFlow id="Flow_10r76pp" name="Yes" sourceRef="CheckIfIsHelm" targetRef="Activity_1aqardy"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isHelm")}</bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:sequenceFlow id="Flow_0yz0t7z" sourceRef="DeleteVfModuleVnfAdapter" targetRef="VnfAdapter" /> + <bpmn:sequenceFlow id="Flow_069drgn" sourceRef="DeleteVfModuleBB_Start" targetRef="CheckIfIsHelm" /> + <bpmn:sequenceFlow id="Flow_1c15ua4" name="No" sourceRef="CheckIfIsHelm" targetRef="DeleteVfModuleVnfAdapter" /> </bpmn:process> <bpmn:error id="Error_0jjnve8" name="Error_3k24na6" errorCode="AAIInventoryFailure" /> <bpmn:escalation id="Escalation_130je8j" name="audit" escalationCode="audit1" /> <bpmn:error id="Error_1le3oui" name="AAIInventoryFailure" errorCode="AAIInventoryFailure" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteVfModuleBB"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="DeleteVfModuleBB_Start"> - <dc:Bounds x="159" y="106" width="36" height="36" /> + <bpmndi:BPMNEdge id="Flow_0hlvlw2_di" bpmnElement="Flow_0hlvlw2"> + <di:waypoint x="680" y="254" /> + <di:waypoint x="760" y="254" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0plbl7p_di" bpmnElement="Flow_0plbl7p"> + <di:waypoint x="1010" y="254" /> + <di:waypoint x="1062" y="254" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0n2pqrr_di" bpmnElement="Flow_0n2pqrr"> + <di:waypoint x="195" y="478" /> + <di:waypoint x="270" y="478" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1i9ft2r_di" bpmnElement="SequenceFlow_1i9ft2r"> + <di:waypoint x="860" y="254" /> + <di:waypoint x="910" y="254" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0yuz21z_di" bpmnElement="SequenceFlow_0yuz21z"> + <di:waypoint x="770" y="478" /> + <di:waypoint x="800" y="478" /> <bpmndi:BPMNLabel> - <dc:Bounds x="132" y="302" width="90" height="12" /> + <dc:Bounds x="722" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_16798zf_di" bpmnElement="DeleteVfModuleVnfAdapter"> - <dc:Bounds x="290" y="84" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0pbhsub_di" bpmnElement="UpdateVfModuleDeleteStatus"> - <dc:Bounds x="930" y="308" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_08tvhtf_di" bpmnElement="SequenceFlow_08tvhtf"> - <di:waypoint x="390" y="124" /> - <di:waypoint x="435" y="124" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0khqfnc_di" bpmnElement="SequenceFlow_0khqfnc"> + <di:waypoint x="640" y="478" /> + <di:waypoint x="670" y="478" /> <bpmndi:BPMNLabel> - <dc:Bounds x="959" y="331" width="90" height="12" /> + <dc:Bounds x="598" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_1rn6yvh_di" bpmnElement="DeleteVfModuleBB_End"> - <dc:Bounds x="1142" y="330" width="36" height="36" /> + <bpmndi:BPMNEdge id="SequenceFlow_0jtem3b_di" bpmnElement="SequenceFlow_0jtem3b"> + <di:waypoint x="500" y="478" /> + <di:waypoint x="540" y="478" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1241" y="530" width="90" height="0" /> + <dc:Bounds x="473" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="CallActivity_0whogn3_di" bpmnElement="VnfAdapter"> - <dc:Bounds x="435" y="84" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0vlgqod_di" bpmnElement="UpdateVfModuleHeatStackId"> - <dc:Bounds x="800" y="308" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_01vfwtp_di" bpmnElement="SequenceFlow_01vfwtp"> - <di:waypoint x="900" y="348" /> - <di:waypoint x="930" y="348" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0xyu3pk_di" bpmnElement="SequenceFlow_0xyu3pk"> + <di:waypoint x="370" y="478" /> + <di:waypoint x="400" y="478" /> <bpmndi:BPMNLabel> - <dc:Bounds x="848" y="493" width="90" height="0" /> + <dc:Bounds x="345" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_09l7pcg_di" bpmnElement="SequenceFlow_09l7pcg"> - <di:waypoint x="1030" y="348" /> - <di:waypoint x="1142" y="348" /> + <di:waypoint x="1030" y="478" /> + <di:waypoint x="1142" y="478" /> <bpmndi:BPMNLabel> <dc:Bounds x="1092.5" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0xyu3pk_di" bpmnElement="SequenceFlow_0xyu3pk"> - <di:waypoint x="370" y="348" /> - <di:waypoint x="400" y="348" /> + <bpmndi:BPMNEdge id="SequenceFlow_01vfwtp_di" bpmnElement="SequenceFlow_01vfwtp"> + <di:waypoint x="900" y="478" /> + <di:waypoint x="930" y="478" /> <bpmndi:BPMNLabel> - <dc:Bounds x="345" y="493" width="90" height="0" /> + <dc:Bounds x="848" y="493" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0tty0ac_di" bpmnElement="DeleteNetworkPolicies"> - <dc:Bounds x="270" y="308" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_0lrrd16_di" bpmnElement="UpdateVnfManagementV6Address"> - <dc:Bounds x="540" y="308" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0jtem3b_di" bpmnElement="SequenceFlow_0jtem3b"> - <di:waypoint x="500" y="348" /> - <di:waypoint x="540" y="348" /> + <bpmndi:BPMNEdge id="Flow_1ktykz6_di" bpmnElement="Flow_1ktykz6"> + <di:waypoint x="680" y="120" /> + <di:waypoint x="1080" y="120" /> + <di:waypoint x="1080" y="236" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_10r76pp_di" bpmnElement="Flow_10r76pp"> + <di:waypoint x="280" y="229" /> + <di:waypoint x="280" y="120" /> + <di:waypoint x="580" y="120" /> <bpmndi:BPMNLabel> - <dc:Bounds x="473" y="493" width="90" height="0" /> + <dc:Bounds x="256" y="162" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0w9805b_di" bpmnElement="UpdateVnfIpv4OamAddress"> - <dc:Bounds x="400" y="308" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0khqfnc_di" bpmnElement="SequenceFlow_0khqfnc"> - <di:waypoint x="640" y="348" /> - <di:waypoint x="670" y="348" /> + <bpmndi:BPMNEdge id="Flow_0yz0t7z_di" bpmnElement="Flow_0yz0t7z"> + <di:waypoint x="500" y="254" /> + <di:waypoint x="580" y="254" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_069drgn_di" bpmnElement="Flow_069drgn"> + <di:waypoint x="195" y="254" /> + <di:waypoint x="255" y="254" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1c15ua4_di" bpmnElement="Flow_1c15ua4"> + <di:waypoint x="305" y="254" /> + <di:waypoint x="400" y="254" /> <bpmndi:BPMNLabel> - <dc:Bounds x="598" y="493" width="90" height="0" /> + <dc:Bounds x="345" y="236" width="15" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0yuz21z_di" bpmnElement="SequenceFlow_0yuz21z"> - <di:waypoint x="770" y="348" /> - <di:waypoint x="800" y="348" /> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="DeleteVfModuleBB_Start"> + <dc:Bounds x="159" y="236" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="722" y="493" width="90" height="0" /> + <dc:Bounds x="132" y="302" width="90" height="12" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0pbhsub_di" bpmnElement="UpdateVfModuleDeleteStatus"> + <dc:Bounds x="930" y="438" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1rn6yvh_di" bpmnElement="DeleteVfModuleBB_End"> + <dc:Bounds x="1142" y="460" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1241" y="530" width="90" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0vlgqod_di" bpmnElement="UpdateVfModuleHeatStackId"> + <dc:Bounds x="800" y="438" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0tty0ac_di" bpmnElement="DeleteNetworkPolicies"> + <dc:Bounds x="270" y="438" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0lrrd16_di" bpmnElement="UpdateVnfManagementV6Address"> + <dc:Bounds x="540" y="438" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0w9805b_di" bpmnElement="UpdateVnfIpv4OamAddress"> + <dc:Bounds x="400" y="438" width="100" height="80" /> + </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0v8naz9_di" bpmnElement="UpdateVfModuleContrailServiceInstanceFqdn"> - <dc:Bounds x="670" y="308" width="100" height="80" /> + <dc:Bounds x="670" y="438" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="IntermediateThrowEvent_1sftyjz_di" bpmnElement="aaiThrow"> - <dc:Bounds x="1062" y="106" width="36" height="36" /> + <dc:Bounds x="1062" y="236" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1053" y="145" width="57" height="14" /> + <dc:Bounds x="1051" y="282" width="57" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="IntermediateCatchEvent_13y483m_di" bpmnElement="aaiCatch"> - <dc:Bounds x="159" y="330" width="36" height="36" /> + <dc:Bounds x="159" y="460" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="149" y="370" width="57" height="14" /> + <dc:Bounds x="149" y="500" width="57" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0itw3by_di" bpmnElement="ServiceTask_0itw3by"> - <dc:Bounds x="740" y="84" width="100" height="80" /> + <dc:Bounds x="910" y="214" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_08ulmzc_di" bpmnElement="ServiceTask_08ulmzc"> - <dc:Bounds x="590" y="84" width="100" height="80" /> + <dc:Bounds x="760" y="214" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Gateway_0s4azdf_di" bpmnElement="CheckIfIsHelm" isMarkerVisible="true"> + <dc:Bounds x="255" y="229" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="240" y="289" width="79" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_16798zf_di" bpmnElement="DeleteVfModuleVnfAdapter"> + <dc:Bounds x="400" y="214" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="CallActivity_0whogn3_di" bpmnElement="VnfAdapter"> + <dc:Bounds x="580" y="214" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1aqardy_di" bpmnElement="Activity_1aqardy"> + <dc:Bounds x="580" y="80" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1i9ft2r_di" bpmnElement="SequenceFlow_1i9ft2r"> - <di:waypoint x="690" y="124" /> - <di:waypoint x="740" y="124" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_0n2pqrr_di" bpmnElement="Flow_0n2pqrr"> - <di:waypoint x="195" y="348" /> - <di:waypoint x="270" y="348" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_0plbl7p_di" bpmnElement="Flow_0plbl7p"> - <di:waypoint x="840" y="124" /> - <di:waypoint x="1062" y="124" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_0hlvlw2_di" bpmnElement="Flow_0hlvlw2"> - <di:waypoint x="535" y="124" /> - <di:waypoint x="590" y="124" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_02lmh6f_di" bpmnElement="Flow_02lmh6f"> - <di:waypoint x="195" y="124" /> - <di:waypoint x="290" y="124" /> - </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="Activity_1thbmzc_di" bpmnElement="Activity_1thbmzc" isExpanded="true"> - <dc:Bounds x="280" y="490" width="340" height="180" /> + <dc:Bounds x="280" y="620" width="340" height="180" /> </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="Flow_0yqo5xu_di" bpmnElement="Flow_0yqo5xu"> + <di:waypoint x="500" y="710" /> + <di:waypoint x="552" y="710" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0qyhv7c_di" bpmnElement="Flow_0qyhv7c"> + <di:waypoint x="356" y="710" /> + <di:waypoint x="400" y="710" /> + </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="Event_00dlrto_di" bpmnElement="Event_00dlrto"> - <dc:Bounds x="552" y="562" width="36" height="36" /> + <dc:Bounds x="552" y="692" width="36" height="36" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Event_0dfwcfl_di" bpmnElement="Event_0dfwcfl"> - <dc:Bounds x="320" y="562" width="36" height="36" /> + <dc:Bounds x="320" y="692" width="36" height="36" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="Activity_025387k_di" bpmnElement="Activity_025387k"> - <dc:Bounds x="400" y="540" width="100" height="80" /> + <dc:Bounds x="400" y="670" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="Flow_0qyhv7c_di" bpmnElement="Flow_0qyhv7c"> - <di:waypoint x="356" y="580" /> - <di:waypoint x="400" y="580" /> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="Flow_0yqo5xu_di" bpmnElement="Flow_0yqo5xu"> - <di:waypoint x="500" y="580" /> - <di:waypoint x="552" y="580" /> - </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ExecuteBuildingBlock.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ExecuteBuildingBlock.bpmn index 443a571312..fd650b9d50 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ExecuteBuildingBlock.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ExecuteBuildingBlock.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.4.0"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1"> <bpmn:process id="ExecuteBuildingBlock" name="ExecuteBuildingBlock" isExecutable="true"> <bpmn:startEvent id="Start_ExecuteBuildingBlock" name="start"> <bpmn:outgoing>SequenceFlow_0rq4c5r</bpmn:outgoing> @@ -12,6 +12,7 @@ <camunda:out source="WorkflowExceptionErrorMessage" target="WorkflowExceptionErrorMessage" /> <camunda:out source="StatusMessage" target="StatusMessage" /> <camunda:in source="isRollback" target="isRollback" /> + <camunda:in source="isHelm" target="isHelm" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_19wuics</bpmn:incoming> <bpmn:outgoing>SequenceFlow_01h9qmz</bpmn:outgoing> @@ -55,7 +56,7 @@ <bpmn:incoming>SequenceFlow_0ndt8ft</bpmn:incoming> <bpmn:outgoing>SequenceFlow_07a1ytc</bpmn:outgoing> <bpmn:timerEventDefinition> - <bpmn:timeDuration xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("RetryDuration")}]]></bpmn:timeDuration> + <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">${execution.getVariable("RetryDuration")}</bpmn:timeDuration> </bpmn:timerEventDefinition> </bpmn:intermediateCatchEvent> <bpmn:exclusiveGateway id="ExclusiveGateway_0ey4zpt" name="Retries Left?"> @@ -70,12 +71,12 @@ <bpmn:sequenceFlow id="SequenceFlow_0a62t4c" sourceRef="Task_QueryRainyDayTable" targetRef="ExclusiveGateway_1aonzik" /> <bpmn:sequenceFlow id="SequenceFlow_0h8v45y" name="Rollback or Abort" sourceRef="ExclusiveGateway_1aonzik" targetRef="EndEvent_0mvmk3i" /> <bpmn:sequenceFlow id="SequenceFlow_0fwsjva" name="Retry" sourceRef="ExclusiveGateway_1aonzik" targetRef="ExclusiveGateway_0ey4zpt"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("handlingCode")=="Retry"}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("handlingCode")=="Retry"}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="SequenceFlow_0ndt8ft" sourceRef="Task_SetRetryTimer" targetRef="IntermediateCatchEvent_RetryTimer" /> <bpmn:sequenceFlow id="SequenceFlow_07a1ytc" sourceRef="IntermediateCatchEvent_RetryTimer" targetRef="EndEvent_1sez2lh" /> <bpmn:sequenceFlow id="SequenceFlow_1wbevp0" name="yes" sourceRef="ExclusiveGateway_0ey4zpt" targetRef="Task_SetRetryTimer"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("retryCount")<execution.getVariable("maxRetries")}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("retryCount")<execution.getVariable("maxRetries")}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:endEvent id="EndEvent_0mvmk3i"> <bpmn:incoming>SequenceFlow_0h8v45y</bpmn:incoming> @@ -106,10 +107,10 @@ </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_05le7o3" sourceRef="PauseForManualTaskRainyDay" targetRef="ExclusiveGateway_1aonzik" /> <bpmn:sequenceFlow id="SequenceFlow_1xh5ngw" name="Manual" sourceRef="ExclusiveGateway_1aonzik" targetRef="PauseForManualTaskRainyDay"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("handlingCode")=="Manual"}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("handlingCode")=="Manual"}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="SequenceFlow_0xyd2zl" name="Skip" sourceRef="ExclusiveGateway_1aonzik" targetRef="Task_setHandlingCodeSuccessOnSkip"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("handlingCode")=="Skip"}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("handlingCode")=="Skip"}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:serviceTask id="Task_setHandlingCodeSuccessOnSkip" name="Set Handling Code to Success" camunda:expression="${ExecuteBuildingBlockRainyDay.setHandlingStatusSuccess(execution)}"> <bpmn:incoming>SequenceFlow_0xyd2zl</bpmn:incoming> @@ -132,12 +133,12 @@ </bpmn:endEvent> <bpmn:sequenceFlow id="SequenceFlow_1ynai9j" sourceRef="Task_setHandlingCodeSuccessOnSkip" targetRef="EndEvent_1py1er4" /> <bpmn:sequenceFlow id="SequenceFlow_1g7oq3t" name="Timeout" sourceRef="ExclusiveGateway_1aonzik" targetRef="Task_QuerySecondaryPolicy"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("handlingCode")=="Timeout"}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("handlingCode")=="Timeout"}</bpmn:conditionExpression> </bpmn:sequenceFlow> </bpmn:subProcess> <bpmn:sequenceFlow id="SequenceFlow_16lmcxp" sourceRef="Task_setHandlingCodeSuccess" targetRef="End_ExecuteBuildingBlock" /> <bpmn:sequenceFlow id="SequenceFlow_1j0vskt" name="Silent Success" sourceRef="CheckOrchestrationStatusValidationResults" targetRef="Task_setHandlingCodeSuccess"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("orchestrationStatusValidationResult").name() == "SILENT_SUCCESS"}]]></bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("orchestrationStatusValidationResult").name() == "SILENT_SUCCESS"}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:serviceTask id="Task_setHandlingCodeSuccess" name="Set Handling Code To Success" camunda:expression="${ExecuteBuildingBlockRainyDay.setHandlingStatusSuccess(execution)}"> <bpmn:incoming>SequenceFlow_1j0vskt</bpmn:incoming> @@ -164,285 +165,285 @@ <bpmn:error id="Error_0snha16" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ExecuteBuildingBlock"> - <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="Start_ExecuteBuildingBlock"> - <dc:Bounds x="111" y="162" width="36" height="36" /> + <bpmndi:BPMNEdge id="SequenceFlow_12a4hhf_di" bpmnElement="SequenceFlow_12a4hhf"> + <di:waypoint x="1056" y="180" /> + <di:waypoint x="1113" y="180" /> <bpmndi:BPMNLabel> - <dc:Bounds x="119" y="198" width="22" height="12" /> + <dc:Bounds x="989.5" y="159" width="90" height="12" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="CallActivity_0n67obl_di" bpmnElement="Call_BBToExecute"> - <dc:Bounds x="749" y="140" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0rq4c5r_di" bpmnElement="SequenceFlow_0rq4c5r"> - <di:waypoint xsi:type="dc:Point" x="147" y="180" /> - <di:waypoint xsi:type="dc:Point" x="184" y="180" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_19wuics_di" bpmnElement="SequenceFlow_19wuics"> + <di:waypoint x="732" y="180" /> + <di:waypoint x="799" y="180" /> <bpmndi:BPMNLabel> - <dc:Bounds x="120.5" y="165" width="90" height="0" /> + <dc:Bounds x="670.5" y="159" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0uzwjrq_di" bpmnElement="SequenceFlow_0uzwjrq"> - <di:waypoint xsi:type="dc:Point" x="284" y="180" /> - <di:waypoint xsi:type="dc:Point" x="321" y="180" /> + <bpmndi:BPMNEdge id="SequenceFlow_1j0vskt_di" bpmnElement="SequenceFlow_1j0vskt"> + <di:waypoint x="533" y="155" /> + <di:waypoint x="533" y="84" /> + <di:waypoint x="1163" y="84" /> + <di:waypoint x="1163" y="140" /> <bpmndi:BPMNLabel> - <dc:Bounds x="257.5" y="165" width="90" height="0" /> + <dc:Bounds x="814" y="63" width="73" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1jcuk3b_di" bpmnElement="Task_BBInputSetup"> - <dc:Bounds x="184" y="140" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_0ahsxzi_di" bpmnElement="End_ExecuteBuildingBlock"> - <dc:Bounds x="1221" y="162" width="36" height="36" /> + <bpmndi:BPMNEdge id="SequenceFlow_16lmcxp_di" bpmnElement="SequenceFlow_16lmcxp"> + <di:waypoint x="1213" y="180" /> + <di:waypoint x="1271" y="180" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1230" y="202" width="18" height="12" /> + <dc:Bounds x="1147" y="159" width="90" height="12" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0je0y25_di" bpmnElement="SequenceFlow_0je0y25"> + <di:waypoint x="471" y="180" /> + <di:waypoint x="508" y="180" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="394.5" y="159" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0kdjsnx_di" bpmnElement="Continue"> + <di:waypoint x="558" y="180" /> + <di:waypoint x="632" y="180" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="574" y="159" width="45" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_01h9qmz_di" bpmnElement="SequenceFlow_01h9qmz"> - <di:waypoint xsi:type="dc:Point" x="849" y="180" /> - <di:waypoint xsi:type="dc:Point" x="906" y="180" /> + <di:waypoint x="899" y="180" /> + <di:waypoint x="956" y="180" /> <bpmndi:BPMNLabel> <dc:Bounds x="832.5" y="159" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ExclusiveGateway_0ey4zpt_di" bpmnElement="ExclusiveGateway_0ey4zpt" isMarkerVisible="true"> - <dc:Bounds x="695" y="478" width="50" height="50" /> + <bpmndi:BPMNEdge id="SequenceFlow_0uzwjrq_di" bpmnElement="SequenceFlow_0uzwjrq"> + <di:waypoint x="334" y="180" /> + <di:waypoint x="371" y="180" /> <bpmndi:BPMNLabel> - <dc:Bounds x="691" y="453" width="62" height="12" /> + <dc:Bounds x="257.5" y="165" width="90" height="0" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="IntermediateCatchEvent_0qjyidb_di" bpmnElement="IntermediateCatchEvent_RetryTimer"> - <dc:Bounds x="939" y="485" width="36" height="36" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0rq4c5r_di" bpmnElement="SequenceFlow_0rq4c5r"> + <di:waypoint x="197" y="180" /> + <di:waypoint x="234" y="180" /> <bpmndi:BPMNLabel> - <dc:Bounds x="930" y="460" width="55" height="12" /> + <dc:Bounds x="120.5" y="165" width="90" height="0" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_1aonzik_di" bpmnElement="ExclusiveGateway_1aonzik" isMarkerVisible="true"> - <dc:Bounds x="542" y="478" width="50" height="50" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="Start_ExecuteBuildingBlock"> + <dc:Bounds x="161" y="162" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="533" y="440" width="68" height="24" /> + <dc:Bounds x="169" y="198" width="23" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1wbevp0_di" bpmnElement="SequenceFlow_1wbevp0"> - <di:waypoint xsi:type="dc:Point" x="745" y="503" /> - <di:waypoint xsi:type="dc:Point" x="810" y="503" /> + <bpmndi:BPMNShape id="CallActivity_0n67obl_di" bpmnElement="Call_BBToExecute"> + <dc:Bounds x="799" y="140" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1jcuk3b_di" bpmnElement="Task_BBInputSetup"> + <dc:Bounds x="234" y="140" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_0ahsxzi_di" bpmnElement="End_ExecuteBuildingBlock"> + <dc:Bounds x="1271" y="162" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="763" y="478" width="18" height="12" /> + <dc:Bounds x="1280" y="202" width="19" height="14" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0fwsjva_di" bpmnElement="SequenceFlow_0fwsjva"> - <di:waypoint xsi:type="dc:Point" x="592" y="503" /> - <di:waypoint xsi:type="dc:Point" x="695" y="503" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0brnbqx_di" bpmnElement="StatusPolicy"> + <dc:Bounds x="371" y="140" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_0f8ghh3_di" bpmnElement="CheckOrchestrationStatusValidationResults" isMarkerVisible="true"> + <dc:Bounds x="508" y="155" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="630" y="511" width="27" height="12" /> + <dc:Bounds x="492" y="209" width="87" height="53" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0h8v45y_di" bpmnElement="SequenceFlow_0h8v45y"> - <di:waypoint xsi:type="dc:Point" x="567" y="528" /> - <di:waypoint xsi:type="dc:Point" x="567" y="584" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="SubProcess_0tv8zda_di" bpmnElement="SubProcess_0tv8zda" isExpanded="true"> + <dc:Bounds x="221" y="299" width="1020" height="432" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1g7oq3t_di" bpmnElement="SequenceFlow_1g7oq3t"> + <di:waypoint x="633" y="512" /> + <di:waypoint x="720" y="562" /> <bpmndi:BPMNLabel> - <dc:Bounds x="575" y="549" width="84" height="12" /> + <dc:Bounds x="698" y="533" width="41" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1tifgqh_di" bpmnElement="Task_QueryRainyDayTable"> - <dc:Bounds x="399" y="463" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0ndt8ft_di" bpmnElement="SequenceFlow_0ndt8ft"> - <di:waypoint xsi:type="dc:Point" x="910" y="503" /> - <di:waypoint xsi:type="dc:Point" x="939" y="503" /> + <bpmndi:BPMNEdge id="SequenceFlow_1ynai9j_di" bpmnElement="SequenceFlow_1ynai9j"> + <di:waypoint x="449" y="629" /> + <di:waypoint x="390" y="629" /> <bpmndi:BPMNLabel> - <dc:Bounds x="925" y="482" width="0" height="0" /> + <dc:Bounds x="370" y="604" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_07a1ytc_di" bpmnElement="SequenceFlow_07a1ytc"> - <di:waypoint xsi:type="dc:Point" x="975" y="503" /> - <di:waypoint xsi:type="dc:Point" x="1013" y="503" /> + <bpmndi:BPMNEdge id="SequenceFlow_0xyd2zl_di" bpmnElement="SequenceFlow_0xyd2zl"> + <di:waypoint x="603" y="514" /> + <di:waypoint x="499" y="589" /> <bpmndi:BPMNLabel> - <dc:Bounds x="994" y="482" width="0" height="0" /> + <dc:Bounds x="556" y="549" width="22" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1obvxht_di" bpmnElement="Task_SetRetryTimer"> - <dc:Bounds x="810" y="463" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0kdjsnx_di" bpmnElement="Continue"> - <di:waypoint xsi:type="dc:Point" x="508" y="180" /> - <di:waypoint xsi:type="dc:Point" x="582" y="180" /> + <bpmndi:BPMNEdge id="SequenceFlow_1xh5ngw_di" bpmnElement="SequenceFlow_1xh5ngw"> + <di:waypoint x="603" y="492" /> + <di:waypoint x="512" y="423" /> + <di:waypoint x="512" y="377" /> + <di:waypoint x="567" y="377" /> <bpmndi:BPMNLabel> - <dc:Bounds x="524.6653543307086" y="159" width="43" height="12" /> + <dc:Bounds x="517" y="400" width="37" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0brnbqx_di" bpmnElement="StatusPolicy"> - <dc:Bounds x="321" y="140" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ExclusiveGateway_0f8ghh3_di" bpmnElement="CheckOrchestrationStatusValidationResults" isMarkerVisible="true"> - <dc:Bounds x="458" y="155" width="50" height="50" /> + <bpmndi:BPMNEdge id="SequenceFlow_05le7o3_di" bpmnElement="SequenceFlow_05le7o3"> + <di:waypoint x="667" y="377" /> + <di:waypoint x="709" y="377" /> + <di:waypoint x="709" y="421" /> + <di:waypoint x="630" y="491" /> <bpmndi:BPMNLabel> - <dc:Bounds x="442" y="209" width="87" height="48" /> + <dc:Bounds x="674" y="399" width="0" height="0" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0je0y25_di" bpmnElement="SequenceFlow_0je0y25"> - <di:waypoint xsi:type="dc:Point" x="421" y="180" /> - <di:waypoint xsi:type="dc:Point" x="458" y="180" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_09synl9_di" bpmnElement="SequenceFlow_09synl9"> + <di:waypoint x="285" y="503" /> + <di:waypoint x="314" y="503" /> <bpmndi:BPMNLabel> - <dc:Bounds x="394.5" y="159" width="90" height="12" /> + <dc:Bounds x="250" y="482" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0a62t4c_di" bpmnElement="SequenceFlow_0a62t4c"> - <di:waypoint xsi:type="dc:Point" x="499" y="503" /> - <di:waypoint xsi:type="dc:Point" x="542" y="503" /> + <bpmndi:BPMNEdge id="SequenceFlow_0vdeqxv_di" bpmnElement="SequenceFlow_0vdeqxv"> + <di:waypoint x="414" y="503" /> + <di:waypoint x="449" y="503" /> <bpmndi:BPMNLabel> - <dc:Bounds x="521" y="482" width="0" height="0" /> + <dc:Bounds x="382" y="482" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="SubProcess_0tv8zda_di" bpmnElement="SubProcess_0tv8zda" isExpanded="true"> - <dc:Bounds x="171" y="299" width="1020" height="432" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_0mvmk3i_di" bpmnElement="EndEvent_0mvmk3i"> - <dc:Bounds x="549" y="584" width="36" height="36" /> + <bpmndi:BPMNEdge id="SequenceFlow_12ps9at_di" bpmnElement="SequenceFlow_12ps9at"> + <di:waypoint x="820" y="592" /> + <di:waypoint x="892" y="592" /> <bpmndi:BPMNLabel> - <dc:Bounds x="567" y="624" width="0" height="0" /> + <dc:Bounds x="806" y="571" width="0" height="0" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="EndEvent_1aww7yx_di" bpmnElement="EndEvent_1sez2lh"> - <dc:Bounds x="1013" y="485" width="36" height="36" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0541bid_di" bpmnElement="SequenceFlow_0541bid"> + <di:waypoint x="770" y="528" /> + <di:waypoint x="770" y="552" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1024" y="525" width="18" height="12" /> + <dc:Bounds x="782" y="529" width="13" height="14" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_16lmcxp_di" bpmnElement="SequenceFlow_16lmcxp"> - <di:waypoint xsi:type="dc:Point" x="1163" y="180" /> - <di:waypoint xsi:type="dc:Point" x="1221" y="180" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1wbevp0_di" bpmnElement="SequenceFlow_1wbevp0"> + <di:waypoint x="795" y="503" /> + <di:waypoint x="860" y="503" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1147" y="159" width="90" height="12" /> + <dc:Bounds x="814" y="478" width="17" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1j0vskt_di" bpmnElement="SequenceFlow_1j0vskt"> - <di:waypoint xsi:type="dc:Point" x="483" y="155" /> - <di:waypoint xsi:type="dc:Point" x="483" y="84" /> - <di:waypoint xsi:type="dc:Point" x="1113" y="84" /> - <di:waypoint xsi:type="dc:Point" x="1113" y="140" /> + <bpmndi:BPMNEdge id="SequenceFlow_07a1ytc_di" bpmnElement="SequenceFlow_07a1ytc"> + <di:waypoint x="1025" y="503" /> + <di:waypoint x="1063" y="503" /> <bpmndi:BPMNLabel> - <dc:Bounds x="764.2235294117647" y="63" width="72" height="12" /> + <dc:Bounds x="994" y="482" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0z9izx5_di" bpmnElement="Task_setHandlingCodeSuccess"> - <dc:Bounds x="1063" y="140" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_19wuics_di" bpmnElement="SequenceFlow_19wuics"> - <di:waypoint xsi:type="dc:Point" x="682" y="180" /> - <di:waypoint xsi:type="dc:Point" x="749" y="180" /> + <bpmndi:BPMNEdge id="SequenceFlow_0ndt8ft_di" bpmnElement="SequenceFlow_0ndt8ft"> + <di:waypoint x="960" y="503" /> + <di:waypoint x="989" y="503" /> <bpmndi:BPMNLabel> - <dc:Bounds x="670.5" y="159" width="90" height="12" /> + <dc:Bounds x="925" y="482" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_12a4hhf_di" bpmnElement="SequenceFlow_12a4hhf"> - <di:waypoint xsi:type="dc:Point" x="1006" y="180" /> - <di:waypoint xsi:type="dc:Point" x="1063" y="180" /> + <bpmndi:BPMNEdge id="SequenceFlow_0fwsjva_di" bpmnElement="SequenceFlow_0fwsjva"> + <di:waypoint x="642" y="503" /> + <di:waypoint x="745" y="503" /> <bpmndi:BPMNLabel> - <dc:Bounds x="989.5" y="159" width="90" height="12" /> + <dc:Bounds x="680" y="511" width="27" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_1pf5f6w_di" bpmnElement="Task_PreValidate"> - <dc:Bounds x="582" y="140" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_02w4792_di" bpmnElement="Task_PostValidate"> - <dc:Bounds x="906" y="140" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0541bid_di" bpmnElement="SequenceFlow_0541bid"> - <di:waypoint xsi:type="dc:Point" x="720" y="528" /> - <di:waypoint xsi:type="dc:Point" x="720" y="552" /> + <bpmndi:BPMNEdge id="SequenceFlow_0h8v45y_di" bpmnElement="SequenceFlow_0h8v45y"> + <di:waypoint x="617" y="528" /> + <di:waypoint x="617" y="584" /> <bpmndi:BPMNLabel> - <dc:Bounds x="732" y="529" width="12" height="12" /> + <dc:Bounds x="624" y="549" width="86" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_12ps9at_di" bpmnElement="SequenceFlow_12ps9at"> - <di:waypoint xsi:type="dc:Point" x="770" y="592" /> - <di:waypoint xsi:type="dc:Point" x="842" y="592" /> + <bpmndi:BPMNEdge id="SequenceFlow_0a62t4c_di" bpmnElement="SequenceFlow_0a62t4c"> + <di:waypoint x="549" y="503" /> + <di:waypoint x="592" y="503" /> <bpmndi:BPMNLabel> - <dc:Bounds x="806" y="571" width="0" height="0" /> + <dc:Bounds x="521" y="482" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="EndEvent_05vw85n_di" bpmnElement="EndEvent_0ex9298"> - <dc:Bounds x="842" y="574" width="36" height="36" /> + <bpmndi:BPMNShape id="ServiceTask_1tifgqh_di" bpmnElement="Task_QueryRainyDayTable"> + <dc:Bounds x="449" y="463" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_1aonzik_di" bpmnElement="ExclusiveGateway_1aonzik" isMarkerVisible="true"> + <dc:Bounds x="592" y="478" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="852" y="614" width="18" height="12" /> + <dc:Bounds x="582" y="440" width="70" height="27" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNShape id="ServiceTask_11f2c91_di" bpmnElement="Task_QuerySecondaryPolicy"> - <dc:Bounds x="670" y="552" width="100" height="80" /> - </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_0vdeqxv_di" bpmnElement="SequenceFlow_0vdeqxv"> - <di:waypoint xsi:type="dc:Point" x="364" y="503" /> - <di:waypoint xsi:type="dc:Point" x="399" y="503" /> + <bpmndi:BPMNShape id="IntermediateCatchEvent_0qjyidb_di" bpmnElement="IntermediateCatchEvent_RetryTimer"> + <dc:Bounds x="989" y="485" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="382" y="482" width="0" height="0" /> + <dc:Bounds x="980" y="460" width="56" height="14" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="StartEvent_0tmcs9g_di" bpmnElement="StartEvent_0tmcs9g"> - <dc:Bounds x="199" y="485" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_0ey4zpt_di" bpmnElement="ExclusiveGateway_0ey4zpt" isMarkerVisible="true"> + <dc:Bounds x="745" y="478" width="50" height="50" /> <bpmndi:BPMNLabel> - <dc:Bounds x="127" y="521" width="0" height="0" /> + <dc:Bounds x="741" y="453" width="63" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_09synl9_di" bpmnElement="SequenceFlow_09synl9"> - <di:waypoint xsi:type="dc:Point" x="235" y="503" /> - <di:waypoint xsi:type="dc:Point" x="264" y="503" /> + <bpmndi:BPMNShape id="ServiceTask_1obvxht_di" bpmnElement="Task_SetRetryTimer"> + <dc:Bounds x="860" y="463" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_0mvmk3i_di" bpmnElement="EndEvent_0mvmk3i"> + <dc:Bounds x="599" y="584" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="250" y="482" width="0" height="0" /> + <dc:Bounds x="567" y="624" width="0" height="0" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_10v49qn_di" bpmnElement="Task_UpdateExtErrorSource"> - <dc:Bounds x="264" y="463" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_05le7o3_di" bpmnElement="SequenceFlow_05le7o3"> - <di:waypoint xsi:type="dc:Point" x="617" y="377" /> - <di:waypoint xsi:type="dc:Point" x="659" y="377" /> - <di:waypoint xsi:type="dc:Point" x="659" y="421" /> - <di:waypoint xsi:type="dc:Point" x="580" y="491" /> + <bpmndi:BPMNShape id="EndEvent_1aww7yx_di" bpmnElement="EndEvent_1sez2lh"> + <dc:Bounds x="1063" y="485" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="674" y="399" width="0" height="0" /> + <dc:Bounds x="1074" y="525" width="19" height="14" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1xh5ngw_di" bpmnElement="SequenceFlow_1xh5ngw"> - <di:waypoint xsi:type="dc:Point" x="553" y="492" /> - <di:waypoint xsi:type="dc:Point" x="462" y="423" /> - <di:waypoint xsi:type="dc:Point" x="462" y="377" /> - <di:waypoint xsi:type="dc:Point" x="517" y="377" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_05vw85n_di" bpmnElement="EndEvent_0ex9298"> + <dc:Bounds x="892" y="574" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="468" y="400" width="35" height="12" /> + <dc:Bounds x="902" y="614" width="19" height="14" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0xyd2zl_di" bpmnElement="SequenceFlow_0xyd2zl"> - <di:waypoint xsi:type="dc:Point" x="553" y="514" /> - <di:waypoint xsi:type="dc:Point" x="449" y="589" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_11f2c91_di" bpmnElement="Task_QuerySecondaryPolicy"> + <dc:Bounds x="720" y="552" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="StartEvent_0tmcs9g_di" bpmnElement="StartEvent_0tmcs9g"> + <dc:Bounds x="249" y="485" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="506" y="549.4997153461163" width="21" height="12" /> + <dc:Bounds x="127" y="521" width="0" height="0" /> </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_10v49qn_di" bpmnElement="Task_UpdateExtErrorSource"> + <dc:Bounds x="314" y="463" width="100" height="80" /> + </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0ohzi8e_di" bpmnElement="Task_setHandlingCodeSuccessOnSkip"> - <dc:Bounds x="399" y="589" width="100" height="80" /> + <dc:Bounds x="449" y="589" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="CallActivity_0szwp51_di" bpmnElement="PauseForManualTaskRainyDay"> - <dc:Bounds x="517" y="337" width="100" height="80" /> + <dc:Bounds x="567" y="337" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_1py1er4_di" bpmnElement="EndEvent_1py1er4"> - <dc:Bounds x="304" y="611" width="36" height="36" /> + <dc:Bounds x="354" y="611" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="313" y="647" width="18" height="12" /> + <dc:Bounds x="363" y="647" width="19" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_1ynai9j_di" bpmnElement="SequenceFlow_1ynai9j"> - <di:waypoint xsi:type="dc:Point" x="399" y="629" /> - <di:waypoint xsi:type="dc:Point" x="340" y="629" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="370" y="604" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1g7oq3t_di" bpmnElement="SequenceFlow_1g7oq3t"> - <di:waypoint xsi:type="dc:Point" x="583" y="512" /> - <di:waypoint xsi:type="dc:Point" x="670" y="562" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="649" y="533" width="39" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_0z9izx5_di" bpmnElement="Task_setHandlingCodeSuccess"> + <dc:Bounds x="1113" y="140" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1pf5f6w_di" bpmnElement="Task_PreValidate"> + <dc:Bounds x="632" y="140" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_02w4792_di" bpmnElement="Task_PostValidate"> + <dc:Bounds x="956" y="140" width="100" height="80" /> + </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy index 8b452d310b..0311c3d856 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy @@ -126,7 +126,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ String sliceInstanceName = "nsi_"+execution.getVariable("sliceServiceInstanceName") - String serviceType = execution.getVariable("serviceType") + String serviceType = sliceParams.serviceProfile.get("sST") String serviceStatus = "deactivated" String modelInvariantUuid = sliceParams.getNSTInfo().invariantUUID String modelUuid = sliceParams.getNSTInfo().UUID @@ -300,7 +300,24 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ SliceProfile sliceProfile = new SliceProfile() sliceProfile.setProfileId(profileId) sliceProfile.setCoverageAreaTAList(anSliceProfile.coverageAreaTAList) - //todo:... + sliceProfile.setMaxNumberOfUEs(anSliceProfile.maxNumberOfUEs) + sliceProfile.setLatency(anSliceProfile.latency) + sliceProfile.setMaxNumberOfPDUSession(anSliceProfile.maxNumberOfPDUSession) + sliceProfile.setExpDataRateDL(anSliceProfile.expDataRateDL) + sliceProfile.setExpDataRateUL(anSliceProfile.expDataRateUL) + sliceProfile.setAreaTrafficCapDL(anSliceProfile.areaTrafficCapDL) + sliceProfile.setAreaTrafficCapUL(anSliceProfile.areaTrafficCapUL) + sliceProfile.setOverallUserDensity(anSliceProfile.overallUserDensity) + sliceProfile.setActivityFactor(anSliceProfile.activityFactor) + sliceProfile.setUeMobilityLevel(anSliceProfile.ueMobilityLevel) + sliceProfile.setResourceSharingLevel(anSliceProfile.resourceSharingLevel) + sliceProfile.setCsAvailabilityTarget(anSliceProfile.csAvailabilityTarget) + sliceProfile.setCsReliabilityMeanTime(anSliceProfile.csReliabilityMeanTime) + sliceProfile.setExpDataRate(anSliceProfile.expDataRate) + sliceProfile.setMsgSizeByte(anSliceProfile.msgSizeByte) + sliceProfile.setTransferIntervalTarget(anSliceProfile.transferIntervalTarget) + sliceProfile.setSurvivalTime(anSliceProfile.survivalTime) + AAIResourceUri uri = AAIUriFactory.createResourceUri( AAIFluentTypeBuilder.business().customer(globalSubscriberId) .serviceSubscription(subscriptionServiceType) @@ -379,7 +396,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ allocateAnNssi.sliceProfile = sliceTaskInfo.sliceProfile.trans2AnProfile() allocateAnNssi.nsstId = sliceTaskInfo.NSSTInfo.UUID allocateAnNssi.nssiId = sliceTaskInfo.suggestNssiId - allocateAnNssi.nssiName = sliceTaskInfo.NSSTInfo.name + allocateAnNssi.nssiName = "nssi_an" + execution.getVariable("sliceServiceInstanceName") NsiInfo nsiInfo = new NsiInfo() nsiInfo.nsiId = sliceParams.suggestNsiId nsiInfo.nsiName = sliceParams.suggestNsiName @@ -406,6 +423,8 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ serviceInfo.nsiId = sliceParams.suggestNsiId serviceInfo.serviceInvariantUuid = sliceTaskInfo.NSSTInfo.invariantUUID serviceInfo.serviceUuid = sliceTaskInfo.NSSTInfo.UUID + serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST") + serviceInfo.nssiName = allocateAnNssi.nssiName nbiRequest.setServiceInfo(serviceInfo) nbiRequest.setEsrInfo(esrInfo) @@ -473,7 +492,24 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ SliceProfile sliceProfile = new SliceProfile() sliceProfile.setProfileId(profileId) sliceProfile.setCoverageAreaTAList(cnSliceProfile.coverageAreaTAList as String) - //todo:... + sliceProfile.setMaxNumberOfUEs(cnSliceProfile.maxNumberOfUEs) + sliceProfile.setLatency(cnSliceProfile.latency) + sliceProfile.setMaxNumberOfPDUSession(cnSliceProfile.maxNumberOfPDUSession) + sliceProfile.setExpDataRateDL(cnSliceProfile.expDataRateDL) + sliceProfile.setExpDataRateUL(cnSliceProfile.expDataRateUL) + sliceProfile.setAreaTrafficCapDL(cnSliceProfile.areaTrafficCapDL) + sliceProfile.setAreaTrafficCapUL(cnSliceProfile.areaTrafficCapUL) + sliceProfile.setOverallUserDensity(cnSliceProfile.overallUserDensity) + sliceProfile.setActivityFactor(cnSliceProfile.activityFactor) + sliceProfile.setUeMobilityLevel(cnSliceProfile.ueMobilityLevel) + sliceProfile.setResourceSharingLevel(cnSliceProfile.resourceSharingLevel) + sliceProfile.setCsAvailabilityTarget(cnSliceProfile.csAvailabilityTarget) + sliceProfile.setCsReliabilityMeanTime(cnSliceProfile.csReliabilityMeanTime) + sliceProfile.setExpDataRate(cnSliceProfile.expDataRate) + sliceProfile.setMsgSizeByte(cnSliceProfile.msgSizeByte) + sliceProfile.setTransferIntervalTarget(cnSliceProfile.transferIntervalTarget) + sliceProfile.setSurvivalTime(cnSliceProfile.survivalTime) + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() .customer(globalSubscriberId) .serviceSubscription(subscriptionServiceType) @@ -499,7 +535,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ AllocateCnNssi allocateCnNssi = new AllocateCnNssi() allocateCnNssi.nsstId = sliceTaskInfo.NSSTInfo.UUID allocateCnNssi.nssiId = sliceTaskInfo.suggestNssiId - allocateCnNssi.nssiName = sliceTaskInfo.NSSTInfo.name + allocateCnNssi.nssiName = "nssi_cn" + execution.getVariable("sliceServiceInstanceName") allocateCnNssi.sliceProfile = sliceTaskInfo.sliceProfile.trans2CnProfile() NsiInfo nsiInfo = new NsiInfo() nsiInfo.nsiId = sliceParams.suggestNsiId @@ -528,6 +564,8 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ serviceInfo.serviceInvariantUuid = sliceTaskInfo.NSSTInfo.invariantUUID serviceInfo.serviceUuid = sliceTaskInfo.NSSTInfo.UUID serviceInfo.nssiId = sliceTaskInfo.suggestNssiId //if shared + serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST") + serviceInfo.nssiName = allocateCnNssi.nssiName nbiRequest.setServiceInfo(serviceInfo) nbiRequest.setEsrInfo(esrInfo) @@ -595,7 +633,10 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ SliceProfile sliceProfile = new SliceProfile() sliceProfile.setProfileId(profileId) - //todo:... + sliceProfile.setLatency(tnSliceProfile.latency) + sliceProfile.setMaxBandwidth(tnSliceProfile.maxBandwidth) + sliceProfile.setJitter(tnSliceProfile.jitter) + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() .customer(globalSubscriberId) .serviceSubscription(subscriptionServiceType) @@ -656,6 +697,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ serviceInfo.serviceInvariantUuid = sliceTaskInfo.NSSTInfo.invariantUUID serviceInfo.serviceUuid = sliceTaskInfo.NSSTInfo.UUID serviceInfo.nssiId = sliceTaskInfo.suggestNssiId + serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST") nbiRequest.setServiceInfo(serviceInfo) nbiRequest.setEsrInfo(esrInfo) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy index 35079d2e58..e88b1c747f 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy @@ -62,8 +62,10 @@ class DoAllocateNSSI extends AbstractServiceTaskProcessor { */ void sendCreateRequestNSSMF(DelegateExecution execution) { NssmfAdapterNBIRequest nbiRequest = execution.getVariable("nbiRequest") as NssmfAdapterNBIRequest - String response = nssmfAdapterUtils.sendPostRequestNSSMF(execution, NSSMF_ALLOCATE_URL, - objectMapper.writeValueAsString(nbiRequest)) + String nssmfRequest = objectMapper.writeValueAsString(nbiRequest) + logger.debug("sendCreateRequestNSSMF: " + nssmfRequest) + + String response = nssmfAdapterUtils.sendPostRequestNSSMF(execution, NSSMF_ALLOCATE_URL, nssmfRequest) if (response != null) { NssiResponse nssiResponse = objectMapper.readValue(response, NssiResponse.class) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy index ec70bd3780..ccb04d9440 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceInstance.groovy @@ -100,7 +100,6 @@ class DoCreateSliceServiceInstance extends AbstractServiceTaskProcessor{ * todo: role */ String serviceRole = "service-profile" - String serviceType = execution.getVariable("serviceType") String globalSubscriberId = execution.getVariable("globalSubscriberId") String subscriptionServiceType = execution.getVariable("subscriptionServiceType") @@ -111,7 +110,7 @@ class DoCreateSliceServiceInstance extends AbstractServiceTaskProcessor{ ss.setServiceInstanceId(ssInstanceId) String sliceInstanceName = execution.getVariable("serviceInstanceName") ss.setServiceInstanceName(sliceInstanceName) - ss.setServiceType(serviceType) + ss.setServiceType(serviceProfile.get("sST")) String serviceStatus = "deactivated" ss.setOrchestrationStatus(serviceStatus) String modelInvariantUuid = modelInfo.getModelInvariantUuid() diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy index 9450227467..25a7159264 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy @@ -416,10 +416,10 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ sliceProfile.remove("domainType") SliceProfileAdapter adapter = objectMapper.readValue(objectMapper.writeValueAsString(sliceProfile), SliceProfileAdapter.class) switch (domainType.toLowerCase()) { - case "tn-bh": + case "tn_bh": sliceParams.tnBHSliceTaskInfo.sliceProfile = adapter break - case "an-nf": + case "an_nf": case "an": sliceParams.anSliceTaskInfo.sliceProfile = adapter break diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy index cf9a95ecfa..4eb70a5302 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy @@ -101,7 +101,7 @@ class DoCreateTnNssiInstance extends AbstractServiceTaskProcessor { void createServiceInstance(DelegateExecution execution) { - String serviceRole = "TN" + String serviceRole = "nssi" String serviceType = execution.getVariable("subscriptionServiceType") String ssInstanceId = execution.getVariable("sliceServiceInstanceId") String sliceProfileStr = execution.getVariable("sliceProfile") diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCommunicationService.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCommunicationService.bpmn index a632266c2e..04bab09491 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCommunicationService.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCommunicationService.bpmn @@ -145,7 +145,7 @@ csi.createCSAndSSRelationship(execution)</bpmn:script> <camunda:in source="serviceInstanceId" target="serviceInstanceId" /> <camunda:in source="csInputMap" target="csInputMap" /> <camunda:in source="serviceInstanceName" target="serviceInstanceName" /> - <camunda:in source="serviceType" target="serviceType" /> + <camunda:in source="csServiceType" target="csServiceType" /> <camunda:in source="uuiRequest" target="uuiRequest" /> <camunda:in source="modelInvariantUuid" target="modelInvariantUuid" /> <camunda:in source="modelUuid" target="modelUuid" /> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn index 1a9281f7d9..290e13d05c 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateSliceService.bpmn @@ -34,7 +34,6 @@ css.processUserOptions(execution)</bpmn:script> <camunda:in source="serviceInstanceName" target="serviceInstanceName" /> <camunda:in source="globalSubscriberId" target="globalSubscriberId" /> <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" /> - <camunda:in source="serviceType" target="serviceType" /> <camunda:in source="uuiRequest" target="uuiRequest" /> <camunda:in source="operationId" target="operationId" /> <camunda:out source="WorkflowException" target="WorkflowException" /> diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterDeleteTasks.java new file mode 100644 index 0000000000..87466bbbd4 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/cnf/tasks/CnfAdapterDeleteTasks.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ + * 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.infrastructure.adapter.cnf.tasks; + +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule; +import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; +import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; +import org.onap.so.client.adapter.cnf.CnfAdapterClient; +import org.onap.so.client.exception.ExceptionBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class CnfAdapterDeleteTasks { + private static final Logger logger = LoggerFactory.getLogger(CnfAdapterDeleteTasks.class); + + @Autowired + private ExtractPojosForBB extractPojosForBB; + @Autowired + private ExceptionBuilder exceptionUtil; + @Autowired + private CnfAdapterClient cnfAdapterClient; + + /** + * This method is used for deleting the instance with Multicloud K8s Plugin. + * + * @param execution + * @return + */ + public void deleteInstance(BuildingBlockExecution execution) { + try { + logger.debug("Running delete instance - Helm"); + VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); + String heatStackId = vfModule.getHeatStackId(); + execution.setVariable("heatStackId", heatStackId); + cnfAdapterClient.deleteVfModule(heatStackId); + } catch (Exception ex) { + logger.error("Exception occurred", ex); + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); + } + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java new file mode 100644 index 0000000000..3556cc024c --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java @@ -0,0 +1,232 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ + * Modifications Copyright (c) 2020 Nokia + * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ + * 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.infrastructure.workflow.tasks; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.db.catalog.beans.CollectionResourceCustomization; +import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization; +import org.onap.so.db.catalog.beans.CvnfcCustomization; +import org.onap.so.db.catalog.beans.VfModuleCustomization; +import org.onap.so.db.catalog.client.CatalogDbClient; +import org.onap.so.serviceinstancebeans.Networks; +import org.onap.so.serviceinstancebeans.Pnfs; +import org.onap.so.serviceinstancebeans.Service; +import org.onap.so.serviceinstancebeans.VfModules; +import org.onap.so.serviceinstancebeans.Vnfs; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.FABRIC_CONFIGURATION; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.USER_PARAM_SERVICE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.WORKFLOW_ACTION_ERROR_MESSAGE; + +@Component +public class UserParamsServiceTraversal { + + private static final Logger logger = LoggerFactory.getLogger(UserParamsServiceTraversal.class); + + private final CatalogDbClient catalogDbClient; + private final ExceptionBuilder exceptionBuilder; + + UserParamsServiceTraversal(CatalogDbClient catalogDbClient, ExceptionBuilder exceptionBuilder) { + this.catalogDbClient = catalogDbClient; + this.exceptionBuilder = exceptionBuilder; + } + + protected List<Resource> getResourceListFromUserParams(DelegateExecution execution, + List<Map<String, Object>> userParams, String serviceModelVersionId, String requestAction) + throws IOException { + List<Resource> resourceList = new ArrayList<>(); + boolean foundVfModuleOrVG = false; + String vnfCustomizationUUID = ""; + String vfModuleCustomizationUUID = ""; + if (userParams != null) { + for (Map<String, Object> params : userParams) { + if (params.containsKey(USER_PARAM_SERVICE)) { + ObjectMapper obj = new ObjectMapper(); + String input = obj.writeValueAsString(params.get(USER_PARAM_SERVICE)); + Service validate = obj.readValue(input, Service.class); + resourceList.add( + new Resource(WorkflowType.SERVICE, validate.getModelInfo().getModelVersionId(), false)); + if (validate.getResources().getVnfs() != null) { + for (Vnfs vnf : validate.getResources().getVnfs()) { + resourceList.add(new Resource(WorkflowType.VNF, + vnf.getModelInfo().getModelCustomizationId(), false)); + if (vnf.getModelInfo() != null && vnf.getModelInfo().getModelCustomizationUuid() != null) { + vnfCustomizationUUID = vnf.getModelInfo().getModelCustomizationUuid(); + } + if (vnf.getVfModules() != null) { + for (VfModules vfModule : vnf.getVfModules()) { + VfModuleCustomization vfModuleCustomization = + catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID( + vfModule.getModelInfo().getModelCustomizationUuid()); + if (vfModuleCustomization != null) { + + if (vfModuleCustomization.getVfModule() != null + && vfModuleCustomization.getVfModule().getVolumeHeatTemplate() != null + && vfModuleCustomization.getVolumeHeatEnv() != null) { + resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, + vfModuleCustomization.getModelCustomizationUUID(), false)); + foundVfModuleOrVG = true; + } + + if ((vfModuleCustomization.getVfModule() != null) + && ((vfModuleCustomization.getVfModule().getModuleHeatTemplate() != null + && vfModuleCustomization.getHeatEnvironment() != null)) + || (vfModuleCustomization.getVfModule().getModelName() != null + && vfModuleCustomization.getVfModule().getModelName() + .contains("helm"))) { + foundVfModuleOrVG = true; + Resource resource = new Resource(WorkflowType.VFMODULE, + vfModuleCustomization.getModelCustomizationUUID(), false); + resource.setBaseVfModule( + vfModuleCustomization.getVfModule().getIsBase() != null + && vfModuleCustomization.getVfModule().getIsBase()); + resourceList.add(resource); + if (vfModule.getModelInfo() != null + && vfModule.getModelInfo().getModelCustomizationUuid() != null) { + vfModuleCustomizationUUID = + vfModule.getModelInfo().getModelCustomizationUuid(); + } + if (!vnfCustomizationUUID.isEmpty() + && !vfModuleCustomizationUUID.isEmpty()) { + List<CvnfcConfigurationCustomization> configs = + traverseCatalogDbForConfiguration( + validate.getModelInfo().getModelVersionId(), + vnfCustomizationUUID, vfModuleCustomizationUUID); + for (CvnfcConfigurationCustomization config : configs) { + Resource configResource = new Resource(WorkflowType.CONFIGURATION, + config.getConfigurationResource().getModelUUID(), false); + resource.setVnfCustomizationId( + vnf.getModelInfo().getModelCustomizationId()); + resource.setVfModuleCustomizationId( + vfModule.getModelInfo().getModelCustomizationId()); + resourceList.add(configResource); + } + } + } + if (!foundVfModuleOrVG) { + buildAndThrowException(execution, + "Could not determine if vfModule was a vfModule or volume group. Heat template and Heat env are null"); + } + } + } + } + } + } + if (validate.getResources().getPnfs() != null) { + for (Pnfs pnf : validate.getResources().getPnfs()) { + resourceList.add(new Resource(WorkflowType.PNF, + pnf.getModelInfo().getModelCustomizationId(), false)); + } + } + if (validate.getResources().getNetworks() != null) { + for (Networks network : validate.getResources().getNetworks()) { + resourceList.add(new Resource(WorkflowType.NETWORK, + network.getModelInfo().getModelCustomizationId(), false)); + } + if (requestAction.equals(CREATE_INSTANCE)) { + String networkColCustId = + queryCatalogDbForNetworkCollection(execution, serviceModelVersionId); + if (networkColCustId != null) { + resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, networkColCustId, false)); + } + } + } + break; + } + } + } + return resourceList; + } + + + private List<CvnfcConfigurationCustomization> traverseCatalogDbForConfiguration(String serviceModelUUID, + String vnfCustomizationUUID, String vfModuleCustomizationUUID) { + List<CvnfcConfigurationCustomization> configurations = new ArrayList<>(); + try { + List<CvnfcCustomization> cvnfcCustomizations = catalogDbClient.getCvnfcCustomization(serviceModelUUID, + vnfCustomizationUUID, vfModuleCustomizationUUID); + for (CvnfcCustomization cvnfc : cvnfcCustomizations) { + for (CvnfcConfigurationCustomization customization : cvnfc.getCvnfcConfigurationCustomization()) { + if (customization.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)) { + configurations.add(customization); + } + } + } + logger.debug("found {} fabric configuration(s)", configurations.size()); + return configurations; + } catch (Exception ex) { + logger.error("Error in finding configurations", ex); + return configurations; + } + } + + private String queryCatalogDbForNetworkCollection(DelegateExecution execution, String serviceModelVersionId) { + org.onap.so.db.catalog.beans.Service service = catalogDbClient.getServiceByID(serviceModelVersionId); + if (service != null) { + CollectionResourceCustomization networkCollection = this.findCatalogNetworkCollection(execution, service); + if (networkCollection != null) { + return networkCollection.getModelCustomizationUUID(); + } + } + return null; + } + + private CollectionResourceCustomization findCatalogNetworkCollection(DelegateExecution execution, + org.onap.so.db.catalog.beans.Service service) { + CollectionResourceCustomization networkCollection = null; + int count = 0; + for (CollectionResourceCustomization collectionCustom : service.getCollectionResourceCustomizations()) { + if (catalogDbClient.getNetworkCollectionResourceCustomizationByID( + collectionCustom.getModelCustomizationUUID()) != null) { + networkCollection = collectionCustom; + count++; + } + } + if (count == 0) { + return null; + } else if (count > 1) { + buildAndThrowException(execution, + "Found multiple Network Collections in the Service model, only one per Service is supported."); + } + return networkCollection; + } + + private void buildAndThrowException(DelegateExecution execution, String msg) { + logger.error(msg); + execution.setVariable(WORKFLOW_ACTION_ERROR_MESSAGE, msg); + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg); + } +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 5d95f973bf..79c846bb12 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -26,18 +26,8 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.UUID; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.lang3.SerializationUtils; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.javatuples.Pair; @@ -76,8 +66,6 @@ import org.onap.so.client.orchestration.AAIEntityNotFoundException; import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization; import org.onap.so.db.catalog.beans.CollectionResourceCustomization; import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization; -import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization; -import org.onap.so.db.catalog.beans.CvnfcCustomization; import org.onap.so.db.catalog.beans.InstanceGroup; import org.onap.so.db.catalog.beans.VfModuleCustomization; import org.onap.so.db.catalog.beans.macro.NorthBoundRequest; @@ -86,28 +74,35 @@ import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.serviceinstancebeans.CloudConfiguration; import org.onap.so.serviceinstancebeans.ModelInfo; import org.onap.so.serviceinstancebeans.ModelType; -import org.onap.so.serviceinstancebeans.Networks; -import org.onap.so.serviceinstancebeans.Pnfs; import org.onap.so.serviceinstancebeans.RelatedInstance; import org.onap.so.serviceinstancebeans.RelatedInstanceList; import org.onap.so.serviceinstancebeans.RequestDetails; -import org.onap.so.serviceinstancebeans.Service; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; -import org.onap.so.serviceinstancebeans.VfModules; -import org.onap.so.serviceinstancebeans.Vnfs; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.FABRIC_CONFIGURATION; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.USER_PARAM_SERVICE; +import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.WORKFLOW_ACTION_ERROR_MESSAGE; @Component public class WorkflowAction { - private static final String WORKFLOW_ACTION_ERROR_MESSAGE = "WorkflowActionErrorMessage"; private static final String SERVICE_INSTANCES = "serviceInstances"; private static final String SERVICE_INSTANCE = "serviceInstance"; private static final String VF_MODULES = "vfModules"; @@ -123,14 +118,11 @@ public class WorkflowAction { private static final String NETWORKCOLLECTION = "NetworkCollection"; private static final String CONFIGURATION = "Configuration"; private static final String ASSIGNINSTANCE = "assignInstance"; - private static final String CREATEINSTANCE = "createInstance"; private static final String REPLACEINSTANCE = "replaceInstance"; private static final String REPLACEINSTANCERETAINASSIGNMENTS = "replaceInstanceRetainAssignments"; - private static final String USERPARAMSERVICE = "service"; private static final String SUPPORTEDTYPES = "vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances|instanceGroups"; private static final String HOMINGSOLUTION = "Homing_Solution"; - private static final String FABRIC_CONFIGURATION = "FabricConfiguration"; private static final String SERVICE_TYPE_TRANSPORT = "TRANSPORT"; private static final String SERVICE_TYPE_BONDING = "BONDING"; private static final String CLOUD_OWNER = "DEFAULT"; @@ -167,6 +159,8 @@ public class WorkflowAction { private VrfValidation vrfValidation; @Autowired private Environment environment; + @Autowired + private UserParamsServiceTraversal userParamsServiceTraversal; public void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils) { this.bbInputSetupUtils = bbInputSetupUtils; @@ -238,7 +232,7 @@ public class WorkflowAction { requestDetails, requestAction, resourceId, flowsToExecute, vnfType, orchFlows, apiVersion, resourceKey, replaceInfo); } else { - if (isConfiguration(orchFlows) && !requestAction.equalsIgnoreCase(CREATEINSTANCE)) { + if (isConfiguration(orchFlows) && !requestAction.equalsIgnoreCase(CREATE_INSTANCE)) { addConfigBuildingBlocksToFlowsToExecuteList(execution, sIRequest, requestId, workflowResourceIds, requestDetails, requestAction, resourceId, flowsToExecute, vnfType, apiVersion, resourceKey, replaceInfo, orchFlows); @@ -255,36 +249,41 @@ public class WorkflowAction { } } } else { - boolean foundRelated = false; boolean containsService = false; List<Resource> resourceList = new ArrayList<>(); List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>(); + List<Map<String, Object>> userParams = + sIRequest.getRequestDetails().getRequestParameters().getUserParams(); if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(ASSIGNINSTANCE)) { // SERVICE-MACRO-ASSIGN will always get user params with a // service. - if (sIRequest.getRequestDetails().getRequestParameters().getUserParams() != null) { + + if (userParams != null) { containsService = isContainsService(sIRequest); if (containsService) { - traverseUserParamsService(execution, resourceList, sIRequest, requestAction); + resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, + userParams, serviceInstanceId, requestAction); } } else { buildAndThrowException(execution, "Service-Macro-Assign request details must contain user params with a service"); } - } else if (resourceType == WorkflowType.SERVICE && requestAction.equalsIgnoreCase(CREATEINSTANCE)) { + } else if (resourceType == WorkflowType.SERVICE + && requestAction.equalsIgnoreCase(CREATE_INSTANCE)) { // SERVICE-MACRO-CREATE will get user params with a service, // a service with a network, a service with a - // networkcollection, OR an empty service. + // network collection, OR an empty service. // If user params is just a service or null and macro // queries the SI and finds a VNF, macro fails. - if (sIRequest.getRequestDetails().getRequestParameters().getUserParams() != null) { + if (userParams != null) { containsService = isContainsService(sIRequest); } if (containsService) { - foundRelated = traverseUserParamsService(execution, resourceList, sIRequest, requestAction); + resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, + userParams, serviceInstanceId, requestAction); } - if (!foundRelated) { + if (!foundRelated(resourceList)) { traverseCatalogDbService(execution, sIRequest, resourceList, aaiResourceIds); } } else if (resourceType == WorkflowType.SERVICE @@ -333,15 +332,15 @@ public class WorkflowAction { logger.info("Sorting for Vlan Tagging"); flowsToExecute = sortExecutionPathByObjectForVlanTagging(flowsToExecute, requestAction); } - // By default, enable homing at VNF level for CREATEINSTANCE and ASSIGNINSTANCE + // By default, enable homing at VNF level for CREATE_INSTANCE and ASSIGNINSTANCE if (resourceType == WorkflowType.SERVICE - && (requestAction.equals(CREATEINSTANCE) || requestAction.equals(ASSIGNINSTANCE)) + && (requestAction.equals(CREATE_INSTANCE) || requestAction.equals(ASSIGNINSTANCE)) && resourceList.stream().anyMatch(x -> WorkflowType.VNF.equals(x.getResourceType()))) { execution.setVariable(HOMING, true); execution.setVariable("calledHoming", false); } if (resourceType == WorkflowType.SERVICE && (requestAction.equalsIgnoreCase(ASSIGNINSTANCE) - || requestAction.equalsIgnoreCase(CREATEINSTANCE))) { + || requestAction.equalsIgnoreCase(CREATE_INSTANCE))) { generateResourceIds(flowsToExecute, resourceList, serviceInstanceId); } else { updateResourceIdsFromAAITraversal(flowsToExecute, resourceList, aaiResourceIds, @@ -351,9 +350,8 @@ public class WorkflowAction { } // If the user set "Homing_Solution" to "none", disable homing, else if "Homing_Solution" is specified, // enable it. - if (sIRequest.getRequestDetails().getRequestParameters() != null - && sIRequest.getRequestDetails().getRequestParameters().getUserParams() != null) { - List<Map<String, Object>> userParams = getListOfUserParams(sIRequest); + List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams(); + if (sIRequest.getRequestDetails().getRequestParameters() != null && userParams != null) { for (Map<String, Object> params : userParams) { if (params.containsKey(HOMINGSOLUTION)) { execution.setVariable(HOMING, !"none".equals(params.get(HOMINGSOLUTION))); @@ -400,14 +398,12 @@ public class WorkflowAction { private boolean isContainsService(ServiceInstancesRequest sIRequest) { boolean containsService; - List<Map<String, Object>> userParams = getListOfUserParams(sIRequest); - containsService = userParams.stream().anyMatch(param -> param.containsKey(USERPARAMSERVICE)); + List<Map<String, Object>> userParams = sIRequest.getRequestDetails().getRequestParameters().getUserParams(); + containsService = userParams.stream().anyMatch(param -> param.containsKey(USER_PARAM_SERVICE)); return containsService; } - private List<Map<String, Object>> getListOfUserParams(ServiceInstancesRequest sIRequest) { - return sIRequest.getRequestDetails().getRequestParameters().getUserParams(); - } + private List<ExecuteBuildingBlock> loadExecuteBuildingBlocks(DelegateExecution execution, String requestId, String errorMessage) { @@ -625,6 +621,18 @@ public class WorkflowAction { return flowsToExecuteConfigs; } + protected void buildAndThrowException(DelegateExecution execution, String msg) { + logger.error(msg); + execution.setVariable(WORKFLOW_ACTION_ERROR_MESSAGE, msg); + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg); + } + + protected void buildAndThrowException(DelegateExecution execution, String msg, Exception ex) { + logger.error(msg, ex); + execution.setVariable(WORKFLOW_ACTION_ERROR_MESSAGE, msg + ex.getMessage()); + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg + ex.getMessage()); + } + protected List<OrchestrationFlow> getVfModuleReplaceBuildingBlocks(ConfigBuildingBlocksDataObject dataObj) throws Exception { @@ -1214,150 +1222,6 @@ public class WorkflowAction { } } - protected boolean traverseUserParamsService(DelegateExecution execution, List<Resource> resourceList, - ServiceInstancesRequest sIRequest, String requestAction) throws IOException { - boolean foundRelated = false; - boolean foundVfModuleOrVG = false; - String vnfCustomizationUUID = ""; - String vfModuleCustomizationUUID = ""; - if (sIRequest.getRequestDetails().getRequestParameters().getUserParams() != null) { - List<Map<String, Object>> userParams = getListOfUserParams(sIRequest); - for (Map<String, Object> params : userParams) { - if (params.containsKey(USERPARAMSERVICE)) { - ObjectMapper obj = new ObjectMapper(); - String input = obj.writeValueAsString(params.get(USERPARAMSERVICE)); - Service validate = obj.readValue(input, Service.class); - resourceList.add( - new Resource(WorkflowType.SERVICE, validate.getModelInfo().getModelVersionId(), false)); - if (validate.getResources().getVnfs() != null) { - for (Vnfs vnf : validate.getResources().getVnfs()) { - resourceList.add(new Resource(WorkflowType.VNF, - vnf.getModelInfo().getModelCustomizationId(), false)); - foundRelated = true; - if (vnf.getModelInfo() != null && vnf.getModelInfo().getModelCustomizationUuid() != null) { - vnfCustomizationUUID = vnf.getModelInfo().getModelCustomizationUuid(); - } - if (vnf.getVfModules() != null) { - for (VfModules vfModule : vnf.getVfModules()) { - VfModuleCustomization vfModuleCustomization = - catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID( - vfModule.getModelInfo().getModelCustomizationUuid()); - if (vfModuleCustomization != null) { - - if (vfModuleCustomization.getVfModule() != null - && vfModuleCustomization.getVfModule().getVolumeHeatTemplate() != null - && vfModuleCustomization.getVolumeHeatEnv() != null) { - resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, - vfModuleCustomization.getModelCustomizationUUID(), false)); - foundVfModuleOrVG = true; - } - - if ((vfModuleCustomization.getVfModule() != null) - && ((vfModuleCustomization.getVfModule().getModuleHeatTemplate() != null - && vfModuleCustomization.getHeatEnvironment() != null)) - || (vfModuleCustomization.getVfModule().getModelName() != null - && vfModuleCustomization.getVfModule().getModelName() - .contains("helm"))) { - foundVfModuleOrVG = true; - Resource resource = new Resource(WorkflowType.VFMODULE, - vfModuleCustomization.getModelCustomizationUUID(), false); - resource.setBaseVfModule( - vfModuleCustomization.getVfModule().getIsBase() != null - && vfModuleCustomization.getVfModule().getIsBase()); - resourceList.add(resource); - if (vfModule.getModelInfo() != null - && vfModule.getModelInfo().getModelCustomizationUuid() != null) { - vfModuleCustomizationUUID = - vfModule.getModelInfo().getModelCustomizationUuid(); - } - if (!vnfCustomizationUUID.isEmpty() - && !vfModuleCustomizationUUID.isEmpty()) { - List<CvnfcConfigurationCustomization> configs = - traverseCatalogDbForConfiguration( - validate.getModelInfo().getModelVersionId(), - vnfCustomizationUUID, vfModuleCustomizationUUID); - for (CvnfcConfigurationCustomization config : configs) { - Resource configResource = new Resource(WorkflowType.CONFIGURATION, - config.getConfigurationResource().getModelUUID(), false); - resource.setVnfCustomizationId( - vnf.getModelInfo().getModelCustomizationId()); - resource.setVfModuleCustomizationId( - vfModule.getModelInfo().getModelCustomizationId()); - resourceList.add(configResource); - } - } - } - if (!foundVfModuleOrVG) { - buildAndThrowException(execution, - "Could not determine if vfModule was a vfModule or volume group. Heat template and Heat env are null"); - } - } - } - } - } - } - if (validate.getResources().getPnfs() != null) { - for (Pnfs pnf : validate.getResources().getPnfs()) { - resourceList.add(new Resource(WorkflowType.PNF, - pnf.getModelInfo().getModelCustomizationId(), false)); - foundRelated = true; - } - } - if (validate.getResources().getNetworks() != null) { - for (Networks network : validate.getResources().getNetworks()) { - resourceList.add(new Resource(WorkflowType.NETWORK, - network.getModelInfo().getModelCustomizationId(), false)); - foundRelated = true; - } - if (requestAction.equals(CREATEINSTANCE)) { - String networkColCustId = queryCatalogDBforNetworkCollection(execution, sIRequest); - if (networkColCustId != null) { - resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, networkColCustId, false)); - foundRelated = true; - } - } - } - break; - } - } - } - return foundRelated; - } - - protected List<CvnfcConfigurationCustomization> traverseCatalogDbForConfiguration(String serviceModelUUID, - String vnfCustomizationUUID, String vfModuleCustomizationUUID) { - List<CvnfcConfigurationCustomization> configurations = new ArrayList<>(); - try { - List<CvnfcCustomization> cvnfcCustomizations = catalogDbClient.getCvnfcCustomization(serviceModelUUID, - vnfCustomizationUUID, vfModuleCustomizationUUID); - for (CvnfcCustomization cvnfc : cvnfcCustomizations) { - for (CvnfcConfigurationCustomization customization : cvnfc.getCvnfcConfigurationCustomization()) { - if (customization.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)) { - configurations.add(customization); - } - } - } - logger.debug("found {} fabric configuration(s)", configurations.size()); - return configurations; - } catch (Exception ex) { - logger.error("Error in finding configurations", ex); - return configurations; - } - } - - protected String queryCatalogDBforNetworkCollection(DelegateExecution execution, - ServiceInstancesRequest sIRequest) { - org.onap.so.db.catalog.beans.Service service = - catalogDbClient.getServiceByID(sIRequest.getRequestDetails().getModelInfo().getModelVersionId()); - if (service != null) { - CollectionResourceCustomization networkCollection = this.findCatalogNetworkCollection(execution, service); - if (networkCollection != null) { - return networkCollection.getModelCustomizationUUID(); - } - } - return null; - } - protected WorkflowResourceIds populateResourceIdsFromApiHandler(DelegateExecution execution) { return WorkflowResourceIdsUtils.getWorkflowResourceIdsFromExecution(execution); } @@ -1442,7 +1306,7 @@ public class WorkflowAction { protected List<ExecuteBuildingBlock> sortExecutionPathByObjectForVlanTagging(List<ExecuteBuildingBlock> orchFlows, String requestAction) { List<ExecuteBuildingBlock> sortedOrchFlows = new ArrayList<>(); - if (requestAction.equals(CREATEINSTANCE)) { + if (requestAction.equals(CREATE_INSTANCE)) { for (ExecuteBuildingBlock ebb : orchFlows) { if (ebb.getBuildingBlock().getBpmnFlowName().equals("AssignNetworkBB")) { String key = ebb.getBuildingBlock().getKey(); @@ -1555,7 +1419,7 @@ public class WorkflowAction { } else if (orchFlow.getFlowName().contains(VFMODULE) || (orchFlow.getFlowName().contains(CONTROLLER) && (VFMODULE).equalsIgnoreCase(orchFlow.getBpmnScope()))) { List<Resource> vfModuleResourcesSorted; - if (requestAction.equals(CREATEINSTANCE) || requestAction.equals(ASSIGNINSTANCE) + if (requestAction.equals(CREATE_INSTANCE) || requestAction.equals(ASSIGNINSTANCE) || requestAction.equals("activateInstance")) { vfModuleResourcesSorted = sortVfModulesByBaseFirst(resourceList.stream() .filter(x -> WorkflowType.VFMODULE == x.getResourceType()).collect(Collectors.toList())); @@ -1686,18 +1550,6 @@ public class WorkflowAction { return listToExecute; } - protected void buildAndThrowException(DelegateExecution execution, String msg, Exception ex) { - logger.error(msg, ex); - execution.setVariable(WORKFLOW_ACTION_ERROR_MESSAGE, msg + ex.getMessage()); - exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg + ex.getMessage()); - } - - protected void buildAndThrowException(DelegateExecution execution, String msg) { - logger.error(msg); - execution.setVariable(WORKFLOW_ACTION_ERROR_MESSAGE, msg); - exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg); - } - public void handleRuntimeException(DelegateExecution execution) { StringBuilder wfeExpMsg = new StringBuilder("Runtime error "); String runtimeErrorMessage; @@ -1724,7 +1576,7 @@ public class WorkflowAction { protected boolean isRequestMacroServiceResume(boolean aLaCarte, WorkflowType resourceType, String requestAction, String serviceInstanceId) { return (!aLaCarte && resourceType == WorkflowType.SERVICE - && (requestAction.equalsIgnoreCase(ASSIGNINSTANCE) || requestAction.equalsIgnoreCase(CREATEINSTANCE)) + && (requestAction.equalsIgnoreCase(ASSIGNINSTANCE) || requestAction.equalsIgnoreCase(CREATE_INSTANCE)) && (serviceInstanceId != null && serviceInstanceId.trim().length() > 1) && (bbInputSetupUtils.getAAIServiceInstanceById(serviceInstanceId) != null)); } @@ -1875,6 +1727,17 @@ public class WorkflowAction { return generatedResourceId; } + protected boolean foundRelated(List<Resource> resourceList) { + return (containsWorkflowType(resourceList, WorkflowType.VNF) + || containsWorkflowType(resourceList, WorkflowType.PNF) + || containsWorkflowType(resourceList, WorkflowType.NETWORK) + || containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION)); + } + + protected boolean containsWorkflowType(List<Resource> resourceList, WorkflowType workflowType) { + return resourceList.stream().anyMatch(resource -> resource.getResourceType().equals(workflowType)); + } + private void fillExecutionDefault(DelegateExecution execution) { execution.setVariable("sentSyncResponse", false); execution.setVariable(HOMING, false); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java new file mode 100644 index 0000000000..bffa2592c1 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ + * Modifications Copyright (c) 2020 Nokia + * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ + * 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.infrastructure.workflow.tasks; + +public final class WorkflowActionConstants { + + static final String USER_PARAM_SERVICE = "service"; + static final String CREATE_INSTANCE = "createInstance"; + static final String FABRIC_CONFIGURATION = "FabricConfiguration"; + static final String WORKFLOW_ACTION_ERROR_MESSAGE = "WorkflowActionErrorMessage"; +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java index 65f8a084eb..da36a6f040 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java @@ -76,6 +76,25 @@ public class CnfAdapterClient { } } + + @Retryable(value = {HttpServerErrorException.class}, maxAttempts = 3, backoff = @Backoff(delay = 3000)) + public void deleteVfModule(String heatStackId) throws CnfAdapterClientException { + try { + // String uri = env.getRequiredProperty("mso.cnf.adapter.endpoint"); //TODO: This needs to be added as well + // for configuration + String uri = "http://so-cnf-adapter:8090"; + String endpoint = UriBuilder.fromUri(uri).path(INSTANCE_CREATE_PATH + "/" + heatStackId).build().toString(); + HttpEntity<?> entity = new HttpEntity<>(getHttpHeaders()); + restTemplate.exchange(endpoint, HttpMethod.DELETE, entity, String.class); + } catch (HttpClientErrorException e) { + logger.error("Error Calling CNF Adapter, e"); + if (HttpStatus.SC_NOT_FOUND == e.getStatusCode().value()) { + throw new EntityNotFoundException(e.getResponseBodyAsString()); + } + throw e; + } + } + @Retryable(value = {HttpServerErrorException.class}, maxAttempts = 3, backoff = @Backoff(delay = 3000)) public InstanceResponse healthcheck() throws CnfAdapterClientException { try { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java index e8ce828652..ab83acaec2 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/BaseTaskTest.java @@ -24,7 +24,6 @@ package org.onap.so.bpmn; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; -import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.common.InjectionHelper; import org.onap.so.bpmn.common.data.TestDataSetup; import org.onap.so.bpmn.infrastructure.flowspecific.tasks.AssignNetworkBBUtils; @@ -33,8 +32,6 @@ import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.aaiclient.client.aai.AAIResourcesClient; -import org.onap.aaiclient.client.aai.entities.AAIResultWrapper; -import org.onap.aaiclient.client.aai.entities.Relationships; import org.onap.so.client.aai.mapper.AAIObjectMapper; import org.onap.so.client.adapter.network.mapper.NetworkAdapterObjectMapper; import org.onap.so.client.appc.ApplicationControllerAction; @@ -162,5 +159,4 @@ public abstract class BaseTaskTest extends TestDataSetup { @Mock protected NamingRequestObject namingRequestObject; - } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java index 7f22c5138e..0a3f74c2ea 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java @@ -35,6 +35,7 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyList; import static org.mockito.ArgumentMatchers.anyObject; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; @@ -127,6 +128,10 @@ public class WorkflowActionTest extends BaseTaskTest { @Mock protected Environment environment; + + @Mock + protected UserParamsServiceTraversal userParamsServiceTraversal; + @InjectMocks protected WorkflowAction workflowAction; private DelegateExecution execution; @@ -286,6 +291,8 @@ public class WorkflowActionTest extends BaseTaskTest { VfModuleCustomization vfModuleCustomization3 = vfModuleCustomization2; vfModuleCustomization3.setModelCustomizationUUID("72d9d1cd-f46d-447a-abdb-451d6fb05fa8"); + when(userParamsServiceTraversal.getResourceListFromUserParams(any(), anyList(), anyString(), anyString())) + .thenReturn(prepareListWithResources()); when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource, false, "my-custom-cloud-owner")).thenReturn(northBoundRequest); when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f")) @@ -334,6 +341,8 @@ public class WorkflowActionTest extends BaseTaskTest { VfModuleCustomization vfModuleCustomization3 = vfModuleCustomization2; vfModuleCustomization3.setModelCustomizationUUID("72d9d1cd-f46d-447a-abdb-451d6fb05fa8"); + when(userParamsServiceTraversal.getResourceListFromUserParams(any(), anyList(), anyString(), anyString())) + .thenReturn(prepareListWithResources()); when(environment.getProperty("org.onap.so.cloud-owner")).thenReturn("att-aic"); when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource, false, "att-aic")).thenReturn(northBoundRequest); @@ -606,6 +615,8 @@ public class WorkflowActionTest extends BaseTaskTest { VfModuleCustomization vfModuleCustomization3 = vfModuleCustomization2; vfModuleCustomization3.setModelCustomizationUUID("72d9d1cd-f46d-447a-abdb-451d6fb05fa8"); + when(userParamsServiceTraversal.getResourceListFromUserParams(any(), anyList(), anyString(), anyString())) + .thenReturn(prepareListWithResources()); when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(gAction, resource, false, "my-custom-cloud-owner")).thenReturn(northBoundRequest); when(catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID("a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f")) @@ -622,6 +633,7 @@ public class WorkflowActionTest extends BaseTaskTest { "ActivateVolumeGroupBB", "CreateVfModuleBB", "CreateVfModuleBB", "CreateVfModuleBB", "ActivateVfModuleBB", "ActivateVfModuleBB", "ActivateVfModuleBB", "ActivateVnfBB", "ActivateServiceInstanceBB"); + assertEquals(3, ebbs.get(0).getWorkflowResourceIds().getServiceInstanceId().length()); int randomUUIDLength = UUID.randomUUID().toString().length(); assertEquals(randomUUIDLength, ebbs.get(1).getWorkflowResourceIds().getVnfId().length()); @@ -3100,6 +3112,32 @@ public class WorkflowActionTest extends BaseTaskTest { } } + @Test + public void foundRelatedTest() { + List<Resource> resourceList = new ArrayList<>(); + resourceList.add(new Resource(WorkflowType.PNF, "model customization id", false)); + resourceList.add(new Resource(WorkflowType.VNF, "model customization id", false)); + resourceList.add(new Resource(WorkflowType.NETWORK, "model customization id", false)); + resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, "model customization id", false)); + + assertEquals(workflowAction.foundRelated(resourceList), true); + } + + @Test + public void containsWorkflowTypeTest() { + List<Resource> resourceList = new ArrayList<>(); + resourceList.add(new Resource(WorkflowType.PNF, "resource id", false)); + resourceList.add(new Resource(WorkflowType.VNF, "model customization id", false)); + resourceList.add(new Resource(WorkflowType.NETWORK, "model customization id", false)); + resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION, "model customization id", false)); + + assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.PNF), true); + assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.VNF), true); + assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.NETWORK), true); + assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION), true); + assertEquals(workflowAction.containsWorkflowType(resourceList, WorkflowType.CONFIGURATION), false); + } + private List<Pair<WorkflowType, String>> getExpectedResourceIds() { List<Pair<WorkflowType, String>> resourceIds = new ArrayList<>(); resourceIds.add(new Pair<WorkflowType, String>(WorkflowType.VNF, "testVnfId1")); @@ -3141,4 +3179,15 @@ public class WorkflowActionTest extends BaseTaskTest { private String readBpmnRequestFromFile(String fileName) throws IOException { return new String(Files.readAllBytes(Paths.get("src/test/resources/__files/" + fileName))); } + + private List<Resource> prepareListWithResources() { + List<Resource> resourceList = new ArrayList<>(); + resourceList.add(new Resource(WorkflowType.SERVICE, "3c40d244-808e-42ca-b09a-256d83d19d0a", false)); + resourceList.add(new Resource(WorkflowType.VNF, "ab153b6e-c364-44c0-bef6-1f2982117f04", false)); + resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, "a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f", false)); + resourceList.add(new Resource(WorkflowType.VFMODULE, "72d9d1cd-f46d-447a-abdb-451d6fb05fa8", false)); + resourceList.add(new Resource(WorkflowType.VFMODULE, "3c40d244-808e-42ca-b09a-256d83d19d0a", false)); + resourceList.add(new Resource(WorkflowType.VFMODULE, "72d9d1cd-f46d-447a-abdb-451d6fb05fa8", false)); + return resourceList; + } } diff --git a/common/src/main/java/org/onap/so/beans/nsmf/QuerySubnetCapability.java b/common/src/main/java/org/onap/so/beans/nsmf/QuerySubnetCapability.java index 7485b387d8..6b30af9339 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/QuerySubnetCapability.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/QuerySubnetCapability.java @@ -2,19 +2,19 @@ * ============LICENSE_START======================================================= * ONAP - SO * ================================================================================ - * Copyright (C) 2020 Wipro Limited. - * ================================================================================ - * 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. + # Copyright (c) 2020, CMCC Technologies Co., Ltd. + # + # 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========================================================= */ diff --git a/docs/release-notes.rst b/docs/release-notes.rst index c1635fc532..d823b405f9 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -190,6 +190,8 @@ Quick Links: **Known Issues** * `SO-3403 <https://jira.onap.org/browse/SO-3403>`_ - The functionality of the SO cnf-adapter will be tested further and will be delivered by the Guilin Maintenance Release as a 1.7.11 patch. +* `SO-3237 <https://jira.onap.org/browse/SO-SO-3237>`_ - Exposed HTTP port. + **Upgrade Notes** diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml index 20b61e638a..abf2c8a634 100644 --- a/packages/docker/pom.xml +++ b/packages/docker/pom.xml @@ -84,7 +84,7 @@ <cleanup>try</cleanup> <dockerFile>docker-files/Dockerfile.so-app</dockerFile> <tags> - <tag>${project.version}</tag> + <!--tag>${project.version}</tag--> <tag>${project.version}-${maven.build.timestamp}</tag> <tag>${project.docker.latesttag.version}</tag> </tags> diff --git a/version.properties b/version.properties index 74801daa0f..11f0383267 100644 --- a/version.properties +++ b/version.properties @@ -3,8 +3,8 @@ # because they are used in Jenkins, whose plug-in doesn't support major=1 -minor=7 -patch=8 +minor=8 +patch=0 base_version=${major}.${minor}.${patch} |