diff options
44 files changed, 1198 insertions, 678 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-catalog-db-adapter/src/main/resources/db/migration/V8.8__AddSoftwareVersionToPnfCustomization.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.8__AddSoftwareVersionToPnfCustomization.sql new file mode 100644 index 0000000000..5578d3e590 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V8.8__AddSoftwareVersionToPnfCustomization.sql @@ -0,0 +1,6 @@ +use catalogdb; + +ALTER TABLE pnf_resource_customization +ADD DEFAULT_SOFTWARE_VERSION varchar(4000) null; + + 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/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java index 7efc397e30..73b825dc78 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java @@ -46,6 +46,7 @@ import org.onap.sdc.api.notification.IResourceInstance; import org.onap.sdc.api.notification.IStatusData; import org.onap.sdc.tosca.parser.api.IEntityDetails; import org.onap.sdc.tosca.parser.api.ISdcCsarHelper; +import org.onap.sdc.tosca.parser.elements.EntityDetails; import org.onap.sdc.tosca.parser.elements.queries.EntityQuery; import org.onap.sdc.tosca.parser.elements.queries.EntityQuery.EntityQueryBuilder; import org.onap.sdc.tosca.parser.elements.queries.TopologyTemplateQuery; @@ -133,6 +134,8 @@ public class ToscaResourceInstaller { private static final String CDS_MODEL_VERSION = "cds_model_version"; + private static final String DEFAULT_SOFTWARE_VERSION = "default_software_version"; + @Autowired protected ServiceRepository serviceRepo; @@ -932,6 +935,7 @@ public class ToscaResourceInstaller { pnfResourceCustomization.setBlueprintVersion(getStringValue(properties.get(SDNC_MODEL_VERSION))); pnfResourceCustomization.setSkipPostInstConf(getBooleanValue(properties.get(SKIP_POST_INST_CONF))); pnfResourceCustomization.setControllerActor(getStringValue(properties.get(CONTROLLER_ACTOR))); + pnfResourceCustomization.setDefaultSoftwareVersion(getStringValue(properties.get(DEFAULT_SOFTWARE_VERSION))); pnfResourceCustomization.setPnfResources(pnfResource); return pnfResourceCustomization; } diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java index 3db017cac5..eafb42a3d9 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java @@ -320,33 +320,6 @@ public class ASDCControllerITTest extends BaseTest { } } - private ArtifactInfoImpl constructPnfServiceArtifact() { - ArtifactInfoImpl artifactInfo = new ArtifactInfoImpl(); - artifactInfo.setArtifactType(ASDCConfiguration.TOSCA_CSAR); - artifactInfo.setArtifactURL("/download/service-pnfservice.csar"); - artifactInfo.setArtifactName("service-pnfservice.csar"); - artifactInfo.setArtifactVersion("1.0"); - artifactInfo.setArtifactUUID(artifactUuid); - return artifactInfo; - } - - /** - * Construct the PnfResourceInfo based on the resource-Test140Pnf-template.yml from - * service-Testservice140-csar.csar. - */ - private ResourceInfoImpl constructPnfResourceInfo() { - ResourceInfoImpl resourceInfo = new ResourceInfoImpl(); - resourceInfo.setResourceInstanceName("PNF CDS Test"); - resourceInfo.setResourceInvariantUUID("17d9d183-cee5-4a46-b5c4-6d5203f7d2e8"); - resourceInfo.setResoucreType("PNF"); - resourceInfo.setCategory("Application L4+"); - resourceInfo.setSubcategory("Firewall"); - resourceInfo.setResourceUUID("aa5d0562-80e7-43e9-af74-3085e57ab09f"); - resourceInfo.setResourceCustomizationUUID("9f01263a-eaf7-4d98-a37b-3785f751903e"); - resourceInfo.setResourceVersion("1.0"); - return resourceInfo; - } - /** * Testing with the service-Svc140-VF-csar.csar. */ @@ -479,6 +452,144 @@ public class ASDCControllerITTest extends BaseTest { } } + /** + * Test with service-pnfservice.csar. + */ + @Test + public void treatNotification_ValidPnfResource_With_Software_Version_ExpectedOutput() { + + /** + * service UUID/invariantUUID from global metadata in service-PnfServiceTestCds-template.yml. + */ + String serviceUuid = "888d93bd-ef31-4ab8-9d9e-3935e9a71845";// "77cf276e-905c-43f6-8d54-dda474be2f2e"; + String serviceInvariantUuid = "e5c5fd11-392f-4aa7-aeeb-b340c596d4bd";// "913e6776-4bc3-49b9-b399-b5bb4690f0c7"; + + initMockAaiServer(serviceUuid, serviceInvariantUuid); + + NotificationDataImpl notificationData = new NotificationDataImpl(); + notificationData.setServiceUUID(serviceUuid); + notificationData.setDistributionID(distributionId); + notificationData.setServiceInvariantUUID(serviceInvariantUuid); + notificationData.setServiceVersion("1.0"); + + ResourceInfoImpl resourceInfo = constructPnfResourceInfoWithSWV(); + List<ResourceInfoImpl> resourceInfoList = new ArrayList<>(); + resourceInfoList.add(resourceInfo); + notificationData.setResources(resourceInfoList); + + ArtifactInfoImpl artifactInfo = constructPnfServiceArtifactWithSWV(); + List<ArtifactInfoImpl> artifactInfoList = new ArrayList<>(); + artifactInfoList.add(artifactInfo); + notificationData.setServiceArtifacts(artifactInfoList); + + try { + asdcController.treatNotification(notificationData); + + logger.info("Checking the database for PNF ingestion"); + + /** + * Check the tosca csar entity, it should be the same as provided from NotficationData. + */ + ToscaCsar toscaCsar = toscaCsarRepository.findById(artifactUuid) + .orElseThrow(() -> new EntityNotFoundException("Tosca csar: " + artifactUuid + " not found")); + assertEquals("tosca csar UUID", artifactUuid, toscaCsar.getArtifactUUID()); + assertEquals("tosca csar name", "service-Testserviceforpnf-csar.csar", toscaCsar.getName()); + assertEquals("tosca csar version", "1.0", toscaCsar.getVersion()); + assertNull("tosca csar descrption", toscaCsar.getDescription()); + assertEquals("tosca csar checksum", "MANUAL_RECORD", toscaCsar.getArtifactChecksum()); + assertEquals("toscar csar URL", "/download/service-Testserviceforpnf-csar.csar", toscaCsar.getUrl()); + + /** + * Check the service entity, it should be the same as global metadata information in + * service-Testservice140-template.yml inside csar. + */ + Service service = serviceRepository.findById(serviceUuid) + .orElseThrow(() -> new EntityNotFoundException("Service: " + serviceUuid + " not found")); + + /** + * Check PNF resource, it should be the same as metadata in the topology template in + * service-PnfServiceTestCds-template.yml OR global metadata in the resource-PnfServiceTestCds-template.yml + */ + String pnfResourceKey = "72a2c44c-bb8a-4086-824b-0662d40bcd68"; + + /** + * Check PNF resource customization, it should be the same as metadata in the topology template in + * service-PnfServiceTestCds-template.yml OR global metadata in the resource-PnfServiceTestCds-template.yml + */ + String pnfCustomizationKey = "96642e60-17cd-48c1-875d-b00b08fdb37b";// "9f01263a-eaf7-4d98-a37b-3785f751903e"; + PnfResourceCustomization pnfCustomization = pnfCustomizationRepository.findById(pnfCustomizationKey) + .orElseThrow(() -> new EntityNotFoundException( + "PNF resource customization: " + pnfCustomizationKey + " not found")); + assertEquals("model customizationUUID", pnfCustomizationKey, pnfCustomization.getModelCustomizationUUID()); + assertEquals("model instance name", "VSP_WithPNFD 1", pnfCustomization.getModelInstanceName()); + assertEquals("NF type", "", pnfCustomization.getNfType()); + assertEquals("NF Role", "", pnfCustomization.getNfRole()); + assertEquals("NF function", "", pnfCustomization.getNfFunction()); + assertEquals("NF naming code", "", pnfCustomization.getNfNamingCode()); + assertEquals("PNF resource model UUID", pnfResourceKey, pnfCustomization.getPnfResources().getModelUUID()); + assertEquals("Multi stage design", "", pnfCustomization.getMultiStageDesign()); + assertNull("resource input", pnfCustomization.getResourceInput()); + assertEquals("cds blueprint name(sdnc_model_name property)", "pm_control", + pnfCustomization.getBlueprintName()); + assertEquals("cds blueprint version(sdnc_model_version property)", "1.0.0", + pnfCustomization.getBlueprintVersion()); + assertEquals("default software version", "4.0.0", pnfCustomization.getDefaultSoftwareVersion()); + assertTrue("skip post instantiation configuration", pnfCustomization.isSkipPostInstConf()); + assertEquals("controller actor", "SO-REF-DATA", pnfCustomization.getControllerActor()); + + /** + * Check the pnf resource customization with service mapping + */ + List<PnfResourceCustomization> pnfCustList = service.getPnfCustomizations(); + assertEquals("PNF resource customization entity", 1, pnfCustList.size()); + assertEquals(pnfCustomizationKey, pnfCustList.get(0).getModelCustomizationUUID()); + + /** + * Check the watchdog for component distribution status + */ + List<WatchdogComponentDistributionStatus> distributionList = + watchdogCDStatusRepository.findByDistributionId(this.distributionId); + assertNotNull(distributionList); + assertEquals(1, distributionList.size()); + WatchdogComponentDistributionStatus distributionStatus = distributionList.get(0); + assertEquals("COMPONENT_DONE_OK", distributionStatus.getComponentDistributionStatus()); + assertEquals("SO", distributionStatus.getComponentName()); + + + } catch (Exception e) { + logger.info(e.getMessage(), e); + fail(e.getMessage()); + } + } + + + private ArtifactInfoImpl constructPnfServiceArtifact() { + ArtifactInfoImpl artifactInfo = new ArtifactInfoImpl(); + artifactInfo.setArtifactType(ASDCConfiguration.TOSCA_CSAR); + artifactInfo.setArtifactURL("/download/service-pnfservice.csar"); + artifactInfo.setArtifactName("service-pnfservice.csar"); + artifactInfo.setArtifactVersion("1.0"); + artifactInfo.setArtifactUUID(artifactUuid); + return artifactInfo; + } + + /** + * Construct the PnfResourceInfo based on the resource-Test140Pnf-template.yml from + * service-Testservice140-csar.csar. + */ + private ResourceInfoImpl constructPnfResourceInfo() { + ResourceInfoImpl resourceInfo = new ResourceInfoImpl(); + resourceInfo.setResourceInstanceName("PNF CDS Test"); + resourceInfo.setResourceInvariantUUID("17d9d183-cee5-4a46-b5c4-6d5203f7d2e8"); + resourceInfo.setResoucreType("PNF"); + resourceInfo.setCategory("Application L4+"); + resourceInfo.setSubcategory("Firewall"); + resourceInfo.setResourceUUID("aa5d0562-80e7-43e9-af74-3085e57ab09f"); + resourceInfo.setResourceCustomizationUUID("9f01263a-eaf7-4d98-a37b-3785f751903e"); + resourceInfo.setResourceVersion("1.0"); + return resourceInfo; + } + private ArtifactInfoImpl constructVnfServiceArtifact() { ArtifactInfoImpl artifactInfo = new ArtifactInfoImpl(); artifactInfo.setArtifactType(ASDCConfiguration.TOSCA_CSAR); @@ -505,4 +616,31 @@ public class ASDCControllerITTest extends BaseTest { resourceInfo.setArtifacts(Collections.EMPTY_LIST); return resourceInfo; } + + private ArtifactInfoImpl constructPnfServiceArtifactWithSWV() { + ArtifactInfoImpl artifactInfo = new ArtifactInfoImpl(); + artifactInfo.setArtifactType(ASDCConfiguration.TOSCA_CSAR); + artifactInfo.setArtifactURL("/download/service-Testserviceforpnf-csar.csar");// service-pnfservice.csar"); + artifactInfo.setArtifactName("service-Testserviceforpnf-csar.csar");// "service-pnfservice.csar"); + artifactInfo.setArtifactVersion("1.0"); + artifactInfo.setArtifactUUID(artifactUuid); + return artifactInfo; + } + + /** + * Construct the PnfResourceInfo based on the resource-Test140Pnf-template.yml from + * service-Testservice140-csar.csar. + */ + private ResourceInfoImpl constructPnfResourceInfoWithSWV() { + ResourceInfoImpl resourceInfo = new ResourceInfoImpl(); + resourceInfo.setResourceInstanceName("PNF CDS Test"); + resourceInfo.setResourceInvariantUUID("bf150ca9-b8d3-4450-b50a-d80382a12462");// "17d9d183-cee5-4a46-b5c4-6d5203f7d2e8"); + resourceInfo.setResoucreType("PNF"); + resourceInfo.setCategory("Application L4+"); + resourceInfo.setSubcategory("Firewall"); + resourceInfo.setResourceUUID("72a2c44c-bb8a-4086-824b-0662d40bcd68");// "aa5d0562-80e7-43e9-af74-3085e57ab09f"); + resourceInfo.setResourceCustomizationUUID("96642e60-17cd-48c1-875d-b00b08fdb37b");// "9f01263a-eaf7-4d98-a37b-3785f751903e"); + resourceInfo.setResourceVersion("1.0"); + return resourceInfo; + } } diff --git a/asdc-controller/src/test/resources/download/service-Testserviceforpnf-csar.csar b/asdc-controller/src/test/resources/download/service-Testserviceforpnf-csar.csar Binary files differnew file mode 100644 index 0000000000..d061012e62 --- /dev/null +++ b/asdc-controller/src/test/resources/download/service-Testserviceforpnf-csar.csar diff --git a/asdc-controller/src/test/resources/schema.sql b/asdc-controller/src/test/resources/schema.sql index f94f74da97..1260461b1b 100644 --- a/asdc-controller/src/test/resources/schema.sql +++ b/asdc-controller/src/test/resources/schema.sql @@ -1205,6 +1205,7 @@ CREATE TABLE IF NOT EXISTS `pnf_resource_customization` ( `CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL, `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true, `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL, + `DEFAULT_SOFTWARE_VERSION` varchar(4000) DEFAULT NULL, PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`), KEY `fk_pnf_resource_customization__pnf_resource1_idx` (`PNF_RESOURCE_MODEL_UUID`), CONSTRAINT `fk_pnf_resource_customization__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java index d966528f6c..c18680afae 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/appc/payload/PayloadClient.java @@ -20,23 +20,24 @@ package org.onap.so.bpmn.appc.payload; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import java.util.Optional; +import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersDistributeTraffic; +import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersHealthCheck; import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersQuiesce; import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersResumeTraffic; -import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersDistributeTraffic; import org.onap.so.bpmn.appc.payload.beans.ConfigurationParametersUpgrade; +import org.onap.so.bpmn.appc.payload.beans.DistributeTrafficAction; +import org.onap.so.bpmn.appc.payload.beans.DistributeTrafficCheckAction; import org.onap.so.bpmn.appc.payload.beans.HealthCheckAction; import org.onap.so.bpmn.appc.payload.beans.QuiesceTrafficAction; import org.onap.so.bpmn.appc.payload.beans.RequestParametersHealthCheck; import org.onap.so.bpmn.appc.payload.beans.ResumeTrafficAction; -import org.onap.so.bpmn.appc.payload.beans.DistributeTrafficAction; -import org.onap.so.bpmn.appc.payload.beans.DistributeTrafficCheckAction; import org.onap.so.bpmn.appc.payload.beans.SnapshotAction; import org.onap.so.bpmn.appc.payload.beans.StartStopAction; import org.onap.so.bpmn.appc.payload.beans.UpgradeAction; import org.onap.so.bpmn.core.json.JsonUtils; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; public class PayloadClient { @@ -122,6 +123,12 @@ public class PayloadClient { RequestParametersHealthCheck requestParams = new RequestParametersHealthCheck(); requestParams.setHostIpAddress(vnfHostIpAddress); payloadResult.setRequestParameters(requestParams); + + ConfigurationParametersHealthCheck configurationParametersHealthCheck = + new ConfigurationParametersHealthCheck(); + configurationParametersHealthCheck.setVnfName(vnfName); + payloadResult.setConfigurationParameters(configurationParametersHealthCheck); + return Optional.of((mapper.writeValueAsString(payloadResult))); } 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/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java index 2ecf741869..2e16572069 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/appc/payload/PayloadClientTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP - SO * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,8 @@ public class PayloadClientTest { @Test public void healthCheckFormatTest() throws Exception { - String payloadResult = "{\"request-parameters\":{\"host-ip-address\":\"hostIpAddress1\"}}"; + String payloadResult = + "{\"request-parameters\":{\"host-ip-address\":\"hostIpAddress1\"},\"configuration-parameters\":{\"vnf_name\":\"vnfName1\"}}"; Optional<String> payloadClient = PayloadClient.healthCheckFormat("vnfName1", "hostIpAddress1"); assertEquals(payloadResult, payloadClient.get()); } 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/AnNssmfutils.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy index 1d8de352fb..da9584771c 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy @@ -55,7 +55,7 @@ import org.onap.aai.domain.yang.ServiceInstance import org.onap.aai.domain.yang.SliceProfile import org.onap.aai.domain.yang.SliceProfiles import org.onap.aai.domain.yang.Relationship - +import com.google.gson.Gson class AnNssmfUtils { @@ -193,7 +193,7 @@ public void createSliceProfilesInAai(DelegateExecution execution) { ANNF_sliceProfileInstance.setServiceType(serviceType) String serviceStatus = "deactivated" ANNF_sliceProfileInstance.setOrchestrationStatus(serviceStatus) - String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "pLMNIdList") + String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "plmnIdList") ANNF_sliceProfileInstance.setServiceInstanceLocationId(serviceInstanceLocationid) String serviceRole = "slice-profile-instance" ANNF_sliceProfileInstance.setServiceRole(serviceRole) @@ -213,7 +213,7 @@ public void createSliceProfilesInAai(DelegateExecution execution) { serviceType = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "sST") TNFH_sliceProfileInstance.setServiceType(serviceType) TNFH_sliceProfileInstance.setOrchestrationStatus(serviceStatus) - serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "pLMNIdList") + serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "plmnIdList") TNFH_sliceProfileInstance.setServiceInstanceLocationId(serviceInstanceLocationid) TNFH_sliceProfileInstance.setServiceRole(serviceRole) TNFH_sliceProfileInstance.setEnvironmentContext(snssai) @@ -230,7 +230,7 @@ public void createSliceProfilesInAai(DelegateExecution execution) { serviceType = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "sST") TNMH_sliceProfileInstance.setServiceType(serviceType) TNMH_sliceProfileInstance.setOrchestrationStatus(serviceStatus) - serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "pLMNIdList") + serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "plmnIdList") TNMH_sliceProfileInstance.setServiceInstanceLocationId(serviceInstanceLocationid) TNMH_sliceProfileInstance.setServiceRole(serviceRole) TNMH_sliceProfileInstance.setEnvironmentContext(snssai) @@ -268,7 +268,7 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe Map<String,Object> profile switch(domainType) { case "AN-NF": - profile = objectMapper.readValue(execution.getVariable("ranNfSliceProfile"), Map.class)//pending fields - maxBandwidth, sST, pLMNIdList, cSReliabilityMeanTime, + profile = objectMapper.readValue(execution.getVariable("ranNfSliceProfile"), Map.class)//pending fields - maxBandwidth, sST, plmnIdList, cSReliabilityMeanTime, //msgSizeByte, maxNumberofPDUSessions,overallUserDensity,transferIntervalTarget result.setJitter(profile.get("jitter")) result.setLatency(profile.get("latency")) @@ -286,14 +286,14 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe result.setProfileId(execution.getVariable("ANNF_sliceProfileId")) break case "TN-FH": - profile = objectMapper.readValue(execution.getVariable("tnFhSliceProfile"), Map.class) //pending fields - maxBandwidth, sST, pLMNIdList + profile = objectMapper.readValue(execution.getVariable("tnFhSliceProfile"), Map.class) //pending fields - maxBandwidth, sST, plmnIdList result.setJitter(profile.get("jitter")) result.setLatency(profile.get("latency")) result.setResourceSharingLevel(profile.get("resourceSharingLevel")) result.setProfileId(execution.getVariable("TNFH_sliceProfileId")) break case "TN-MH": - profile = objectMapper.readValue(execution.getVariable("tnMhSliceProfile"), Map.class)//pending fields - maxBandwidth, sST, pLMNIdList + profile = objectMapper.readValue(execution.getVariable("tnMhSliceProfile"), Map.class)//pending fields - maxBandwidth, sST, plmnIdList result.setJitter(profile.get("jitter")) result.setLatency(profile.get("latency")) result.setResourceSharingLevel(profile.get("resourceSharingLevel")) @@ -342,16 +342,17 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe public String buildCreateNSSMFRequest(DelegateExecution execution, String domainType, String action) { JsonObject esrInfo = new JsonObject() - esrInfo.addProperty("networkType", "tn") - esrInfo.addProperty("vendor", "ONAP_internal") + esrInfo.addProperty("networkType", "tn") + esrInfo.addProperty("vendor", "ONAP_internal") JsonObject response = new JsonObject() JsonObject allocateTnNssi = new JsonObject() JsonObject serviceInfo = new JsonObject() JsonArray transportSliceNetworksList = new JsonArray() JsonArray connectionLinksList = new JsonArray() JsonObject connectionLinks = new JsonObject() + Gson jsonConverter = new Gson() if(action.equals("allocate")){ - Map<String, String> endpoints + JsonObject endpoints = new JsonObject() if(domainType.equals("TN_FH")) { serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("TNFH_modelInvariantUuid")) serviceInfo.addProperty("serviceUuid", execution.getVariable("TNFH_modelUuid")) @@ -359,12 +360,10 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe allocateTnNssi.addProperty("nssiName", execution.getVariable("TNFH_modelName")) Map<String,Object> sliceProfile = objectMapper.readValue(execution.getVariable("tnFhSliceProfile"), Map.class) sliceProfile.put("sliceProfileId", execution.getVariable("TNFH_sliceProfileInstanceId")) - String sliceProfileString = objectMapper.writeValueAsString(sliceProfile) - allocateTnNssi.addProperty("sliceProfile", sliceProfileString) - endpoints.put("transportEndpointA", execution.getVariable("tranportEp_ID_RU")) - endpoints.put("transportEndpointB", execution.getVariable("tranportEp_ID_DUIN")) - String endpointsString = objectMapper.writeValueAsString(endpoints) - connectionLinksList.add(endpointsString) + allocateTnNssi.add("sliceProfile", jsonConverter.toJsonTree(sliceProfile)) + endpoints.addProperty("transportEndpointA", execution.getVariable("tranportEp_ID_RU")) + endpoints.addProperty("transportEndpointB", execution.getVariable("tranportEp_ID_DUIN")) + connectionLinksList.add(endpoints) }else if(domainType.equals("TN_MH")) { serviceInfo.addProperty("serviceInvariantUuid", execution.getVariable("TNMH_modelInvariantUuid")) serviceInfo.addProperty("serviceUuid", execution.getVariable("TNMH_modelUuid")) @@ -372,41 +371,32 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe allocateTnNssi.addProperty("nssiName", execution.getVariable("TNMH_modelName")) Map<String,Object> sliceProfile = objectMapper.readValue(execution.getVariable("tnMhSliceProfile"), Map.class) sliceProfile.put("sliceProfileId", execution.getVariable("TNMH_sliceProfileInstanceId")) - String sliceProfileString = objectMapper.writeValueAsString(sliceProfile) - allocateTnNssi.addProperty("sliceProfile", sliceProfileString) - endpoints.put("transportEndpointA", execution.getVariable("tranportEp_ID_DUEG")) - endpoints.put("transportEndpointB", execution.getVariable("tranportEp_ID_CUIN")) - String endpointsString = objectMapper.writeValueAsString(endpoints) - connectionLinksList.add(endpointsString) + allocateTnNssi.add("sliceProfile", jsonConverter.toJsonTree(sliceProfile)) + endpoints.addProperty("transportEndpointA", execution.getVariable("tranportEp_ID_DUEG")) + endpoints.addProperty("transportEndpointB", execution.getVariable("tranportEp_ID_CUIN")) + connectionLinksList.add(endpoints) } //Connection links connectionLinks.add("connectionLinks", connectionLinksList) transportSliceNetworksList.add(connectionLinks) allocateTnNssi.add("transportSliceNetworks", transportSliceNetworksList) - allocateTnNssi.addProperty("nssiId", null) - serviceInfo.addProperty("nssiId", null) }else if(action.equals("modify-allocate")) { if(domainType.equals("TN_FH")) { - serviceInfo.addProperty("serviceInvariantUuid", null) - serviceInfo.addProperty("serviceUuid", null) - allocateTnNssi.addProperty("nsstId", null) allocateTnNssi.addProperty("nssiName", execution.getVariable("TNFH_nssiName")) allocateTnNssi.addProperty("sliceProfileId", execution.getVariable("TNFH_sliceProfileInstanceId")) allocateTnNssi.addProperty("nssiId", execution.getVariable("TNFH_NSSI")) serviceInfo.addProperty("nssiId", execution.getVariable("TNFH_NSSI")) }else if(domainType.equals("TN_MH")) { - serviceInfo.addProperty("serviceInvariantUuid", null) - serviceInfo.addProperty("serviceUuid", null) - allocateTnNssi.addProperty("nsstId", null) allocateTnNssi.addProperty("nssiName", execution.getVariable("TNMH_nssiName")) allocateTnNssi.addProperty("sliceProfileId", execution.getVariable("TNMH_sliceProfileInstanceId")) allocateTnNssi.addProperty("nssiId", execution.getVariable("TNMH_NSSI")) serviceInfo.addProperty("nssiId", execution.getVariable("TNMH_NSSI")) } } + JsonParser parser = new JsonParser() String nsiInfo = jsonUtil.getJsonValue(execution.getVariable("sliceParams"), "nsiInfo") - allocateTnNssi.addProperty("nsiInfo", nsiInfo) + allocateTnNssi.add("nsiInfo",(JsonObject) parser.parse(nsiInfo)) allocateTnNssi.addProperty("scriptName", "TN1") serviceInfo.addProperty("nsiId", execution.getVariable("nsiId")) serviceInfo.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId")) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy index 05996d3671..37e3df1505 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy @@ -142,20 +142,15 @@ public class DoActivateTnNssi extends AbstractServiceTaskProcessor { String status, String progress, String statusDescription) { - String serviceId = execution.getVariable("sliceServiceInstanceId") + String ssInstanceId = execution.getVariable("sliceServiceInstanceId") + String modelUuid = execution.getVariable("modelUuid") String jobId = execution.getVariable("jobId") String nsiId = execution.getVariable("nsiId") String operType = execution.getVariable("actionType") + ResourceOperationStatus roStatus = tnNssmfUtils.buildRoStatus(modelUuid, ssInstanceId, + jobId, nsiId, operType, status, progress, statusDescription) - ResourceOperationStatus roStatus = new ResourceOperationStatus() - roStatus.setServiceId(serviceId) - roStatus.setOperationId(jobId) - roStatus.setResourceTemplateUUID(nsiId) - roStatus.setOperType(operType) - roStatus.setProgress(progress) - roStatus.setStatus(status) - roStatus.setStatusDescription(statusDescription) requestDBUtil.prepareUpdateResourceOperationStatus(execution, roStatus) } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy index e1719aa5d6..33724bd011 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy @@ -34,6 +34,7 @@ import org.slf4j.LoggerFactory import java.util.List import static org.apache.commons.lang3.StringUtils.isBlank import com.google.gson.JsonObject +import com.google.gson.Gson import com.fasterxml.jackson.databind.ObjectMapper import com.google.gson.JsonArray import com.google.gson.JsonParser @@ -98,8 +99,8 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { execution.setVariable("sliceProfile", sliceProfile) } String sliceProfileId = jsonUtil.getJsonValue(sliceProfile, "sliceProfileId") - def snssaiList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "sNSSAI")) - def plmnIdList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "pLMNIdList")) + def snssaiList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "snssaiList")) + def plmnIdList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "plmnIdList")) def coverageAreaTAList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "coverageAreaTAList")) if (isBlank(sliceProfileId) || (snssaiList.empty) || (plmnIdList.empty) @@ -577,7 +578,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { def createSdnrRequest = { DelegateExecution execution -> logger.debug(Prefix+"createSdnrRequest method start") String callbackUrl = UrnPropertiesReader.getVariable("mso.workflow.message.endpoint") + "/AsyncSdnrResponse/"+execution.getVariable("msoRequestId") - String sdnrRequest = buildSdnrAllocateRequest(execution, "allocate", "InstantiateRANSlice", callbackUrl) + String sdnrRequest = buildSdnrAllocateRequest(execution, "allocate", "instantiateRANSlice", callbackUrl) execution.setVariable("createNSSI_sdnrRequest", sdnrRequest) execution.setVariable("createNSSI_timeout", "PT10M") execution.setVariable("createNSSI_correlator", execution.getVariable("msoRequestId")) @@ -697,12 +698,12 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { } def createFhAllocateNssiJobQuery = { DelegateExecution execution -> - logger.debug(Prefix+"createModifyNssiQueryJobStatus method start") + logger.debug(Prefix+"createFhAllocateNssiJobQuery method start") createTnAllocateNssiJobQuery(execution, "TN_FH") } def createMhAllocateNssiJobQuery = { DelegateExecution execution -> - logger.debug(Prefix+"createModifyNssiQueryJobStatus method start") + logger.debug(Prefix+"createMhAllocateNssiJobQuery method start") createTnAllocateNssiJobQuery(execution, "TN_MH") } @@ -712,7 +713,6 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { esrInfo.addProperty("vendor", "ONAP_internal") execution.setVariable("esrInfo", esrInfo.toString()) JsonObject serviceInfo = new JsonObject() - serviceInfo.addProperty("nssiId", null) serviceInfo.addProperty("nsiId", execution.getVariable("nsiId")) String sST = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "sST") serviceInfo.addProperty("sST", sST) @@ -736,14 +736,14 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { logger.debug(Prefix+"processJobStatusRsp method start") String jobResponse = execution.getVariable("TNFH_jobResponse") logger.debug("Job status response "+jobResponse) - String status = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.status") - String nssi = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.nssi") + String status = jsonUtil.getJsonValue(jobResponse, "status") + String nssi = jsonUtil.getJsonValue(jobResponse, "nssiId") if(status.equalsIgnoreCase("finished")) { execution.setVariable("TNFH_NSSI", nssi) logger.debug("Job successfully completed ... proceeding with flow for nssi : "+nssi) } else { - String statusDescription = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.statusDescription") + String statusDescription = jsonUtil.getJsonValue(jobResponse, "statusDescription") logger.error("received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription) exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription) } @@ -753,14 +753,14 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { logger.debug(Prefix+"processJobStatusRsp method start") String jobResponse = execution.getVariable("TNMH_jobResponse") logger.debug("Job status response "+jobResponse) - String status = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.status") - String nssi = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.nssi") + String status = jsonUtil.getJsonValue(jobResponse, "status") + String nssi = jsonUtil.getJsonValue(jobResponse, "nssiId") if(status.equalsIgnoreCase("finished")) { execution.setVariable("TNMH_NSSI", nssi) logger.debug("Job successfully completed ... proceeding with flow for nssi : "+nssi) } else { - String statusDescription = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.statusDescription") + String statusDescription = jsonUtil.getJsonValue(jobResponse, "statusDescription") logger.error("received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription) exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription) } @@ -770,13 +770,13 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { logger.debug(Prefix+"processJobStatusRsp method start") String jobResponse = execution.getVariable("jobResponse") logger.debug("Job status response "+jobResponse) - String status = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.status") - String nssi = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.nssi") + String status = jsonUtil.getJsonValue(jobResponse, "status") + String nssi = jsonUtil.getJsonValue(jobResponse, "nssiId") if(status.equalsIgnoreCase("finished")) { logger.debug("Job successfully completed ... proceeding with flow for nssi : "+nssi) } else { - String statusDescription = jsonUtil.getJsonValue(jobResponse, "responseDescriptor.statusDescription") + String statusDescription = jsonUtil.getJsonValue(jobResponse, "statusDescription") logger.error("received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription) exceptionUtil.buildAndThrowWorkflowException(execution, 7000,"received failed status from job status query for nssi : "+nssi+" with status description : "+ statusDescription) } @@ -899,29 +899,30 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { sliceProfile.put("maxNumberofConns", sliceProfile.get("maxNumberofPDUSessions")) sliceProfile.put("uLThptPerSlice", sliceProfile.get("expDataRateUL")) sliceProfile.put("dLThptPerSlice", sliceProfile.get("expDataRateDL")) - String sliceProfileString = objectMapper.writeValueAsString(sliceProfile) + JsonObject response = new JsonObject() JsonObject body = new JsonObject() JsonObject input = new JsonObject() JsonObject commonHeader = new JsonObject() JsonObject payload = new JsonObject() JsonObject payloadInput = new JsonObject() - commonHeader.addProperty("TimeStamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss", TimeZone.getDefault())) - commonHeader.addProperty("APIver", "1.0") - commonHeader.addProperty("RequestID", requestId) - commonHeader.addProperty("SubRequestID", "1") - commonHeader.add("RequestTrack", new JsonObject()) - commonHeader.add("Flags", new JsonObject()) - payloadInput.addProperty("sliceProfile", sliceProfileString) + commonHeader.addProperty("TimeStamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", TimeZone.getDefault())) + commonHeader.addProperty("api-ver", "1.0") + commonHeader.addProperty("request-id", requestId) + commonHeader.addProperty("sub-request-id", "1") + commonHeader.add("request-track", new JsonObject()) + commonHeader.add("flags", new JsonObject()) + Gson jsonConverter = new Gson() + payloadInput.add("sliceProfile", jsonConverter.toJsonTree(sliceProfile)) payloadInput.addProperty("RANNSSIId", execution.getVariable("RANServiceInstanceId")) payloadInput.addProperty("NSIID", execution.getVariable("nsiId")) payloadInput.addProperty("RANNFNSSIId", execution.getVariable("RANNFServiceInstanceId")) payloadInput.addProperty("callbackURL", callbackUrl) payloadInput.add("additionalproperties", new JsonObject()) payload.add("input", payloadInput) - input.add("CommonHeader", commonHeader) - input.addProperty("Action", action) - input.addProperty("Payload", payload.toString()) + input.add("common-header", commonHeader) + input.addProperty("action", action) + input.addProperty("payload", payload.toString()) body.add("input", input) response.add("body", body) response.addProperty("version", "1.0") 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 4eb70a5302..0b028e6c13 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 @@ -34,6 +34,8 @@ import org.onap.so.bpmn.core.json.JsonUtils import org.slf4j.Logger import org.slf4j.LoggerFactory +import static org.apache.commons.lang3.StringUtils.isBlank + class DoCreateTnNssiInstance extends AbstractServiceTaskProcessor { private static final Logger logger = LoggerFactory.getLogger(DoCreateTnNssiInstance.class); @@ -109,15 +111,18 @@ class DoCreateTnNssiInstance extends AbstractServiceTaskProcessor { org.onap.aai.domain.yang.ServiceInstance ss = new org.onap.aai.domain.yang.ServiceInstance() ss.setServiceInstanceId(ssInstanceId) String sliceInstanceName = execution.getVariable("sliceServiceInstanceName") + if (isBlank(sliceInstanceName)) { + logger.error("ERROR: createServiceInstance: sliceInstanceName is null") + sliceInstanceName = ssInstanceId + } ss.setServiceInstanceName(sliceInstanceName) ss.setServiceType(serviceType) - String serviceStatus = "activated" + String serviceStatus = "deactivated" ss.setOrchestrationStatus(serviceStatus) String modelInvariantUuid = execution.getVariable("modelInvariantUuid") String modelUuid = execution.getVariable("modelUuid") - //TODO: need valid model ID from the caller, as AAI does not accept invalid IDs - //ss.setModelInvariantId(modelInvariantUuid) - //ss.setModelVersionId(modelUuid) + ss.setModelInvariantId(modelInvariantUuid) + ss.setModelVersionId(modelUuid) String serviceInstanceLocationid = tnNssmfUtils.getFirstPlmnIdFromSliceProfile(sliceProfileStr) ss.setServiceInstanceLocationId(serviceInstanceLocationid) String snssai = tnNssmfUtils.getFirstSnssaiFromSliceProfile(sliceProfileStr) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy index c817eaad61..a8622b9253 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy @@ -25,7 +25,6 @@ import groovy.json.JsonSlurper import org.camunda.bpm.engine.delegate.BpmnError import org.camunda.bpm.engine.delegate.DelegateExecution import org.onap.aai.domain.yang.ServiceInstance -import org.onap.aaiclient.client.aai.AAIObjectType import org.onap.aaiclient.client.aai.AAIResourcesClient import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory @@ -150,18 +149,15 @@ class DoDeallocateTnNssi extends AbstractServiceTaskProcessor { String status, String progress, String statusDescription) { - String serviceId = execution.getVariable("sliceServiceInstanceId") + String ssInstanceId = execution.getVariable("sliceServiceInstanceId") + String modelUuid = execution.getVariable("modelUuid") String jobId = execution.getVariable("jobId") String nsiId = execution.getVariable("nsiId") - ResourceOperationStatus roStatus = new ResourceOperationStatus() - roStatus.setServiceId(serviceId) - roStatus.setOperationId(jobId) - roStatus.setResourceTemplateUUID(nsiId) - roStatus.setOperType("Deallocate") - roStatus.setProgress(progress) - roStatus.setStatus(status) - roStatus.setStatusDescription(statusDescription) + ResourceOperationStatus roStatus = tnNssmfUtils.buildRoStatus(modelUuid, ssInstanceId, + jobId, nsiId, "deallocate", status, progress, statusDescription) + + logger.debug("DoDeallocateTnNssi: roStatus={}", roStatus) requestDBUtil.prepareUpdateResourceOperationStatus(execution, roStatus) } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy index 88db2161f7..deeec94b74 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy @@ -72,7 +72,7 @@ class TnAllocateNssi extends AbstractServiceTaskProcessor { String additionalPropJsonStr = execution.getVariable("sliceParams") - String tnNssiId = execution.getVariable("serviceInstanceID") + String tnNssiId = jsonUtil.getJsonValue(additionalPropJsonStr, "serviceInstanceID") //for debug if (isBlank(tnNssiId)) { tnNssiId = UUID.randomUUID().toString() } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy index d97f416db9..cfee1aa0cf 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy @@ -32,6 +32,7 @@ import org.onap.so.bpmn.core.RollbackData import org.onap.so.bpmn.core.UrnPropertiesReader import org.onap.so.bpmn.core.WorkflowException import org.onap.so.bpmn.core.json.JsonUtils +import org.onap.so.db.request.beans.ResourceOperationStatus import org.slf4j.Logger import org.slf4j.LoggerFactory @@ -122,7 +123,7 @@ class TnNssmfUtils { } String sdncRequest = - """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1" + """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1" xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1" xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1"> <sdncadapter:RequestHeader> @@ -332,4 +333,25 @@ class TnNssmfUtils { createRelationShipInAAI(execution, aaiResourceUri, relationship) } + + ResourceOperationStatus buildRoStatus(String nsstId, + String nssiId, + String jobId, + String nsiId, + String action, + String status, + String progress, + String statusDescription) { + ResourceOperationStatus roStatus = new ResourceOperationStatus() + roStatus.setResourceTemplateUUID(nsstId) + roStatus.setResourceInstanceID(nssiId) + roStatus.setServiceId(nsiId) + roStatus.setOperationId(jobId) + roStatus.setOperType(action) + roStatus.setProgress(progress) + roStatus.setStatus(status) + roStatus.setStatusDescription(statusDescription) + + return roStatus + } } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ServiceLevelUpgrade.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ServiceLevelUpgrade.bpmn index 8ff1a1efec..a12d8fef34 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ServiceLevelUpgrade.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ServiceLevelUpgrade.bpmn @@ -415,4 +415,4 @@ pnfSwUpgrade.prepareFalloutHandler(execution)</bpmn:script> </bpmndi:BPMNShape> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> -</bpmn:definitions> +</bpmn:definitions>
\ No newline at end of file diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn index 9c12200657..9b449013b1 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateAccessNSSI.bpmn @@ -193,7 +193,7 @@ nss.prepareDecomposeService(execution)</bpmn:script> <camunda:in source="esrInfo" target="esrInfo" /> <camunda:in source="serviceInfo" target="serviceInfo" /> <camunda:in source="TNFH_jobId" target="jobId" /> - <camunda:out source="jobResponse" target="TNFH_jobResponse" /> + <camunda:out source="responseDescriptor" target="TNFH_jobResponse" /> <camunda:in source="responseId" target="responseId" /> <camunda:in source="job_timeout" target="timeout" /> </bpmn:extensionElements> @@ -206,7 +206,7 @@ nss.prepareDecomposeService(execution)</bpmn:script> <camunda:in source="esrInfo" target="esrInfo" /> <camunda:in source="serviceInfo" target="serviceInfo" /> <camunda:in source="TNMH_jobId" target="jobId" /> - <camunda:out source="jobResponse" target="TNMH_jobResponse" /> + <camunda:out source="responseDescriptor" target="TNMH_jobResponse" /> <camunda:in source="responseId" target="responseId" /> <camunda:in source="job_timeout" target="timeout" /> </bpmn:extensionElements> @@ -318,7 +318,7 @@ nss.prepareModifyAccessNssiInputs(execution)</bpmn:script> <camunda:in source="esrInfo" target="esrInfo" /> <camunda:in source="serviceInfo" target="serviceInfo" /> <camunda:in source="modifyRanNssiJobId" target="jobId" /> - <camunda:out source="jobResponse" target="jobResponse" /> + <camunda:out source="responseDescriptor" target="jobResponse" /> <camunda:in source="responseId" target="responseId" /> <camunda:in source="job_timeout" target="timeout" /> </bpmn:extensionElements> @@ -435,7 +435,7 @@ nss.updateAaiWithRANInstances(execution)</bpmn:script> <bpmn:sequenceFlow id="Flow_1exjm0h" sourceRef="Activity_0pa8al6" targetRef="Event_15zn4zi" /> <bpmn:sequenceFlow id="Flow_0bd6dhi" sourceRef="Activity_0zn4e4n" targetRef="Activity_0vf28ld" /> <bpmn:sequenceFlow id="Flow_0kcvava" sourceRef="Activity_0vf28ld" targetRef="Event_0u9308h" /> - <bpmn:scriptTask id="Activity_0vf28ld" name="update AAI relationships"> + <bpmn:scriptTask id="Activity_0vf28ld" name="update AAI relationships" scriptFormat="groovy"> <bpmn:incoming>Flow_0bd6dhi</bpmn:incoming> <bpmn:outgoing>Flow_0kcvava</bpmn:outgoing> <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn index 4f83c872a1..f3bd700d9a 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn @@ -164,7 +164,7 @@ css.prepareOofSelection(execution)</bpmn:script> <bpmn:incoming>SequenceFlow_0n4xku8</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0kixzdj</bpmn:outgoing> <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* -execution.setVariable("orchestrationStatus", "activated") +execution.setVariable("orchestrationStatus", "deactivated") def runScript = new TnAllocateNssi() runScript.updateAAIOrchStatus(execution)</bpmn:script> </bpmn:scriptTask> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn index bd759caffd..9dbc9909fc 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn @@ -29,7 +29,7 @@ ex.processJavaException(execution)</bpmn:script> <bpmn:incoming>SequenceFlow_1jygjln</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1qv8qw1</bpmn:outgoing> <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* -def runScript = new TnAllocateNssi() +def runScript = new DoDeallocateTnNssi() runScript.prepareUpdateJobStatus(execution,"finished","100","Deallocated TN NSSI successfully")</bpmn:script> </bpmn:scriptTask> <bpmn:sequenceFlow id="SequenceFlow_03s744c" sourceRef="StartEvent_1nbljfd" targetRef="ScriptTask_1tc44ge" /> 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/docs/release-notes.rst b/docs/release-notes.rst index c1635fc532..de12fc439c 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -190,6 +190,9 @@ 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. +* `SO-3414 <https://jira.onap.org/browse/SO-SO-3414>`_ - Search Query does not contain get model data for vFW closed loop. + **Upgrade Notes** diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql index fd8c273b57..11f2d4b2c3 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/schema.sql @@ -1200,6 +1200,7 @@ CREATE TABLE IF NOT EXISTS `pnf_resource_customization` ( `CDS_BLUEPRINT_NAME` varchar(200) DEFAULT NULL, `CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL, `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL, + `DEFAULT_SOFTWARE_VERSION` varchar(4000) DEFAULT NULL, PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`), KEY `fk_pnf_resource_customization__pnf_resource1_idx` (`PNF_RESOURCE_MODEL_UUID`), CONSTRAINT `fk_pnf_resource_customization__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java index 2e4623d25d..122a20fea9 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java @@ -88,6 +88,9 @@ public class PnfResourceCustomization implements Serializable { @Column(name = "CONTROLLER_ACTOR") private String controllerActor; + @Column(name = "DEFAULT_SOFTWARE_VERSION") + private String defaultSoftwareVersion; + @Override public String toString() { return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) @@ -95,7 +98,8 @@ public class PnfResourceCustomization implements Serializable { .append("nfFunction", nfFunction).append("nfType", nfType).append("nfRole", nfRole) .append("nfNamingCode", nfNamingCode).append("multiStageDesign", multiStageDesign) .append("pnfResources", pnfResources).append("blueprintName", blueprintName) - .append("blueprintVersion", blueprintVersion).append("controllerActor", controllerActor).toString(); + .append("blueprintVersion", blueprintVersion).append("controllerActor", controllerActor) + .append("defaultSoftwareVersion", defaultSoftwareVersion).toString(); } @Override @@ -234,4 +238,12 @@ public class PnfResourceCustomization implements Serializable { public void setControllerActor(String controllerActor) { this.controllerActor = controllerActor; } + + public String getDefaultSoftwareVersion() { + return defaultSoftwareVersion; + } + + public void setDefaultSoftwareVersion(String defaultSoftwareVersion) { + this.defaultSoftwareVersion = defaultSoftwareVersion; + } } diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql index 68f272cca0..335c49ee8a 100644 --- a/mso-catalog-db/src/test/resources/schema.sql +++ b/mso-catalog-db/src/test/resources/schema.sql @@ -1204,6 +1204,7 @@ CREATE TABLE IF NOT EXISTS `pnf_resource_customization` ( `CDS_BLUEPRINT_VERSION` varchar(20) DEFAULT NULL, `SKIP_POST_INSTANTIATION_CONFIGURATION` boolean default true, `CONTROLLER_ACTOR` varchar(200) DEFAULT NULL, + `DEFAULT_SOFTWARE_VERSION` varchar(4000) DEFAULT NULL, PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`), KEY `fk_pnf_resource_customization__pnf_resource1_idx` (`PNF_RESOURCE_MODEL_UUID`), CONSTRAINT `fk_pnf_resource_customization__pnf_resource1` FOREIGN KEY (`PNF_RESOURCE_MODEL_UUID`) REFERENCES `pnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE 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} |