aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/audit/beans/AuditInventory.java36
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java9
-rw-r--r--adapters/mso-adapter-utils/src/main/resources/application-local.yaml64
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryGroups.java3
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml35
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql4
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java15
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java5
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDataService.java77
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java37
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java71
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java13
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java34
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java52
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java16
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java26
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java6
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java47
-rw-r--r--adapters/mso-openstack-adapters/src/main/resources/application-local.yaml105
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditDataServiceTest.java101
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java25
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java73
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/vfModule.json38
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java23
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml51
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.2__Expand_Column_Size_Infra_Active_Requests_Request_Status.sql3
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.3__Expand_Column_Size_Archived_Infra_Active_Requests_Request_Status.sql3
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java4
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java4
-rw-r--r--adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml133
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/HealthCheckHandler.java4
-rw-r--r--adapters/mso-vfc-adapter/src/main/resources/application-local.yaml34
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml18
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/SdcPackageProvider.java3
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java8
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java53
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java2
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java2
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml6
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/org.onap.so.trust.jksbin0 -> 1413 bytes
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java25
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/Application.java6
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/JerseyConfiguration.java12
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java30
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/ArtifactInfoImpl.java6
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java91
-rw-r--r--asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java115
-rw-r--r--asdc-controller/src/main/resources/application-local.yaml95
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java3
-rw-r--r--asdc-controller/src/test/resources/resource-examples/vcpe-infra/service-Demovcpeinfra-csar.csarbin115651 -> 115053 bytes
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy11
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy43
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/PostCompletionRequestsDbListener.java33
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/RequestsDbListenerRunner.java65
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java171
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java21
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java56
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java91
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/InstnaceResourceListTest.java76
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDayUnitTest.java129
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java30
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderTest.java1
-rw-r--r--bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderUnitTest.java98
-rw-r--r--bpmn/MSOCommonBPMN/src/test/resources/__files/InstanceResourceList/InstanceResourceList.json26
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java27
-rw-r--r--bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/RollbackData.java2
-rw-r--r--bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/xml/XmlToolTest.java2
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java32
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java3
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java2
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java2
-rw-r--r--bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/BPMNUtil.java3
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteVfModuleBB.bpmn393
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/ExecuteBuildingBlock.bpmn134
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/HomingBB.bpmn1
-rw-r--r--bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn205
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java5
-rw-r--r--bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java27
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy90
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy94
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy366
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy58
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy21
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy124
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy108
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy52
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy42
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy1
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java2
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java256
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/resources/application.properties3
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactoryTest.java20
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeActivateSDNCNetworkResource.bpmn72
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteSDNCNetworkResource.bpmn105
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn206
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn174
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn5
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java16
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java37
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java1
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java11
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/namingservice/tasks/NamingServiceCreateTasks.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/AbstractSDNCTask.java22
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasks.java14
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java13
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java29
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java21
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java17
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java22
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java20
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java5
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java18
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java4
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java26
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java34
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java22
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java2
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java59
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java9
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/audit/AuditTasksTest.java34
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/namingservice/tasks/NamingServiceCreateTasksTest.java26
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTaskTest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasksTest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasksTest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTaskTest.java12
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java73
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java3
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java20
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java54
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java (renamed from bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipTest.java)19
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVfModuleResourcesTest.java8
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVnfResourcesTest.java57
-rw-r--r--bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java11
-rw-r--r--common/src/main/java/org/onap/so/client/HttpClient.java12
-rw-r--r--common/src/main/java/org/onap/so/utils/TargetEntities.java25
-rw-r--r--common/src/main/java/org/onap/so/utils/TargetEntity.java8
-rw-r--r--docs/installconfigure/Configure_git_and_gerrit.rst6
-rw-r--r--docs/installconfigure/Install_Docker.rst6
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ContactCamundaException.java8
-rw-r--r--mso-api-handlers/mso-api-handler-infra/pom.xml4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java180
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java72
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java8
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java13
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java27
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java49
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java26
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/e2eserviceinstancebeans/E2EService.java11
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java6
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java6
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java6
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java6
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java6
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java17
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java5
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironment.java2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/resources/application-local.yaml179
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/resources/application.yaml4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerTest.java327
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java17
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java105
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java5
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java13
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/ActivityInstanceHistoryResponse.json48
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json2
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/ProcessInstanceHistoryResponse.json44
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/pom.xml1
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java21
-rw-r--r--mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java7
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java25
-rw-r--r--mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java35
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java5
-rw-r--r--readme.md173
-rw-r--r--so-monitoring/readme.md35
-rw-r--r--so-monitoring/so-monitoring-service/pom.xml4
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java35
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java9
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java39
-rw-r--r--so-monitoring/so-monitoring-service/src/main/resources/application.yaml7
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/README.md9
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts12
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts18
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts46
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts50
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts43
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts2
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts45
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html43
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts108
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts81
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html63
-rw-r--r--so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts5
-rw-r--r--vnfm-simulator/vnfm-service/pom.xml18
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java10
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java2
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/VnfmHelper.java6
-rw-r--r--vnfm-simulator/vnfm-service/src/main/resources/application.yaml7
-rw-r--r--vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12bin0 -> 4079 bytes
-rw-r--r--vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/VnfmHelperTest.java104
205 files changed, 5534 insertions, 2706 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/audit/beans/AuditInventory.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/audit/beans/AuditInventory.java
index 7e612b3b41..eff32cf826 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/audit/beans/AuditInventory.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/audit/beans/AuditInventory.java
@@ -7,9 +7,9 @@
* 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.
@@ -25,18 +25,24 @@ import java.io.Serializable;
public class AuditInventory implements Serializable {
/**
- *
+ *
*/
private static final long serialVersionUID = 4937350343452380760L;
+ private String msoRequestId;
+
private String cloudRegion;
private String cloudOwner;
private String tenantId;
+ private String vfModuleId;
+
private String heatStackName;
+ private String genericVnfId;
+
public String getCloudRegion() {
return cloudRegion;
}
@@ -69,6 +75,30 @@ public class AuditInventory implements Serializable {
this.heatStackName = heatStackName;
}
+ public String getGenericVnfId() {
+ return genericVnfId;
+ }
+
+ public void setGenericVnfId(String genericVnfId) {
+ this.genericVnfId = genericVnfId;
+ }
+
+ public String getVfModuleId() {
+ return vfModuleId;
+ }
+
+ public void setVfModuleId(String vfModuleId) {
+ this.vfModuleId = vfModuleId;
+ }
+
+ public String getMsoRequestId() {
+ return msoRequestId;
+ }
+
+ public void setMsoRequestId(String msoRequestId) {
+ this.msoRequestId = msoRequestId;
+ }
+
}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
index 723bed17f7..8cacf8526a 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
@@ -58,9 +58,12 @@ public class MsoHeatEnvironmentEntry {
return;
byte[] b = this.rawEntry.toString().getBytes();
MsoYamlEditorWithEnvt yaml = new MsoYamlEditorWithEnvt(b);
- this.parameters = yaml.getParameterListFromEnvt();
- // this.resources = yaml.getResourceListFromEnvt();
- StringBuilder sb = this.getResourceRegistryRawEntry();
+ StringBuilder sb = null;
+ if (yaml != null) {
+ this.parameters = yaml.getParameterListFromEnvt();
+ // this.resources = yaml.getResourceListFromEnvt();
+ sb = this.getResourceRegistryRawEntry();
+ }
if (sb == null) {
this.resourceRegistryEntryRaw = new StringBuilder("");
} else {
diff --git a/adapters/mso-adapter-utils/src/main/resources/application-local.yaml b/adapters/mso-adapter-utils/src/main/resources/application-local.yaml
deleted file mode 100644
index 5fc2144bd6..0000000000
--- a/adapters/mso-adapter-utils/src/main/resources/application-local.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-# will be used as entry in DB to say SITE OFF/ON for healthcheck
-# MSO Properties go here
-mso:
- catalog:
- db:
- spring:
- endpoint: "http://localhost:8080"
- db:
- auth: Basic YnBlbDptc28tZGItMTUwNyE=
-cloud_config:
- identity_services:
- MT_KEYSTONE:
- identity_url: "http://localhost:5000/v2.0"
- mso_id: "john"
- mso_pass: "313DECE408AF7759D442D7B06DD9A6AA"
- admin_tenant: "admin"
- member_role: "_member_"
- tenant_metadata: false
- identity_server_type: "KEYSTONE"
- identity_authentication_type: "USERNAME_PASSWORD"
- DAN_KEYSTONE:
- identity_url: "http://192.168.170.21:5000/v2.0"
- mso_id: "jc1348"
- mso_pass: "313DECE408AF7759D442D7B06DD9A6AA"
- admin_tenant: "service"
- member_role: "_member_"
- tenant_metadata: false
- identity_server_type: "KEYSTONE"
- identity_authentication_type: "USERNAME_PASSWORD"
- cloud_sites:
- regionOne:
- region_id: "regionOne"
- clli: "MT2"
- aic_version: "2.5"
- identity_service_id: "MT_KEYSTONE"
- DAN:
- region_id: "RegionOne"
- clli: "MT"
- aic_version: "2.5"
- identity_service_id: "DAN_KEYSTONE"
- DEFAULT:
- region_id: ""
- clli: "MTN6"
- aic_version: "3.0"
- identity_service_id: "ORDM3"
-adapters:
- po:
- retryCodes: "504"
- retryDelay: "5"
- retryCount: "3"
- tenant:
- tenant_description: "ECOMP Tenant"
- region_type: "single"
- user_role: "admin"
- success_status_string: "Success"
- no_regions_status_string: "no regions"
- orm_request_path: "/v1/orm/customers/"
- x_aic_orm_client_string: "ECOMP-MSO"
- keystone_url_version: "/v2.0"
- keystone_reg_ex: "/[vV][0-9]"
- orm_url_replace_this: "8080"
- orm_url_replace_with_this: "7080"
- quota_value: "10"
- set_default_quota: "false"
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryGroups.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryGroups.java
index facdd2f4ca..ed2526f400 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryGroups.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/catalogrest/QueryGroups.java
@@ -3,6 +3,8 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2019 Huawei Intellectual Property. All rights reserved.
+ *
+ * Copyright (C) 2019 IBM.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +23,6 @@
package org.onap.so.adapters.catalogdb.catalogrest;
import org.onap.so.db.catalog.beans.InstanceGroup;
-import org.onap.so.db.catalog.beans.VFCInstanceGroup;
import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml b/adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml
deleted file mode 100644
index d7c13eaa14..0000000000
--- a/adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-catalog:
- db:
- endpoint: http://localhost:8090
-
-ssl-enable: false
-mso:
- site-name: localDevEnv
- logPath: logs
- catalog:
- db:
- spring:
- endpoint: http://localhost:8090
- db:
- auth: Basic YnBlbDptc28tZGItMTUwNyE=
-spring:
- security:
- usercredentials:
- -
- username: test
- password: '$2a$12$Zi3AuYcZoZO/gBQyUtST2.F5N6HqcTtaNci2Et.ufsQhski56srIu'
- role: BPEL-Client
- -
- username: bpel
- password: '$2a$12$1xyutEZNfjGewIZRfKaE8eZE99f5sYFUmmM80BobI65KNjmcK0JuO'
- role: BPEL-Client
- -
- username: mso_admin
- password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
- role: ACTUATOR
-
-server:
- port: 8090
-
-
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql
index 3f76334bd9..137f73cf65 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__WorkflowDesignerData.sql
@@ -201,5 +201,5 @@ VALUES
INSERT INTO `workflow` (`ARTIFACT_UUID`,`ARTIFACT_NAME`,`NAME`,`OPERATION_NAME`,`VERSION`,`DESCRIPTION`,`RESOURCE_TARGET`,`SOURCE`)
VALUES
('9d45cd30-1a89-4993-87c1-6dd09c1696cf','VFModule-ScaleOut','VNF Scale Out','ScaleOut',1.0,'native static workflow to support ScaleOut','vfModule','native'),
-('da6478e4-ea33-3346-ac12-ab121284a333','VnfInPlaceUpdate.bpmn','VNF In Place Software Update','inPlaceSoftwareUpdate',1.0,'native static workflow to support inPlaceSoftwareUpdate','vnf','native'),
-('fdb3ac48-70f9-4584-bd92-253bdbdec1e1','VnfConfigUpdate.bpmn','VNF Config Update','applyConfigModify',1.0,'native static workflow to support applyConfigModify','vnf','native'); \ No newline at end of file
+('da6478e4-ea33-3346-ac12-ab121284a333','VnfInPlaceUpdate.bpmn','VnfInPlaceUpdate','inPlaceSoftwareUpdate',1.0,'native static workflow to support inPlaceSoftwareUpdate','vnf','native'),
+('fdb3ac48-70f9-4584-bd92-253bdbdec1e1','VnfConfigUpdate.bpmn','VnfConfigUpdate','applyConfigModify',1.0,'native static workflow to support applyConfigModify','vnf','native');
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java
index 5060e554eb..8edce124ec 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java
@@ -43,6 +43,8 @@ public abstract class AbstractAuditService {
protected static final String UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI =
"Unable to find all VServers and L-Interaces in A&AI";
+ protected static final String UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK = "Unable to find VServers in Openstack";
+
@Autowired
public Environment env;
@@ -68,12 +70,12 @@ public abstract class AbstractAuditService {
* @param auditList
* @return
*/
- protected boolean didDeleteAuditFail(Optional<AAIObjectAuditList> auditList) {
- if (auditList.get().getAuditList() != null && !auditList.get().getAuditList().isEmpty()) {
+ protected boolean didDeleteAuditFail(AAIObjectAuditList auditList) {
+ if (auditList.getAuditList() != null && !auditList.getAuditList().isEmpty()) {
if (logger.isInfoEnabled()) {
- logger.info("Audit Results: {}", auditList.get().toString());
+ logger.info("Audit Results: {}", auditList.toString());
}
- return auditList.get().getAuditList().stream().filter(AAIObjectAudit::isDoesObjectExist).findFirst()
+ return auditList.getAuditList().stream().filter(AAIObjectAudit::isDoesObjectExist).findFirst()
.map(v -> true).orElse(false);
} else {
return false;
@@ -85,9 +87,12 @@ public abstract class AbstractAuditService {
}
protected void setupMDC(ExternalTask externalTask) {
+ logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
String msoRequestId = externalTask.getVariable("mso-request-id");
- if (msoRequestId != null && !msoRequestId.isEmpty())
+ if (msoRequestId != null && !msoRequestId.isEmpty()) {
MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId);
+ }
+ MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, externalTask.getTopicName());
}
protected long calculateRetryDelay(int currentRetries) {
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
index 77229919cd..1e5b6de857 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
@@ -27,6 +27,7 @@ import java.util.Map;
import java.util.Optional;
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.audit.beans.AuditInventory;
import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
import org.onap.so.objects.audit.AAIObjectAuditList;
@@ -48,9 +49,9 @@ public class AuditCreateStackService extends AbstractAuditService {
public Environment environment;
protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
+ setupMDC(externalTask);
AuditInventory auditInventory = externalTask.getVariable("auditInventory");
Map<String, Object> variables = new HashMap<>();
- setupMDC(externalTask);
boolean success = false;
try {
logger.info("Executing External Task Audit Inventory, Retry Number: {} \n {}", auditInventory,
@@ -71,6 +72,7 @@ public class AuditCreateStackService extends AbstractAuditService {
if (success) {
externalTaskService.complete(externalTask, variables);
logger.debug("The External Task Id: {} Successful", externalTask.getId());
+ logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
} else {
if (externalTask.getRetries() == null) {
logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}",
@@ -80,6 +82,7 @@ public class AuditCreateStackService extends AbstractAuditService {
} else if (externalTask.getRetries() != null && externalTask.getRetries() - 1 == 0) {
logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId());
externalTaskService.complete(externalTask, variables);
+ logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
} else {
logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ",
externalTask.getId(), externalTask.getRetries() - 1,
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDataService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDataService.java
new file mode 100644
index 0000000000..1c707fe795
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDataService.java
@@ -0,0 +1,77 @@
+package org.onap.so.adapters.audit;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Optional;
+import org.onap.so.audit.beans.AuditInventory;
+import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.so.db.request.beans.RequestProcessingData;
+import org.onap.so.db.request.client.RequestsDbClient;
+import org.onap.so.objects.audit.AAIObjectAuditList;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+
+@Component
+public class AuditDataService {
+
+ @Autowired
+ private RequestsDbClient requestsDbClient;
+
+ /**
+ * Checks to see if an entry already exist for the given heat stack and writes audit stack data to the request
+ * database if it doesn't.
+ *
+ * @throws JsonProcessingException
+ */
+ public void writeStackDataToRequestDb(AuditInventory auditInventory, AAIObjectAuditList auditList)
+ throws JsonProcessingException {
+ List<RequestProcessingData> requestProcessingDataList =
+ requestsDbClient.getRequestProcessingDataByGroupingIdAndNameAndTag(auditInventory.getVfModuleId(),
+ auditInventory.getHeatStackName(), "AuditStackData");
+ if (requestProcessingDataList.isEmpty()) {
+ GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
+ String auditListString = objectMapper.getMapper().writeValueAsString(auditList);;
+
+ RequestProcessingData requestProcessingData = new RequestProcessingData();
+ requestProcessingData.setSoRequestId(auditInventory.getMsoRequestId());
+ requestProcessingData.setGroupingId(auditInventory.getVfModuleId());
+ requestProcessingData.setName(auditInventory.getHeatStackName());
+ requestProcessingData.setTag("AuditStackData");
+ requestProcessingData.setValue(auditListString);
+
+ requestsDbClient.saveRequestProcessingData(requestProcessingData);
+ }
+ }
+
+ /**
+ * Retrieves audit stack data from the request database.
+ *
+ * @throws IOException
+ * @throws JsonMappingException
+ * @throws JsonParseException
+ */
+ public Optional<AAIObjectAuditList> getStackDataFromRequestDb(AuditInventory auditInventory)
+ throws JsonParseException, JsonMappingException, IOException {
+
+ List<RequestProcessingData> requestProcessingDataList =
+ requestsDbClient.getRequestProcessingDataByGroupingIdAndNameAndTag(auditInventory.getVfModuleId(),
+ auditInventory.getHeatStackName(), "AuditStackData");
+ if (!requestProcessingDataList.isEmpty()) {
+ RequestProcessingData requestProcessingData = requestProcessingDataList.get(0);
+ String auditListString = requestProcessingData.getValue();
+
+ GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
+ AAIObjectAuditList auditList =
+ objectMapper.getMapper().readValue(auditListString, AAIObjectAuditList.class);
+
+ return Optional.of(auditList);
+ } else {
+ return Optional.empty();
+ }
+ }
+
+
+}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
index 9b245ba695..0aa4f9bdc3 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
@@ -25,6 +25,7 @@ import java.util.Map;
import java.util.Optional;
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.audit.beans.AuditInventory;
import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
import org.onap.so.objects.audit.AAIObjectAuditList;
@@ -40,28 +41,38 @@ public class AuditDeleteStackService extends AbstractAuditService {
private static final Logger logger = LoggerFactory.getLogger(AuditDeleteStackService.class);
@Autowired
- public HeatStackAudit heatStackAudit;
+ protected HeatStackAudit heatStackAudit;
@Autowired
- public Environment environment;
+ protected AuditVServer auditVservers;
+
+ @Autowired
+ protected AuditDataService auditDataService;
+
+ @Autowired
+ protected Environment env;
protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
+ setupMDC(externalTask);
AuditInventory auditInventory = externalTask.getVariable("auditInventory");
Map<String, Object> variables = new HashMap<>();
- setupMDC(externalTask);
boolean success = false;
try {
- logger.info("Executing External Task Audit Inventory, Retry Number: {} \n {}", auditInventory,
- externalTask.getRetries());
- Optional<AAIObjectAuditList> auditListOpt = heatStackAudit.auditHeatStack(auditInventory.getCloudRegion(),
- auditInventory.getCloudOwner(), auditInventory.getTenantId(), auditInventory.getHeatStackName());
+ logger.info("Executing External Task Delete Audit Inventory. Retry Number: {}", externalTask.getRetries());
+ Optional<AAIObjectAuditList> auditListOpt = auditDataService.getStackDataFromRequestDb(auditInventory);
if (auditListOpt.isPresent()) {
- auditListOpt.get().setAuditType("delete");
- auditListOpt.get().setHeatStackName(auditInventory.getHeatStackName());
- GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
- variables.put("auditInventoryResult", objectMapper.getMapper().writeValueAsString(auditListOpt.get()));
- success = !didDeleteAuditFail(auditListOpt);
+ auditVservers.auditVservers(auditListOpt.get());
+ } else {
+ logger.debug("Auditing Vservers based on vf module relationships");
+ auditListOpt = auditVservers.auditVserversThroughRelationships(auditInventory.getGenericVnfId(),
+ auditInventory.getHeatStackName());
}
+ auditListOpt.get().setHeatStackName(auditInventory.getHeatStackName());
+ auditListOpt.get().setAuditType("delete");
+ GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
+ variables.put("auditInventoryResult", objectMapper.getMapper().writeValueAsString(auditListOpt.get()));
+ success = !didDeleteAuditFail(auditListOpt.get());
+
} catch (Exception e) {
logger.error("Error during audit of stack", e);
}
@@ -69,6 +80,7 @@ public class AuditDeleteStackService extends AbstractAuditService {
if (success) {
externalTaskService.complete(externalTask, variables);
logger.debug("The External Task Id: {} Successful", externalTask.getId());
+ logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
} else {
if (externalTask.getRetries() == null) {
logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}",
@@ -78,6 +90,7 @@ public class AuditDeleteStackService extends AbstractAuditService {
} else if (externalTask.getRetries() != null && externalTask.getRetries() - 1 == 0) {
logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId());
externalTaskService.complete(externalTask, variables);
+ logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
} else {
logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ",
externalTask.getId(), externalTask.getRetries() - 1,
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java
new file mode 100644
index 0000000000..2ef7d5b325
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditQueryStackService.java
@@ -0,0 +1,71 @@
+package org.onap.so.adapters.audit;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import org.camunda.bpm.client.task.ExternalTask;
+import org.camunda.bpm.client.task.ExternalTaskService;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.audit.beans.AuditInventory;
+import org.onap.so.objects.audit.AAIObjectAuditList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AuditQueryStackService extends AbstractAuditService {
+
+ private static final Logger logger = LoggerFactory.getLogger(AuditQueryStackService.class);
+
+ @Autowired
+ protected HeatStackAudit heatStackAudit;
+
+ @Autowired
+ protected AuditDataService auditDataService;
+
+ protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService) {
+ setupMDC(externalTask);
+ AuditInventory auditInventory = externalTask.getVariable("auditInventory");
+ boolean success = false;
+ Map<String, Object> variables = new HashMap<>();
+ try {
+ logger.info("Executing External Task Query Audit Inventory. Audit Inventory: {} \n Retry Number: {}",
+ auditInventory.toString(), externalTask.getRetries());
+
+ Optional<AAIObjectAuditList> auditList = heatStackAudit.queryHeatStack(auditInventory.getCloudOwner(),
+ auditInventory.getCloudRegion(), auditInventory.getTenantId(), auditInventory.getHeatStackName());
+
+ if (auditList.isPresent()) {
+ success = true;
+ auditDataService.writeStackDataToRequestDb(auditInventory, auditList.get());
+ }
+ if (success) {
+ externalTaskService.complete(externalTask, variables);
+ logger.debug("The External Task {} was Successful", externalTask.getId());
+ logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
+ } else {
+ if (externalTask.getRetries() == null) {
+ logger.debug("The External Task {} Failed. Setting Retries to Default Start Value: {}",
+ externalTask.getId(), getRetrySequence().length);
+ externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK,
+ UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK, getRetrySequence().length, 10000);
+ } else if (externalTask.getRetries() != null && externalTask.getRetries() - 1 == 0) {
+ logger.debug("The External Task {} Failed. All Retries Exhausted", externalTask.getId());
+ externalTaskService.complete(externalTask, variables);
+ logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
+ } else {
+ logger.debug("The External Task {} Failed. Decrementing Retries to {} , Retry Delay: ",
+ externalTask.getId(), externalTask.getRetries() - 1,
+ calculateRetryDelay(externalTask.getRetries()));
+ externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK,
+ UNABLE_TO_FIND_V_SERVERS_IN_OPENSTACK, externalTask.getRetries() - 1,
+ calculateRetryDelay(externalTask.getRetries()));
+ }
+ logger.debug("The External Task {} Failed", externalTask.getId());
+ }
+ } catch (Exception e) {
+ logger.error("Error during audit query of stack", e);
+ }
+ }
+}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
index 576acb1fd8..999d27335b 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
@@ -49,6 +49,9 @@ public class AuditStackService {
@Autowired
private AuditDeleteStackService auditDeleteStack;
+ @Autowired
+ private AuditQueryStackService auditQueryStack;
+
@PostConstruct
public void auditAddAAIInventory() throws Exception {
for (int i = 0; i < getMaxClients(); i++) {
@@ -69,6 +72,16 @@ public class AuditStackService {
}
}
+ @PostConstruct
+ public void auditQueryInventory() throws Exception {
+ for (int i = 0; i < getMaxClients(); i++) {
+ ExternalTaskClient client = createExternalTaskClient();
+ client.subscribe("InventoryQueryAudit")
+ .lockDuration(Long.parseLong(env.getProperty("mso.audit.lock-time", "60000")))
+ .handler(auditQueryStack::executeExternalTask).open();
+ }
+ }
+
protected ExternalTaskClient createExternalTaskClient() throws Exception {
ClientRequestInterceptor interceptor = createClientRequestInterceptor();
ExternalTaskClient client = ExternalTaskClient.create()
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
index e009c0e2fd..89e0320615 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditVServer.java
@@ -20,10 +20,12 @@
package org.onap.so.adapters.audit;
+import java.util.List;
import java.util.Optional;
import java.util.Set;
import org.onap.aai.domain.yang.LInterface;
import org.onap.aai.domain.yang.Vserver;
+import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
@@ -40,6 +42,38 @@ import com.fasterxml.jackson.core.JsonProcessingException;
public class AuditVServer extends AbstractAudit {
private static final Logger logger = LoggerFactory.getLogger(AuditVServer.class);
+ public void auditVservers(AAIObjectAuditList aaiObjectAuditList) {
+
+ aaiObjectAuditList.getAuditList().forEach(aaiObjectAudit -> {
+ boolean vserverExist = getAaiClient().exists(AAIUriFactory
+ .createResourceFromExistingURI(AAIObjectType.VSERVER, aaiObjectAudit.getResourceURI()));
+ aaiObjectAudit.setDoesObjectExist(vserverExist);
+ });
+ }
+
+ public Optional<AAIObjectAuditList> auditVserversThroughRelationships(String genericVnfId, String vfModuleName) {
+ AAIObjectAuditList auditList = new AAIObjectAuditList();
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, genericVnfId)
+ .queryParam("vf-module-name", vfModuleName);
+ if (getAaiClient().get(uri).getRelationships().isPresent()) {
+ List<AAIResourceUri> relatedVservers =
+ getAaiClient().get(uri).getRelationships().get().getRelatedUris(AAIObjectType.VSERVER);
+ if (!relatedVservers.isEmpty()) {
+ relatedVservers.forEach(vserverUri -> {
+ Optional<Vserver> vserver = getAaiClient().get(vserverUri).asBean(Vserver.class);
+ Vserver vServerShallow = new Vserver();
+ BeanUtils.copyProperties(vserver, vServerShallow);
+ AAIObjectAudit vServerAudit = new AAIObjectAudit();
+ vServerAudit.setAaiObject(vServerShallow);
+ vServerAudit.setAaiObjectType(AAIObjectType.VSERVER.typeName());
+ vServerAudit.setDoesObjectExist(true);
+ auditList.getAuditList().add(vServerAudit);
+ });
+ }
+ }
+ return Optional.of(auditList);
+ }
+
public Optional<AAIObjectAuditList> auditVservers(Set<Vserver> vServersToAudit, String tenantId, String cloudOwner,
String cloudRegion) {
if (vServersToAudit == null || vServersToAudit.isEmpty()) {
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
index 2be87ff076..06fff19205 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
@@ -35,11 +35,16 @@ import org.onap.aai.domain.yang.LInterfaces;
import org.onap.aai.domain.yang.Vlan;
import org.onap.aai.domain.yang.Vlans;
import org.onap.aai.domain.yang.Vserver;
+import org.onap.so.client.aai.AAIObjectType;
+import org.onap.so.client.aai.entities.uri.AAIResourceUri;
+import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.onap.so.objects.audit.AAIObjectAudit;
import org.onap.so.objects.audit.AAIObjectAuditList;
import org.onap.so.openstack.utils.MsoHeatUtils;
import org.onap.so.openstack.utils.MsoNeutronUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.woorea.openstack.heat.model.Link;
@@ -66,6 +71,28 @@ public class HeatStackAudit {
@Autowired
protected AuditVServer auditVservers;
+ public Optional<AAIObjectAuditList> queryHeatStack(String cloudOwner, String cloudRegion, String tenantId,
+ String heatStackName) {
+ try {
+ logger.debug("Fetching Top Level Stack Information");
+ Resources resources = heat.queryStackResources(cloudRegion, tenantId, heatStackName, 3);
+ List<Resource> novaResources = resources.getList().stream()
+ .filter(p -> "OS::Nova::Server".equals(p.getType())).collect(Collectors.toList());
+ if (novaResources.isEmpty())
+ return Optional.of(new AAIObjectAuditList());
+ else {
+ Set<Vserver> vserversToAudit = createVserverSet(novaResources);
+ AAIObjectAuditList aaiObjectAuditList = new AAIObjectAuditList();
+ vserversToAudit.stream().forEach(vServer -> aaiObjectAuditList.getAuditList()
+ .add(createAAIObjectAudit(cloudOwner, cloudRegion, tenantId, vServer)));
+ return Optional.of(aaiObjectAuditList);
+ }
+ } catch (Exception e) {
+ logger.error("Error during query stack resources", e);
+ return Optional.of(new AAIObjectAuditList());
+ }
+ }
+
public Optional<AAIObjectAuditList> auditHeatStack(String cloudRegion, String cloudOwner, String tenantId,
String heatStackName) {
try {
@@ -215,6 +242,31 @@ public class HeatStackAudit {
return vserversToAudit;
}
+ protected Set<Vserver> createVserverSet(List<Resource> novaResources) {
+ Set<Vserver> vserversToAudit = new HashSet<>();
+ for (Resource novaResource : novaResources) {
+ Vserver auditVserver = new Vserver();
+ auditVserver.setLInterfaces(new LInterfaces());
+ auditVserver.setVserverId(novaResource.getPhysicalResourceId());
+ vserversToAudit.add(auditVserver);
+ }
+ return vserversToAudit;
+ }
+
+ protected AAIObjectAudit createAAIObjectAudit(String cloudOwner, String cloudRegion, String tenantId,
+ Vserver vServer) {
+ AAIObjectAudit aaiObjectAudit = new AAIObjectAudit();
+ Vserver vServerShallow = new Vserver();
+ BeanUtils.copyProperties(vServer, vServerShallow);
+ aaiObjectAudit.setAaiObject(vServerShallow);
+ aaiObjectAudit.setAaiObjectType(AAIObjectType.VSERVER.typeName());
+ aaiObjectAudit.setResourceURI(AAIUriFactory
+ .createResourceUri(AAIObjectType.VSERVER, cloudOwner, cloudRegion, tenantId, vServer.getVserverId())
+ .build());
+
+ return aaiObjectAudit;
+ }
+
/**
* @param novaResource Single openstack resource that is of type Nova
* @param neutronPorts List of Neutron ports created within the stack
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java
index 74cf7c38c9..a6c61704ad 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/inventory/create/CreateInventoryTask.java
@@ -3,6 +3,8 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ *
+ * Copyright (C) 2019 IBM
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,6 +41,8 @@ public class CreateInventoryTask {
private static final Logger logger = LoggerFactory.getLogger(CreateInventoryTask.class);
+ private static final String AAI_INVENTORY_FAILURE = "AAIInventoryFailure";
+
@Autowired
CreateAAIInventory createInventory;
@@ -73,9 +77,10 @@ public class CreateInventoryTask {
if (success) {
externalTaskService.complete(externalTask);
logger.debug("The External Task Id: {} Successful", externalTask.getId());
+ logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
} else if (inventoryException) {
logger.debug("The External Task Id: {} Failed, Retry not needed", externalTask.getId());
- externalTaskService.handleBpmnError(externalTask, "AAIInventoryFailure");
+ externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE);
} else {
if (externalTask.getRetries() == null) {
logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}",
@@ -84,7 +89,8 @@ public class CreateInventoryTask {
UNABLE_TO_WRITE_ALL_INVENTORY_TO_A_AI, getRetrySequence().length, 10000);
} else if (externalTask.getRetries() != null && externalTask.getRetries() - 1 == 0) {
logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId());
- externalTaskService.handleBpmnError(externalTask, "AAIInventoryFailure");
+ externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE);
+ logger.info(ONAPLogConstants.Markers.EXIT, "Exiting");
} else {
logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ",
externalTask.getId(), externalTask.getRetries() - 1,
@@ -97,13 +103,15 @@ public class CreateInventoryTask {
}
} else {
logger.debug("The External Task Id: {} Failed, No Audit Results Written", externalTask.getId());
- externalTaskService.handleBpmnError(externalTask, "AAIInventoryFailure");
+ externalTaskService.handleBpmnError(externalTask, AAI_INVENTORY_FAILURE);
}
}
private void setupMDC(ExternalTask externalTask) {
try {
- String msoRequestId = (String) externalTask.getVariable("mso-request-id");
+ logger.info(ONAPLogConstants.Markers.ENTRY, "Entering");
+ MDC.put(ONAPLogConstants.MDCs.SERVICE_NAME, externalTask.getTopicName());
+ String msoRequestId = externalTask.getVariable("mso-request-id");
if (msoRequestId != null && !msoRequestId.isEmpty())
MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId);
} catch (Exception e) {
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
index d2c0d9cabd..d9f47f5c3a 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java
@@ -962,7 +962,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
if (netInfo != null) {
// Found. Populate the output elements
networkExists.value = Boolean.TRUE;
- if ("HEAT".equals(mode)) {
+ if ("HEAT".equals(mode) && heatStack != null) {
networkId.value = heatStack.getCanonicalName();
} else {
networkId.value = netInfo.getId();
@@ -1294,15 +1294,23 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter {
// Resource Property
List<ContrailPolicyRef> prlist = new ArrayList<>();
int index = 1;
- for (String pf : pFqdns) {
- if (!commonUtils.isNullOrEmpty(pf)) {
- ContrailPolicyRef pr = new ContrailPolicyRef();
- ContrailPolicyRefSeq refSeq = new ContrailPolicyRefSeq(String.valueOf(index), "0");
- pr.setSeq(refSeq);
- index++;
- logger.debug("Contrail PolicyRefs Data:{}", pr);
- prlist.add(pr);
+
+ if (pFqdns != null) {
+ for (String pf : pFqdns) {
+ if (!commonUtils.isNullOrEmpty(pf)) {
+ ContrailPolicyRef pr = new ContrailPolicyRef();
+ ContrailPolicyRefSeq refSeq = new ContrailPolicyRefSeq(String.valueOf(index), "0");
+ pr.setSeq(refSeq);
+ index++;
+ logger.debug("Contrail PolicyRefs Data:{}", pr);
+ prlist.add(pr);
+ }
}
+ } else {
+ String error = "Null pFqdns at start of mergePolicyRefs";
+ logger.error(LoggingAnchor.THREE, MessageEnum.RA_MARSHING_ERROR, ErrorCode.BusinessProcesssError.getValue(),
+ error);
+ throw new MsoAdapterException(error);
}
JsonNode node = null;
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
index a141f59153..1d73bf21c9 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterImpl.java
@@ -843,8 +843,10 @@ public class MsoVnfAdapterImpl implements MsoVnfAdapter {
// Add version check
// First - see if it's in the VnfResource record
// if we have a vf Module - then we have to query to get the VnfResource record.
- if (!oldWay && vf.getVnfResources() != null) {
- vnfResource = vf.getVnfResources();
+ if (!oldWay) {
+ if (vf != null) {
+ vnfResource = vf.getVnfResources();
+ }
if (vnfResource == null) {
logger.debug("Unable to find vnfResource will not error for now...");
}
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 c22bb327d4..2d77bf625a 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
@@ -187,11 +187,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
Holder<Map<String, String>> outputs) throws VnfException {
logger.debug("Querying VNF " + vnfNameOrId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
- // Will capture execution time for metrics
- long startTime = System.currentTimeMillis();
- long subStartTime = System.currentTimeMillis();
-
- VduInstance vduInstance = null;
+ VduInstance vduInstance;
CloudInfo cloudInfo = new CloudInfo(cloudSiteId, cloudOwner, tenantId, null);
VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
@@ -252,7 +248,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
*/
@Override
public void rollbackVnf(VnfRollback rollback) throws VnfException {
- long startTime = System.currentTimeMillis();
// rollback may be null (e.g. if stack already existed when Create was called)
if (rollback == null) {
logger.info(LoggingAnchor.THREE, MessageEnum.RA_ROLLBACK_NULL.toString(), "OpenStack", "rollbackVnf");
@@ -279,7 +274,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
// Use the VduPlugin to delete the VF Module.
VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
- long subStartTime = System.currentTimeMillis();
try {
// TODO: Get a reasonable timeout. Use a global property, or store the creation timeout in rollback object
// and use that.
@@ -336,7 +330,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
logger.debug("Unable to convert " + inputValue + " to an integer!", e);
return null;
}
- } else if (type.equalsIgnoreCase("json")) {
+ } else if ("json".equalsIgnoreCase(type)) {
try {
JsonNode jsonNode = JSON_MAPPER.readTree(JSON_MAPPER.writeValueAsString(inputValue));
return jsonNode;
@@ -344,7 +338,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
logger.debug("Unable to convert " + inputValue + " to a JsonNode!", e);
return null;
}
- } else if (type.equalsIgnoreCase("boolean")) {
+ } else if ("boolean".equalsIgnoreCase(type)) {
return new Boolean(inputValue.toString());
}
@@ -353,7 +347,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
}
private Map<String, String> copyStringOutputs(Map<String, Object> stackOutputs) {
- Map<String, String> stringOutputs = new HashMap<String, String>();
+ Map<String, String> stringOutputs = new HashMap<>();
for (String key : stackOutputs.keySet()) {
if (stackOutputs.get(key) instanceof String) {
stringOutputs.put(key, (String) stackOutputs.get(key));
@@ -447,7 +441,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
if (objectMap == null) {
return null;
}
- Map<String, String> stringMap = new HashMap<String, String>();
+ Map<String, String> stringMap = new HashMap<>();
for (String key : objectMap.keySet()) {
if (!stringMap.containsKey(key)) {
Object obj = objectMap.get(key);
@@ -540,8 +534,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
String volumeGroupId, String baseVfModuleId, String modelCustomizationUuid, Map<String, Object> inputs,
Boolean failIfExists, Boolean backout, Boolean enableBridge, MsoRequest msoRequest, Holder<String> vnfId,
Holder<Map<String, String>> outputs, Holder<VnfRollback> rollback) throws VnfException {
- // Will capture execution time for metrics
- long startTime = System.currentTimeMillis();
// Require a model customization ID. Every VF Module definition must have one.
if (modelCustomizationUuid == null || modelCustomizationUuid.isEmpty()) {
@@ -665,7 +657,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
// Use the VduPlugin.
VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
- long subStartTime1 = System.currentTimeMillis();
try {
vduInstance = vduPlugin.queryVdu(cloudInfo, vfModuleName);
} catch (VduException me) {
@@ -761,8 +752,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
// If a Volume Group was provided, query its outputs for inclusion in Module input parameters
if (volumeGroupId != null) {
- long subStartTime2 = System.currentTimeMillis();
- VduInstance volumeVdu = null;
+ VduInstance volumeVdu;
try {
volumeVdu = vduPlugin.queryVdu(cloudInfo, volumeGroupId);
} catch (VduException me) {
@@ -811,8 +801,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
}
if (baseVfModuleId != null) {
- long subStartTime2 = System.currentTimeMillis();
- VduInstance baseVdu = null;
+ VduInstance baseVdu;
try {
baseVdu = vduPlugin.queryVdu(cloudInfo, baseVfModuleId);
} catch (MsoException me) {
@@ -887,19 +876,19 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
// Create the combined set of parameters from the incoming request, base-module outputs,
// volume-module outputs. Also, convert all variables to their native object types.
- HashMap<String, Object> goldenInputs = new HashMap<String, Object>();
- List<String> extraInputs = new ArrayList<String>();
+ HashMap<String, Object> goldenInputs = new HashMap<>();
+ List<String> extraInputs = new ArrayList<>();
Boolean skipInputChecks = false;
if (skipInputChecks) {
- goldenInputs = new HashMap<String, Object>();
+ goldenInputs = new HashMap<>();
for (String key : inputs.keySet()) {
goldenInputs.put(key, inputs.get(key));
}
} else {
// Build maps for the parameters (including aliases) to simplify checks
- HashMap<String, HeatTemplateParam> params = new HashMap<String, HeatTemplateParam>();
+ HashMap<String, HeatTemplateParam> params = new HashMap<>();
Set<HeatTemplateParam> paramSet = heatTemplate.getParameters();
logger.debug("paramSet has " + paramSet.size() + " entries");
@@ -909,7 +898,7 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
// Include aliases.
String alias = htp.getParamAlias();
- if (alias != null && !alias.equals("") && !params.containsKey(alias)) {
+ if (alias != null && !"".equals(alias) && !params.containsKey(alias)) {
params.put(alias, htp);
}
}
@@ -1026,7 +1015,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
// Here we go... ready to deploy the VF Module.
- long instantiateVduStartTime = System.currentTimeMillis();
if (backout == null)
backout = true;
@@ -1088,11 +1076,9 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
MsoRequest msoRequest, Holder<Map<String, String>> outputs) throws VnfException {
logger.debug("Deleting VF Module " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
- // Will capture execution time for metrics
- long startTime = System.currentTimeMillis();
// Capture the output parameters on a delete, so need to query first
- VduInstance vduInstance = null;
+ VduInstance vduInstance;
CloudInfo cloudInfo = new CloudInfo(cloudSiteId, cloudOwner, tenantId, null);
// Use the VduPlugin.
@@ -1123,7 +1109,6 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
// - a vnfInstance object with status of NOTFOUND (VDU did not exist, treat as success)
// - a vnfInstance object with status of FAILED (error)
// Also, VduException could be thrown.
- long subStartTime = System.currentTimeMillis();
try {
// TODO: Get an appropriate timeout value - require access to the model
vduPlugin.deleteVdu(cloudInfo, vfModuleId, 5);
@@ -1166,11 +1151,11 @@ public class MsoVnfPluginAdapterImpl implements MsoVnfAdapter {
CloudSite cloudSite = cloudSiteOp.get();
String orchestrator = cloudSite.getOrchestrator();
- if (orchestrator.equalsIgnoreCase("CLOUDIFY")) {
+ if ("CLOUDIFY".equalsIgnoreCase(orchestrator)) {
return cloudifyUtils;
- } else if (orchestrator.equalsIgnoreCase("HEAT")) {
+ } else if ("HEAT".equalsIgnoreCase(orchestrator)) {
return heatUtils;
- } else if (orchestrator.equalsIgnoreCase("MULTICLOUD")) {
+ } else if ("MULTICLOUD".equalsIgnoreCase(orchestrator)) {
return multicloudUtils;
} else {
// Default if cloudSite record exists - return HEAT plugin - will fail later
diff --git a/adapters/mso-openstack-adapters/src/main/resources/application-local.yaml b/adapters/mso-openstack-adapters/src/main/resources/application-local.yaml
deleted file mode 100644
index 66d63d436b..0000000000
--- a/adapters/mso-openstack-adapters/src/main/resources/application-local.yaml
+++ /dev/null
@@ -1,105 +0,0 @@
-# will be used as entry in DB to say SITE OFF/ON for healthcheck
-# MSO Properties go here
-org:
- onap:
- so:
- adapters:
- default_keystone_url_version: /v2.0
- default_keystone_reg_ex: "/[vV][0-9]"
- vnf:
- bpelauth: 1DDAD7A55A230BB446AA2125053EFB46455F43E48B60155E1C53236E175DFC722A6BE120F6DB390C60034C7564AEB653EA
- checkRequiredParameters: true
- addGetFilesOnVolumeReq: false
- sockettimeout: 30
- connecttimeout: 30
- retrycount: 5
- retryinterval: -15
- retrylist: 408,429,500,502,503,504,900
- network:
- bpelauth: 1DDAD7A55A230BB446AA2125053EFB46455F43E48B60155E1C53236E175DFC722A6BE120F6DB390C60034C7564AEB653EA
- sockettimeout: 5
- connecttimeout: 5
- retrycount: 5
- retryinterval: -15
- retrylist: 408,429,500,502,503,504,900
- encryptionKey: aa3871669d893c7fb8abbcda31b88b4f
- tenant:
- default_x_aic_orm_client_string: ECOMP-MSO
- default_keystone_url_version: /v2.0
- default_keystone_reg_ex: "/[vV][0-9]"
- default_tenant_description: ECOMP Tenant
- default_region_type: single
- default_user_role: admin
- default_success_status_string: Success
- default_no_regions_status_string: no regions
- default_orm_request_path: /v1/orm/customers/
- default_orm_url_replace_this: 8080
- default_orm_url_replace_with_this: 7080
- default_quota_value: 10
- set_default_quota: false
- po:
- retryCodes: 504
- retryDelay: 5
- retryCount: 3
- pollTimeout: 7500
- pollInterval: 15
-
-server-port: 8080
-ssl-enable: false
-tomcat:
- max-threads: 50
-mso:
- msoKey: 07a7159d3bf51a0e53be7a8f89699be7
- auth: 6B466C603A260F3655DBF91E53CE54667041C01406D10E8CAF9CC24D8FA5388D06F90BFE4C852052B436
- audit:
- lock-time: 240000
- logPath: logs
- msb-ip: localhost
- msb-port: ${wiremock.server.port}
- workflow:
- endpoint: http://bpmn-infra:8081/sobpmnengine
- topics:
- retryMultiplier: 1000
- config:
- cadi:
- aafId: test
- catalog:
- db:
- spring:
- endpoint: "http://localhost:8080"
- db:
- auth: Basic YnBlbDptc28tZGItMTUwNyE=
- site-name: localDevEnv
- async:
- core-pool-size: 50
- max-pool-size: 50
- queue-capacity: 500
-
-spring:
- security:
- usercredentials:
- -
- username: sdnc
- password: '$2a$12$mukkC6IvLikKGBdwqGnev.H0ccvV6K13TFeLvyNhJoCuNkRjWhqi6'
- role: SDNC-Client
- -
- username: sitecontrol
- password: '$2a$12$VBUF.qBmeK1FNyO2MqTpD.P2M1tvlesZlhCkAjjHvF9hmYNVdMDmu'
- role: SiteControl-Client
- -
- username: bpel
- password: '$2a$12$/GW0/AVAUooTag.7GDc9a.jW7XH3nq/.QsJJJFZJ0N24iXB2W9ksO'
- role: BPEL-Client
- -
- username: sniro
- password: '$2a$12$lbOQWS1iDmdQPxW2Mb6OiuTzGaPUrkrvoKVn2zwpFWb6n5Y86Lf1y'
- role: SNIRO-Client
- -
- username: apih
- password: '$2a$12$e1BGJ7qknMN/b7bqsQvU2OT9iGunt9IlfQclKlCs6n240oHBfcO5y'
- role: MSO-Client
- -
- username: mso_admin
- password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
- role: ACTUATOR
-
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditDataServiceTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditDataServiceTest.java
new file mode 100644
index 0000000000..d3380a6a33
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditDataServiceTest.java
@@ -0,0 +1,101 @@
+package org.onap.so.adapters.audit;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.aai.domain.yang.Vserver;
+import org.onap.so.audit.beans.AuditInventory;
+import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.so.db.request.beans.RequestProcessingData;
+import org.onap.so.db.request.client.RequestsDbClient;
+import org.onap.so.objects.audit.AAIObjectAudit;
+import org.onap.so.objects.audit.AAIObjectAuditList;
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+@RunWith(MockitoJUnitRunner.Silent.class)
+public class AuditDataServiceTest {
+
+ @InjectMocks
+ AuditDataService auditDataService = new AuditDataService();
+
+ @Mock
+ protected RequestsDbClient requestsDbClient;
+
+ AuditInventory auditInventory = new AuditInventory();
+
+ @Before
+ public void before() throws JsonProcessingException {
+ auditInventory.setCloudOwner("testCloudOwner");
+ auditInventory.setCloudRegion("testLcpCloudRegionId");
+ auditInventory.setHeatStackName("testVfModuleName1");
+ auditInventory.setVfModuleId("testVnfModuleId");
+ auditInventory.setTenantId("testTenantId");
+ auditInventory.setGenericVnfId("testVnfId1");
+ }
+
+ @Test
+ public void testWriteStackDataToRequestDb() throws Exception {
+ Mockito.doReturn(new ArrayList<RequestProcessingData>()).when(requestsDbClient)
+ .getRequestProcessingDataByGroupingIdAndNameAndTag(Mockito.any(), Mockito.any(), Mockito.any());
+ Mockito.doNothing().when(requestsDbClient).saveRequestProcessingData(Mockito.any());
+
+ AAIObjectAuditList auditList = new AAIObjectAuditList();
+ auditList.setHeatStackName("testHeatStackName");
+ AAIObjectAudit audit = new AAIObjectAudit();
+ Vserver vserver = new Vserver();
+ vserver.setVserverId("testVserverId");
+ audit.setAaiObject(vserver);
+ auditList.getAuditList().add(audit);
+
+ GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
+ String auditListString = objectMapper.getMapper().writeValueAsString(auditList);;
+
+ RequestProcessingData requestProcessingData = new RequestProcessingData();
+ requestProcessingData.setSoRequestId(auditInventory.getMsoRequestId());
+ requestProcessingData.setGroupingId(auditInventory.getVfModuleId());
+ requestProcessingData.setName(auditInventory.getHeatStackName());
+ requestProcessingData.setTag("AuditStackData");
+ requestProcessingData.setValue(auditListString);
+
+ auditDataService.writeStackDataToRequestDb(auditInventory, auditList);
+ Mockito.verify(requestsDbClient, Mockito.times(1)).saveRequestProcessingData(requestProcessingData);
+ }
+
+ @Test
+ public void testGetStackDataToRequestDb() throws Exception {
+ AAIObjectAuditList auditList = new AAIObjectAuditList();
+ auditList.setHeatStackName("testHeatStackName");
+ AAIObjectAudit audit = new AAIObjectAudit();
+ Vserver vserver = new Vserver();
+ vserver.setVserverId("testVserverId");
+ audit.setAaiObject(vserver);
+ auditList.getAuditList().add(audit);
+ GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
+ String auditListString = objectMapper.getMapper().writeValueAsString(audit);
+
+ List<RequestProcessingData> list = new ArrayList();
+ RequestProcessingData requestProcessingData = new RequestProcessingData();
+ requestProcessingData.setId(234321432);
+ requestProcessingData.setGroupingId("testVfModuleId");
+ requestProcessingData.setName("heatStackName");
+ requestProcessingData.setTag("AuditStackData");
+ requestProcessingData.setValue(auditListString);
+ list.add(requestProcessingData);
+
+ Mockito.doReturn(list).when(requestsDbClient).getRequestProcessingDataByGroupingIdAndNameAndTag(Mockito.any(),
+ Mockito.any(), Mockito.any());
+ auditDataService.getStackDataFromRequestDb(auditInventory);
+ Mockito.verify(requestsDbClient, Mockito.times(1)).getRequestProcessingDataByGroupingIdAndNameAndTag(
+ "testVnfModuleId", "testVfModuleName1", "AuditStackData");
+ }
+
+}
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
index f23486c45c..3432e4a8b6 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
@@ -7,9 +7,9 @@
* 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.
@@ -40,6 +40,7 @@ import org.onap.so.audit.beans.AuditInventory;
import org.onap.so.objects.audit.AAIObjectAuditList;
import org.springframework.core.env.Environment;
import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -48,6 +49,9 @@ public class AuditStackServiceDataTest extends AuditCreateStackService {
@InjectMocks
private AuditCreateStackService auditStackService = new AuditCreateStackService();
+ @InjectMocks
+ private AuditQueryStackService auditQueryStackService = new AuditQueryStackService();
+
@Mock
private HeatStackAudit heatStackAuditMock;
@@ -60,6 +64,9 @@ public class AuditStackServiceDataTest extends AuditCreateStackService {
@Mock
private ExternalTaskService mockExternalTaskService;
+ @Mock
+ private AuditDataService auditDataService;
+
private ObjectMapper objectMapper = new ObjectMapper();
private AuditInventory auditInventory = new AuditInventory();
@@ -112,6 +119,20 @@ public class AuditStackServiceDataTest extends AuditCreateStackService {
}
@Test
+ public void executeExternalTaskQueryAuditTest() throws JsonProcessingException {
+ doReturn(auditListOptSuccess).when(heatStackAuditMock).queryHeatStack("cloudOwner", "cloudRegion", "tenantId",
+ "stackName");
+ Mockito.doNothing().when(auditDataService).writeStackDataToRequestDb(Mockito.any(AuditInventory.class),
+ Mockito.any(AAIObjectAuditList.class));
+ auditQueryStackService.executeExternalTask(mockExternalTask, mockExternalTaskService);
+ ArgumentCaptor<Map> captor = ArgumentCaptor.forClass(Map.class);
+ ArgumentCaptor<ExternalTask> taskCaptor = ArgumentCaptor.forClass(ExternalTask.class);
+ Mockito.verify(mockExternalTaskService).complete(taskCaptor.capture(), captor.capture());
+ Mockito.verify(auditDataService).writeStackDataToRequestDb(Mockito.any(AuditInventory.class),
+ Mockito.any(AAIObjectAuditList.class));
+ }
+
+ @Test
public void execute_external_task_audit_first_failure_Test() {
doReturn(auditListOptFailure).when(heatStackAuditMock).auditHeatStack("cloudRegion", "cloudOwner", "tenantId",
"stackName");
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java
index 2075557721..3d9a128318 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java
@@ -7,9 +7,9 @@
* 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.
@@ -33,14 +33,19 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
+import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.aai.domain.yang.LInterface;
import org.onap.aai.domain.yang.LInterfaces;
+import org.onap.aai.domain.yang.Relationship;
+import org.onap.aai.domain.yang.RelationshipList;
+import org.onap.aai.domain.yang.VfModule;
import org.onap.aai.domain.yang.Vserver;
import org.onap.so.client.aai.AAIObjectPlurals;
import org.onap.so.client.aai.AAIObjectType;
@@ -48,6 +53,7 @@ import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.onap.so.objects.audit.AAIObjectAudit;
import org.onap.so.objects.audit.AAIObjectAuditList;
import org.skyscreamer.jsonassert.JSONAssert;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
@@ -362,6 +368,69 @@ public class AuditVServerTest extends AuditVServer {
JSONAssert.assertEquals(expected, actualString, false);
}
+ @Test
+ public void testAuditVserversWithList() {
+
+ AAIObjectAuditList auditList = new AAIObjectAuditList();
+ AAIObjectAudit obj1 = new AAIObjectAudit();
+ Vserver vserver = new Vserver();
+ vserver.setVserverId("testVserverId");
+ obj1.setAaiObject(vserver);
+ obj1.setResourceURI(AAIUriFactory
+ .createResourceUri(AAIObjectType.VSERVER, cloudOwner, cloudRegion, tenantId, "testVserverId").build());
+ auditList.getAuditList().add(obj1);
+
+ doReturn(false).when(aaiResourcesMock).exists(AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner,
+ cloudRegion, tenantId, "testVserverId"));
+
+ auditNova.auditVservers(auditList);
+
+ Mockito.verify(aaiResourcesMock).exists(AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner,
+ cloudRegion, tenantId, "testVserverId"));
+
+ Assert.assertEquals(false, auditList.getAuditList().get(0).isDoesObjectExist());
+ }
+
+ @Test
+ public void testAuditVserversThroughRelationships() {
+
+ VfModule vfModule = new VfModule();
+ vfModule.setVfModuleId("id");
+
+ AAIResultWrapper wrapper = new AAIResultWrapper(vfModule);
+
+ doReturn(wrapper).when(aaiResourcesMock)
+ .get(AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, "genericVnfId")
+ .queryParam("vf-module-name", "vfModuleName"));
+
+ Optional<AAIObjectAuditList> auditList =
+ auditNova.auditVserversThroughRelationships("genericVnfId", "vfModuleName");
+
+ Assert.assertTrue(auditList.get().getAuditList().isEmpty());
+ }
+
+ @Test
+ public void testAuditVserversThroughRelationships_exists() throws IOException {
+
+ String vfModule = getJson("vfModule.json");
+
+ AAIResultWrapper wrapper = new AAIResultWrapper(vfModule);
+ AAIResultWrapper vserverWrapper = new AAIResultWrapper(new Vserver());
+
+ doReturn(wrapper).when(aaiResourcesMock)
+ .get(AAIUriFactory.createResourceUri(AAIObjectPlurals.VF_MODULE, "genericVnfId")
+ .queryParam("vf-module-name", "vfModuleName"));
+
+ doReturn(vserverWrapper).when(aaiResourcesMock).get(AAIUriFactory.createResourceUri(AAIObjectType.VSERVER,
+ "cloud-owner", "cloud-region-id", "tenant-id", "VUSCHGA1"));
+
+ Optional<AAIObjectAuditList> auditList =
+ auditNova.auditVserversThroughRelationships("genericVnfId", "vfModuleName");
+
+ Assert.assertFalse(auditList.get().getAuditList().isEmpty());
+ }
+
+
private String getJson(String filename) throws IOException {
return new String(Files.readAllBytes(Paths.get("src/test/resources/" + filename)));
}
diff --git a/adapters/mso-openstack-adapters/src/test/resources/vfModule.json b/adapters/mso-openstack-adapters/src/test/resources/vfModule.json
new file mode 100644
index 0000000000..bfdca2c144
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/test/resources/vfModule.json
@@ -0,0 +1,38 @@
+{
+ "vf-module-id": "a62d14f0-421e-4e64-980a-a368722819db",
+ "vf-module-name": "vig30001vm001vig001_migrated.base.module-0",
+ "is-base-vf-module": false,
+ "resource-version": "1494001780539",
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "vserver",
+ "related-link": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/cloud-owner/cloud-region-id/tenants/tenant/tenant-id/vservers/vserver/VUSCHGA1",
+ "relationship-data": [
+ {
+ "relationship-key": "cloud-region.cloud-owner",
+ "relationship-value": "cloud-owner"
+ },
+ {
+ "relationship-key": "cloud-region.cloud-region-id",
+ "relationship-value": "cloud-region-id"
+ },
+ {
+ "relationship-key": "tenant.tenant-id",
+ "relationship-value": "tenant-id"
+ },
+ {
+ "relationship-key": "vserver.vserver-id",
+ "relationship-value": "VUSCHGA1"
+ }
+ ],
+ "related-to-property": [
+ {
+ "property-key": "vserver.vserver-name",
+ "property-value": "VUSCHGA1"
+ }
+ ]
+ }
+ ]
+ }
+ }
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java
new file mode 100644
index 0000000000..c32525a62b
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java
@@ -0,0 +1,23 @@
+package org.onap.so.adapters.requestsdb;
+
+import java.util.stream.Collectors;
+import javax.persistence.EntityManager;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
+import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;
+
+@Configuration
+public class RequestDbRepositoryConfiguration extends RepositoryRestConfigurerAdapter {
+
+ @Autowired
+ private EntityManager entityManager;
+
+ @Override
+ public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
+ config.exposeIdsFor(entityManager.getMetamodel().getEntities().stream().map(e -> e.getJavaType())
+ .collect(Collectors.toList()).toArray(new Class[0]));
+ }
+
+
+}
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml
deleted file mode 100644
index 5d3a837180..0000000000
--- a/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-# will be used as entry in DB to say SITE OFF/ON for healthcheck
-
-server:
- port: 8090
- tomcat:
- max-threads: 50
-ssl-enable: false
-mso:
- adapters:
- requestDb:
- auth: Basic YnBlbDptc28tZGItMTUwNyE=
- endpoint: http://localhost:8081
- logPath: logs
- site-name: localSite
- infra-requests:
- archived:
- period: 180
-spring:
- datasource:
- url: jdbc:mariadb://localhost:3306/requestdb
- username: catalog
- password: catalog123
- driver-class-name: org.mariadb.jdbc.Driver
- initialize: true
- initialization-mode: never
- jpa:
- generate-ddl: false
- show-sql: false
- hibernate:
- ddl-auto: validate
- naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
- enable-lazy-load-no-trans: true
- database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
- security:
- usercredentials:
- -
- username: bpel
- password: '$2a$12$1xyutEZNfjGewIZRfKaE8eZE99f5sYFUmmM80BobI65KNjmcK0JuO'
- role: BPEL-Client
- -
- username: mso_admin
- password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
- role: ACTUATOR
-
-
-flyway:
- baseline-on-migrate: false
- url: jdbc:mariadb://localhost:3306/requestdb
- user: catalog
- password: catalog123
- \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.2__Expand_Column_Size_Infra_Active_Requests_Request_Status.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.2__Expand_Column_Size_Infra_Active_Requests_Request_Status.sql
new file mode 100644
index 0000000000..427eb0bf07
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.2__Expand_Column_Size_Infra_Active_Requests_Request_Status.sql
@@ -0,0 +1,3 @@
+use requestdb;
+
+ALTER TABLE infra_active_requests MODIFY COLUMN REQUEST_STATUS varchar(25) NULL; \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.3__Expand_Column_Size_Archived_Infra_Active_Requests_Request_Status.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.3__Expand_Column_Size_Archived_Infra_Active_Requests_Request_Status.sql
new file mode 100644
index 0000000000..0780a611db
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.3__Expand_Column_Size_Archived_Infra_Active_Requests_Request_Status.sql
@@ -0,0 +1,3 @@
+use requestdb;
+
+ALTER TABLE archived_infra_requests MODIFY COLUMN REQUEST_STATUS varchar(25) NULL; \ No newline at end of file
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
index a38d057e49..55023088bc 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
@@ -3,6 +3,8 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ *
+ * Copyright (C) 2019 IBM
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,11 +24,9 @@ package org.onap.so.adapters.sdnc;
import java.util.concurrent.Executor;
import org.onap.so.logging.jaxrs.filter.MDCTaskDecorator;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
index a68bd3e0be..5697ed56a5 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java
@@ -88,11 +88,9 @@ public class SDNCServiceRequestTask {
String xml = genSdncReq(request, mappedTunables);
- long sdncStartTime = System.currentTimeMillis();
SDNCResponseCommon response = connector.send(xml, mappedTunables);
- long bpStartTime = System.currentTimeMillis();
- boolean callbackSuccess = bpRestCallback.send(request.getBPNotificationUrl(), response.toJson());
+ bpRestCallback.send(request.getBPNotificationUrl(), response.toJson());
}
private Element addChild(Element parent, String tag) {
diff --git a/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml b/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml
deleted file mode 100644
index 4141548c29..0000000000
--- a/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml
+++ /dev/null
@@ -1,133 +0,0 @@
-management:
- context-path: /manage
-mso:
- async:
- core-pool-size: 50
- max-pool-size: 50
- queue-capacity: 500
- logPath: /app/logs/sdnc
- catalog:
- db:
- spring:
- endpoint: "http://localhost:8080"
- db:
- auth: Basic YnBlbDptc28tZGItMTUwNyE=
- site-name: local
-org:
- onap:
- so:
- adapters:
- sdnc:
- '.':
- put: PUT|60000|sdncurl5|
- query: GET|60000|sdncurl2|
- restdelete: DELETE|60000|sdncurl5|
- '':
- contrail-route-topology-operation:
- activate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- assign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- create: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- deactivate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- delete: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- unassign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- network-topology-operation:
- activate: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- assign: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- changeassign: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- changedelete: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- delete: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- reserve: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- rollback: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- security-zone-topology-operation:
- activate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- assign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- create: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- deactivate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- delete: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- unassign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- service-topology-operation:
- assign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- deactivate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- delete: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- rollback: POST|270000|sdncur10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- vnf-topology-operation:
- activate: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- assign: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- changeassign: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- changedelete: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- delete: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- rollback: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- bpelauth: BBD450258299BD2FEF7E3EBA3CD2B58AD417355332319856D761654AA876830A9839820D33DE8426A81E5D48649A4BE6FE7021F5
- bpelurl: http://localhost:8080/mso/SDNCAdapterCallbackService
- generic-resource:
- network-topology-operation:
- activate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- assign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- deactivate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- unassign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- vf-module-topology-operation:
- activate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- assign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- changeassign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- changedelete: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- deactivate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- delete: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- rollback: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- unassign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- vnf-topology-operation:
- activate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- assign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- changeassign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- changedelete: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- deactivate: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- delete: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- rollback: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- unassign: POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource
- infra:
- '':
- query: GET|60000|sdncurl5|
- mobility:
- '':
- query: GET|60000|sdncurl5|
- myurl: http://localhost:8080/adapters/rest/SDNCNotify
- rest:
- bpelurl: http://localhost:8080/mso/WorkflowMessage
- sdncauth: 1C2DC9B30545C5F673B3C33904608E942476F0C969B3CF7A2509459AB83C9062EFAAE89E91D6DB
- sdncconnecttime: 5000
- sdncurl10: 'https://localhost:8443/restconf/operations/GENERIC-RESOURCE-API:'
- sdncurl12: https://localhost:8443/
- sdncurl5: https://localhost:8443/restconf/config
- sdncurl6: 'https://localhost:8443/restconf/operations/VNF-API:'
- vfmodule:
- '':
- query: GET|60000|sdncurl12|
- network:
- encryptionKey: aa3871669d893c7fb8abbcda31b88b4f
-spring:
- security:
- usercredentials:
- -
- username: sdnc
- password: '$2a$12$mukkC6IvLikKGBdwqGnev.H0ccvV6K13TFeLvyNhJoCuNkRjWhqi6'
- role: SDNC-Client
- -
- username: sitecontrol
- password: '$2a$12$VBUF.qBmeK1FNyO2MqTpD.P2M1tvlesZlhCkAjjHvF9hmYNVdMDmu'
- role: SiteControl-Client
- -
- username: bpel
- password: '$2a$12$/GW0/AVAUooTag.7GDc9a.jW7XH3nq/.QsJJJFZJ0N24iXB2W9ksO'
- role: BPEL-Client
- -
- username: sniro
- password: '$2a$12$lbOQWS1iDmdQPxW2Mb6OiuTzGaPUrkrvoKVn2zwpFWb6n5Y86Lf1y'
- role: SNIRO-Client
- -
- username: apih
- password: '$2a$12$e1BGJ7qknMN/b7bqsQvU2OT9iGunt9IlfQclKlCs6n240oHBfcO5y'
- role: MSO-Client
- -
- username: mso_admin
- password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
- role: ACTUATOR
-ssl-enable: false
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/HealthCheckHandler.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/HealthCheckHandler.java
index cff36061b1..2dcdf11316 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/HealthCheckHandler.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/HealthCheckHandler.java
@@ -28,8 +28,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
/**
@@ -44,8 +42,6 @@ import org.springframework.stereotype.Component;
@Component
public class HealthCheckHandler {
- private static Logger logger = LoggerFactory.getLogger(HealthCheckHandler.class);
-
private static final String CHECK_HTML =
"<!DOCTYPE html><html><head><meta charset=\"ISO-8859-1\"><title>Health Check</title></head><body>Application ready</body></html>";
diff --git a/adapters/mso-vfc-adapter/src/main/resources/application-local.yaml b/adapters/mso-vfc-adapter/src/main/resources/application-local.yaml
deleted file mode 100644
index 414dabb0a1..0000000000
--- a/adapters/mso-vfc-adapter/src/main/resources/application-local.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-server:
- port: 8091
- tomcat:
- max-threads: 50
-ssl-enable: false
-mso:
- logPath: logs
- site-name: localSite
-spring:
- datasource:
- jdbc-url: jdbc:mariadb://localhost:3306/requestdb
- username: mso
- password: mso123
- driver-class-name: org.mariadb.jdbc.Driver
- initialize: true
- initialization-mode: never
- jpa:
- generate-ddl: false
- show-sql: false
- hibernate:
- ddl-auto: validate
- naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
- enable-lazy-load-no-trans: true
- database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
- security:
- usercredentials:
- -
- username: bpel
- password: '$2a$12$1xyutEZNfjGewIZRfKaE8eZE99f5sYFUmmM80BobI65KNjmcK0JuO'
- role: BPEL-Client
- -
- username: mso_admin
- password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
- role: ACTUATOR
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml
index 09c28f93f1..e2dd64d0f4 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/pom.xml
@@ -58,6 +58,24 @@
</configuration>
</plugin>
</plugins>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <excludes>
+ <exclude>**/*.p12</exclude>
+ <exclude>**/*.jks</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <includes>
+ <include>**/*.p12</include>
+ <include>**/*.jks</include>
+ </includes>
+ </resource>
+ </resources>
</build>
<dependencies>
<dependency>
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/SdcPackageProvider.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/SdcPackageProvider.java
index 57d6615d66..735e1f9d42 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/SdcPackageProvider.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/SdcPackageProvider.java
@@ -49,6 +49,7 @@ import java.util.NoSuchElementException;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
+import javax.net.ssl.SSLContext;
import org.apache.commons.codec.binary.Base64;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
@@ -133,7 +134,7 @@ public class SdcPackageProvider {
private byte[] getPackage(final String csarId) {
final String SERVICE_NAME = "vnfm-adapter";
- try (CloseableHttpClient client = HttpClients.createDefault()) {
+ try (CloseableHttpClient client = HttpClients.custom().setSSLContext(SSLContext.getDefault()).build()) {
final HttpGet httpget = new HttpGet(format(GET_PACKAGE_URL, baseUrl, csarId));
httpget.setHeader(ACCEPT, APPLICATION_OCTET_STREAM_VALUE);
httpget.setHeader("X-ECOMP-InstanceID", SERVICE_NAME);
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
index 1fa62efa25..019a08af78 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/aai/AaiServiceProviderImpl.java
@@ -28,6 +28,7 @@ import org.onap.aai.domain.yang.GenericVnfs;
import org.onap.aai.domain.yang.Vserver;
import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.onap.so.client.graphinventory.entities.uri.Depth;
import org.onap.vnfmadapter.v1.model.Tenant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,8 +59,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider {
@Override
public GenericVnfs invokeQueryGenericVnf(final String selfLink) {
return aaiClientProvider.getAaiClient()
- .get(GenericVnfs.class, AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNFS)
- .queryParam("selflink", selfLink.replaceAll("https", "http")))
+ .get(GenericVnfs.class,
+ AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNFS).queryParam("selflink", selfLink))
.orElseGet(() -> {
logger.debug("No vnf found in AAI with selflink: {}", selfLink);
return null;
@@ -78,7 +79,8 @@ public class AaiServiceProviderImpl implements AaiServiceProvider {
@Override
public EsrVnfm invokeGetVnfm(final String vnfmId) {
return aaiClientProvider.getAaiClient()
- .get(EsrVnfm.class, AAIUriFactory.createResourceUri(AAIObjectType.VNFM, vnfmId)).orElseGet(() -> {
+ .get(EsrVnfm.class, AAIUriFactory.createResourceUri(AAIObjectType.VNFM, vnfmId).depth(Depth.ONE))
+ .orElseGet(() -> {
logger.debug("VNFM not found in AAI");
return null;
});
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java
index 2aee1c06e3..3342e0d054 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderConfiguration.java
@@ -22,16 +22,34 @@ package org.onap.so.adapters.vnfmadapter.extclients.vnfm;
import static org.onap.so.client.RestTemplateConfig.CONFIGURABLE_REST_TEMPLATE;
import com.google.gson.Gson;
+import java.io.IOException;
+import java.security.KeyManagementException;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.CertificateException;
import java.util.Iterator;
+import java.util.ListIterator;
+import javax.net.ssl.SSLContext;
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.ssl.SSLContextBuilder;
import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.JSON;
import org.onap.so.configuration.rest.BasicHttpHeadersProvider;
import org.onap.so.configuration.rest.HttpHeadersProvider;
+import org.onap.so.logging.jaxrs.filter.SpringClientFilter;
import org.onap.so.rest.service.HttpRestServiceProvider;
import org.onap.so.rest.service.HttpRestServiceProviderImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.Resource;
+import org.springframework.http.client.ClientHttpRequestInterceptor;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.GsonHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
@@ -43,6 +61,13 @@ import org.springframework.web.client.RestTemplate;
@Configuration
public class VnfmServiceProviderConfiguration {
+ private static final Logger logger = LoggerFactory.getLogger(VnfmServiceProviderConfiguration.class);
+
+ @Value("${http.client.ssl.trust-store}")
+ private Resource keyStore;
+ @Value("${http.client.ssl.trust-store-password}")
+ private String keyStorePassword;
+
@Bean(name = "vnfmServiceProvider")
public HttpRestServiceProvider httpRestServiceProvider(
@Qualifier(CONFIGURABLE_REST_TEMPLATE) @Autowired final RestTemplate restTemplate) {
@@ -52,6 +77,8 @@ public class VnfmServiceProviderConfiguration {
private HttpRestServiceProvider getHttpRestServiceProvider(final RestTemplate restTemplate,
final HttpHeadersProvider httpHeadersProvider) {
setGsonMessageConverter(restTemplate);
+ setTrustStore(restTemplate);
+ removeSpringClientFilter(restTemplate);
return new HttpRestServiceProviderImpl(restTemplate, httpHeadersProvider);
}
@@ -66,4 +93,30 @@ public class VnfmServiceProviderConfiguration {
restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson));
}
+ private void setTrustStore(final RestTemplate restTemplate) {
+ SSLContext sslContext;
+ try {
+ sslContext = new SSLContextBuilder().loadTrustMaterial(keyStore.getURL(), keyStorePassword.toCharArray())
+ .build();
+ logger.info("Setting truststore: {}", keyStore.getURL());
+ final SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(sslContext);
+ final HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory).build();
+ final HttpComponentsClientHttpRequestFactory factory =
+ new HttpComponentsClientHttpRequestFactory(httpClient);
+ restTemplate.setRequestFactory(factory);
+ } catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException | CertificateException
+ | IOException exception) {
+ logger.error("Error reading truststore, TLS connection to VNFM will fail.", exception);
+ }
+ }
+
+ private void removeSpringClientFilter(final RestTemplate restTemplate) {
+ ListIterator<ClientHttpRequestInterceptor> interceptorIterator = restTemplate.getInterceptors().listIterator();
+ while (interceptorIterator.hasNext()) {
+ if (interceptorIterator.next() instanceof SpringClientFilter) {
+ interceptorIterator.remove();
+ }
+ }
+ }
+
}
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java
index 0b5b09ae39..c470008d08 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/extclients/vnfm/VnfmServiceProviderImpl.java
@@ -54,7 +54,7 @@ public class VnfmServiceProviderImpl implements VnfmServiceProvider {
@Override
public Optional<InlineResponse201> getVnf(final String vnfSelfLink) {
- return httpServiceProvider.get(vnfSelfLink.replaceAll("https", "http"), InlineResponse201.class);
+ return httpServiceProvider.get(vnfSelfLink, InlineResponse201.class);
}
@Override
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java
index a4f7d3206d..fa2fa30b4a 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/java/org/onap/so/adapters/vnfmadapter/lifecycle/LifecycleManager.java
@@ -114,7 +114,7 @@ public class LifecycleManager {
private String getSelfLink(final InlineResponse201 vnfmResponse, final EsrVnfm vnfm) {
if (vnfmResponse.getLinks() != null && vnfmResponse.getLinks().getSelf() != null
&& vnfmResponse.getLinks().getSelf().getHref() != null) {
- return vnfmResponse.getLinks().getSelf().getHref().replaceAll("https", "http");
+ return vnfmResponse.getLinks().getSelf().getHref();
}
return vnfm.getEsrSystemInfoList().getEsrSystemInfo().iterator().next().getServiceUrl() + "/vnf_instances/"
+ vnfmResponse.getId();
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml
index 951d4a3bb9..0bd63dffa9 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/application.yaml
@@ -23,6 +23,12 @@ spring:
http:
converters:
preferred-json-mapper: gson
+
+http:
+ client:
+ ssl:
+ trust-store: classpath:org.onap.so.trust.jks
+ trust-store-password: ',sx#.C*W)]wVgJC6ccFHI#:H'
server:
port: 9092
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/org.onap.so.trust.jks b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/org.onap.so.trust.jks
new file mode 100644
index 0000000000..1f0d8a550a
--- /dev/null
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/main/resources/org.onap.so.trust.jks
Binary files differ
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java b/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
index a5e3340c76..e00bb1eb36 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/ASDCControllerSingleton.java
@@ -38,21 +38,26 @@ import java.security.SecureRandom;
@Profile("!test")
public class ASDCControllerSingleton {
+ private static final Logger logger = LoggerFactory.getLogger(ASDCControllerSingleton.class);
+ private final ASDCController asdcController;
@Autowired
- private ASDCController asdcController;
- private static Logger logger = LoggerFactory.getLogger(ASDCControllerSingleton.class);
-
-
+ public ASDCControllerSingleton(final ASDCController asdcController) {
+ this.asdcController = asdcController;
+ }
@Scheduled(fixedRate = 50000)
public void periodicControllerTask() {
try {
- int randomNumber = new SecureRandom().nextInt(Integer.MAX_VALUE);
+ final int randomNumber = new SecureRandom().nextInt(Integer.MAX_VALUE);
asdcController.setControllerName("mso-controller" + randomNumber);
- asdcController.initASDC();
- } catch (ASDCControllerException e) {
- logger.error("Exception occurred", e);
+ if (asdcController.isStopped()) {
+ logger.info("{} not running will try to initialize it, currrent status: {}",
+ asdcController.getClass().getName(), asdcController.getControllerStatus());
+ asdcController.initASDC();
+ }
+ } catch (final ASDCControllerException controllerException) {
+ logger.error("Exception occurred", controllerException);
}
}
@@ -60,8 +65,8 @@ public class ASDCControllerSingleton {
private void terminate() {
try {
asdcController.closeASDC();
- } catch (ASDCControllerException e) {
- logger.error("Exception occurred", e);
+ } catch (final ASDCControllerException controllerException) {
+ logger.error("Exception occurred", controllerException);
}
}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/Application.java b/asdc-controller/src/main/java/org/onap/so/asdc/Application.java
index eb2957c6f8..2c8347260f 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/Application.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/Application.java
@@ -35,7 +35,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableJpaRepositories("org.onap.so.db.catalog.data.repository")
public class Application {
private static final Logger logger = LoggerFactory.getLogger(Application.class);
- private static final String MSO_CONFIG_PATH = "mso.config.path";
private static final String LOGS_DIR = "logs_dir";
@Autowired
@@ -47,11 +46,6 @@ public class Application {
}
}
- private static void setConfigPath() {
- if (System.getProperty(MSO_CONFIG_PATH) == null)
- System.getProperties().setProperty(MSO_CONFIG_PATH, ".");
- }
-
@PostConstruct
private void deployActivities() {
try {
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/JerseyConfiguration.java b/asdc-controller/src/main/java/org/onap/so/asdc/JerseyConfiguration.java
index 902506974a..22265a0cc6 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/JerseyConfiguration.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/JerseyConfiguration.java
@@ -24,7 +24,9 @@ import javax.annotation.PostConstruct;
import javax.ws.rs.ApplicationPath;
import org.glassfish.jersey.server.ResourceConfig;
import org.onap.so.asdc.client.test.rest.ASDCRestInterface;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
+import org.springframework.core.env.Environment;
import io.swagger.jaxrs.config.BeanConfig;
import io.swagger.jaxrs.listing.ApiListingResource;
import io.swagger.jaxrs.listing.SwaggerSerializers;
@@ -33,6 +35,12 @@ import io.swagger.jaxrs.listing.SwaggerSerializers;
@ApplicationPath("/test")
public class JerseyConfiguration extends ResourceConfig {
+ private Environment environment;
+
+ @Autowired
+ public JerseyConfiguration(final Environment environment) {
+ this.environment = environment;
+ }
@PostConstruct
public void setUp() {
@@ -40,10 +48,10 @@ public class JerseyConfiguration extends ResourceConfig {
register(ApiListingResource.class);
register(SwaggerSerializers.class);
- BeanConfig beanConfig = new BeanConfig();
+ final BeanConfig beanConfig = new BeanConfig();
beanConfig.setVersion("1.0.2");
beanConfig.setSchemes(new String[] {"http"});
- beanConfig.setHost("localhost:8080");
+ beanConfig.setHost("localhost:" + environment.getProperty("server.port"));
beanConfig.setBasePath("/mso");
beanConfig.setResourcePackage("org.onap.so.apihandlerinfra");
beanConfig.setPrettyPrint(true);
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
index 563291c479..3b9406a697 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java
@@ -196,11 +196,9 @@ public class ASDCController {
* @throws IOException In case of issues when trying to load the key file
*/
public void initASDC() throws ASDCControllerException {
- String event = "Initialize the ASDC Controller";
- logger.debug(event);
- if (this.getControllerStatus() != ASDCControllerStatus.STOPPED) {
- String endEvent = "The controller is already initialized, call the closeASDC method first";
- throw new ASDCControllerException(endEvent);
+ logger.debug("Initialize the ASDC Controller");
+ if (!isStopped()) {
+ throw new ASDCControllerException("The controller is already initialized, call the closeASDC method first");
}
if (asdcConfig != null) {
@@ -238,6 +236,13 @@ public class ASDCController {
}
/**
+ * @return true if controller is stopped
+ */
+ public boolean isStopped() {
+ return this.getControllerStatus() == ASDCControllerStatus.STOPPED;
+ }
+
+ /**
* This method closes the ASDC Controller and the ASDC Client.
*
* @throws ASDCControllerException It throws an exception if the ASDC Client cannot be closed because it's currently
@@ -245,7 +250,7 @@ public class ASDCController {
*/
public void closeASDC() throws ASDCControllerException {
- if (this.getControllerStatus() == ASDCControllerStatus.BUSY) {
+ if (isBusy()) {
throw new ASDCControllerException("Cannot close the ASDC controller as it's currently in BUSY state");
}
if (this.distributionClient != null) {
@@ -261,6 +266,13 @@ public class ASDCController {
this.changeControllerStatus(ASDCControllerStatus.STOPPED);
}
+ /**
+ * @return true if controller is currently processing notification
+ */
+ public boolean isBusy() {
+ return this.getControllerStatus() == ASDCControllerStatus.BUSY;
+ }
+
protected boolean checkResourceAlreadyDeployed(ResourceStructure resource, boolean serviceDeployed)
throws ArtifactInstallerException {
@@ -713,12 +725,6 @@ public class ASDCController {
try {
this.processCsarServiceArtifacts(iNotif, toscaResourceStructure);
- IArtifactInfo iArtifact = toscaResourceStructure.getToscaArtifact();
- String filePath =
- msoConfigPath + "/ASDC/" + iArtifact.getArtifactVersion() + "/" + iArtifact.getArtifactName();
- File csarFile = new File(filePath);
-
-
if (isCsarAlreadyDeployed(iNotif, toscaResourceStructure)) {
return;
}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/ArtifactInfoImpl.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/ArtifactInfoImpl.java
index f4cfb1361f..93e4aee3d7 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/ArtifactInfoImpl.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/emulators/ArtifactInfoImpl.java
@@ -4,6 +4,8 @@
* ================================================================================
* 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
@@ -59,7 +61,7 @@ public class ArtifactInfoImpl implements IArtifactInfo {
}
public static List<ArtifactInfoImpl> convertToArtifactInfoImpl(List<IArtifactInfo> list) {
- List<ArtifactInfoImpl> ret = new ArrayList<ArtifactInfoImpl>();
+ List<ArtifactInfoImpl> ret = new ArrayList<>();
if (list != null) {
for (IArtifactInfo artifactInfo : list) {
ret.add(new ArtifactInfoImpl(artifactInfo));
@@ -159,7 +161,7 @@ public class ArtifactInfoImpl implements IArtifactInfo {
@Override
public List<IArtifactInfo> getRelatedArtifacts() {
- List<IArtifactInfo> temp = new ArrayList<IArtifactInfo>();
+ List<IArtifactInfo> temp = new ArrayList<>();
if (relatedArtifactsInfo != null) {
temp.addAll(relatedArtifactsImpl);
}
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java
index 56690a8c38..24e1887847 100644
--- a/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java
+++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/test/rest/ASDCRestInterface.java
@@ -23,7 +23,6 @@
package org.onap.so.asdc.client.test.rest;
-import java.io.IOException;
import javax.transaction.Transactional;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
@@ -31,15 +30,14 @@ import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import org.onap.so.logger.LoggingAnchor;
+import javax.ws.rs.core.Response.Status;
import org.onap.so.asdc.client.ASDCController;
-import org.onap.so.asdc.client.exceptions.ASDCControllerException;
-import org.onap.so.asdc.client.exceptions.ASDCParametersException;
import org.onap.so.asdc.client.test.emulators.DistributionClientEmulator;
-import org.onap.so.asdc.client.test.emulators.NotificationDataImpl;
import org.onap.so.asdc.client.test.emulators.JsonStatusData;
+import org.onap.so.asdc.client.test.emulators.NotificationDataImpl;
import org.onap.so.asdc.installer.heat.ToscaResourceInstaller;
import org.onap.so.logger.ErrorCode;
+import org.onap.so.logger.LoggingAnchor;
import org.onap.so.logger.MessageEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,13 +46,15 @@ import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
/**
- * This is a TEST only rest interface. It is not used in production, it is used to aid in testing the ASDC service on
- * jboss without the need to be connected to the ASDC service broker. It starts the test at the treatNotification step
- * and simulates both the notification step as well as the artifact download step.
+ * This is a TEST only rest interface. It is not used in production, it is used to aid in testing the ASDC service
+ * without the need to be connected to the ASDC service broker. It starts the test at the treatNotification step and
+ * simulates both the notification step as well as the artifact download step.
* <p>
- * i.e. http://localhost:8080/asdc/treatNotification/v1
+ * i.e. http://localhost:8085/test/treatNotification/v1
* <p>
- * i.e. http://localhost:8080/asdc/statusData/v1
+ * i.e. http://localhost:8085/test/statusData/v1
+ *
+ * This interface is also used in CSIT to simulate a distribution of a service, without using SDC
*
* @author jm5423
*/
@@ -66,48 +66,75 @@ public class ASDCRestInterface {
private static final Logger logger = LoggerFactory.getLogger(ASDCRestInterface.class);
- @Autowired
- private ASDCController asdcController;
+ private final ASDCController asdcController;
+
+ private final ToscaResourceInstaller toscaInstaller;
@Autowired
- private ToscaResourceInstaller toscaInstaller;
+ public ASDCRestInterface(final ASDCController asdcController, final ToscaResourceInstaller toscaInstaller) {
+ this.asdcController = asdcController;
+ this.toscaInstaller = toscaInstaller;
+ }
@POST
@Path("/treatNotification/v1")
@Produces(MediaType.APPLICATION_JSON)
@Transactional
- public Response invokeASDCService(NotificationDataImpl request,
- @HeaderParam("resource-location") String resourceLocation)
- throws ASDCControllerException, ASDCParametersException, IOException {
- DistributionClientEmulator distributionClientEmulator = new DistributionClientEmulator(resourceLocation);
-
- asdcController.setControllerName("asdc-controller1");
- asdcController.setDistributionClient(distributionClientEmulator);
- asdcController.initASDC();
- asdcController.treatNotification(request);
- asdcController.closeASDC();
- return Response.status(200).build();
+ public Response invokeASDCService(final NotificationDataImpl request,
+ @HeaderParam("resource-location") final String resourceLocation) {
+
+ try {
+ logger.info("Received message : {}", request);
+ logger.info("resource-location : {}", resourceLocation);
+ final DistributionClientEmulator distributionClientEmulator =
+ getDistributionClientEmulator(resourceLocation);
+
+ asdcController.setControllerName("asdc-controller1");
+ asdcController.setDistributionClient(distributionClientEmulator);
+
+ if (asdcController.isStopped()) {
+ logger.info("{} not running will try to initialize it, currrent status: {}",
+ asdcController.getClass().getName(), asdcController.getControllerStatus());
+ asdcController.initASDC();
+ }
+
+ asdcController.treatNotification(request);
+
+ if (!asdcController.isBusy()) {
+ asdcController.closeASDC();
+ }
+
+ return Response.status(Status.OK).build();
+ } catch (final Exception exception) {
+ logger.error("Unable to process notification request", exception);
+ return Response.status(Status.INTERNAL_SERVER_ERROR).build();
+ }
+
+ }
+
+ private DistributionClientEmulator getDistributionClientEmulator(final String resourceLocation) {
+ return new DistributionClientEmulator(resourceLocation);
}
@POST
@Path("/statusData/v1")
@Produces(MediaType.APPLICATION_JSON)
@Transactional
- public Response invokeASDCStatusData(String request) {
+ public Response invokeASDCStatusData(final String request) {
try {
- DistributionClientEmulator distributionClientEmulator =
- new DistributionClientEmulator("resource-examples/");
- JsonStatusData statusData = JsonStatusData.instantiateNotifFromJsonFile("resource-examples/");
+ final DistributionClientEmulator distributionClientEmulator =
+ getDistributionClientEmulator("resource-examples/");
+ final JsonStatusData statusData = JsonStatusData.instantiateNotifFromJsonFile("resource-examples/");
- ASDCController controller = new ASDCController("asdc-controller1", distributionClientEmulator);
- controller.initASDC();
+ asdcController.setDistributionClient(distributionClientEmulator);
+ asdcController.initASDC();
toscaInstaller.installTheComponentStatus(statusData);
- controller.closeASDC();
+ asdcController.closeASDC();
logger.info(LoggingAnchor.FOUR, MessageEnum.ASDC_ARTIFACT_DEPLOY_SUC.toString(),
statusData.getDistributionID(), "ASDC", "ASDC Updates Are Complete");
- } catch (Exception e) {
+ } catch (final Exception e) {
logger.info("Error caught " + e.getMessage());
logger.error(LoggingAnchor.SIX, MessageEnum.ASDC_GENERAL_EXCEPTION.toString(),
"Exception caught during ASDCRestInterface", "ASDC", "invokeASDCService",
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 94517ccc45..a08206b477 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
@@ -628,11 +628,12 @@ public class ToscaResourceInstaller {
protected void processNetworks(ToscaResourceStructure toscaResourceStruct, Service service)
throws ArtifactInstallerException {
- List<NodeTemplate> nodeTemplatesVLList = toscaResourceStruct.getSdcCsarHelper().getServiceVlList();
- if (nodeTemplatesVLList != null) {
- for (NodeTemplate vlNode : nodeTemplatesVLList) {
- String networkResourceModelName = vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME);
+ List<IEntityDetails> vlEntityList = getEntityDetails(toscaResourceStruct, SdcTypes.VL, SdcTypes.SERVICE);
+
+ if (vlEntityList != null) {
+ for (IEntityDetails vlEntity : vlEntityList) {
+ String networkResourceModelName = vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME);
TempNetworkHeatTemplateLookup tempNetworkLookUp =
tempNetworkLookupRepo.findFirstBynetworkResourceModelName(networkResourceModelName);
@@ -641,7 +642,7 @@ public class ToscaResourceInstaller {
HeatTemplate heatTemplate =
heatRepo.findByArtifactUuid(tempNetworkLookUp.getHeatTemplateArtifactUuid());
if (heatTemplate != null) {
- NetworkResourceCustomization networkCustomization = createNetwork(vlNode, toscaResourceStruct,
+ NetworkResourceCustomization networkCustomization = createNetwork(vlEntity, toscaResourceStruct,
heatTemplate, tempNetworkLookUp.getAicVersionMax(),
tempNetworkLookUp.getAicVersionMin(), service);
service.getNetworkCustomizations().add(networkCustomization);
@@ -651,7 +652,7 @@ public class ToscaResourceInstaller {
}
} else {
NetworkResourceCustomization networkCustomization =
- createNetwork(vlNode, toscaResourceStruct, null, null, null, service);
+ createNetwork(vlEntity, toscaResourceStruct, null, null, null, service);
service.getNetworkCustomizations().add(networkCustomization);
logger.debug("No NetworkResourceName found in TempNetworkHeatTemplateLookup for "
+ networkResourceModelName);
@@ -1493,13 +1494,13 @@ public class ToscaResourceInstaller {
return cvnfcCustomization;
}
- protected NetworkResourceCustomization createNetwork(NodeTemplate networkNodeTemplate,
+ protected NetworkResourceCustomization createNetwork(IEntityDetails networkEntity,
ToscaResourceStructure toscaResourceStructure, HeatTemplate heatTemplate, String aicMax, String aicMin,
Service service) {
NetworkResourceCustomization networkResourceCustomization =
networkCustomizationRepo.findOneByModelCustomizationUUID(
- networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
+ networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
boolean networkUUIDsMatch = true;
// Check to make sure the NetworkResourceUUID on the Customization record matches the NetworkResourceUUID from
@@ -1507,8 +1508,7 @@ public class ToscaResourceInstaller {
// If not we'll update the Customization record with latest from the distribution
if (networkResourceCustomization != null) {
String existingNetworkModelUUID = networkResourceCustomization.getNetworkResource().getModelUUID();
- String latestNetworkModelUUID =
- networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID);
+ String latestNetworkModelUUID = networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID);
if (!existingNetworkModelUUID.equals(latestNetworkModelUUID)) {
networkUUIDsMatch = false;
@@ -1519,7 +1519,7 @@ public class ToscaResourceInstaller {
if (networkResourceCustomization != null && !networkUUIDsMatch) {
NetworkResource networkResource =
- createNetworkResource(networkNodeTemplate, toscaResourceStructure, heatTemplate, aicMax, aicMin);
+ createNetworkResource(networkEntity, toscaResourceStructure, heatTemplate, aicMax, aicMin);
networkResourceCustomization.setNetworkResource(networkResource);
@@ -1527,14 +1527,13 @@ public class ToscaResourceInstaller {
} else if (networkResourceCustomization == null) {
- networkResourceCustomization =
- createNetworkResourceCustomization(networkNodeTemplate, toscaResourceStructure);
+ networkResourceCustomization = createNetworkResourceCustomization(networkEntity, toscaResourceStructure);
NetworkResource networkResource = findExistingNetworkResource(service,
- networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
+ networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
if (networkResource == null)
- networkResource = createNetworkResource(networkNodeTemplate, toscaResourceStructure, heatTemplate,
- aicMax, aicMin);
+ networkResource =
+ createNetworkResource(networkEntity, toscaResourceStructure, heatTemplate, aicMax, aicMin);
networkResource.addNetworkResourceCustomization(networkResourceCustomization);
networkResourceCustomization.setNetworkResource(networkResource);
@@ -1557,31 +1556,34 @@ public class ToscaResourceInstaller {
return networkResource;
}
- protected NetworkResourceCustomization createNetworkResourceCustomization(NodeTemplate networkNodeTemplate,
+ protected NetworkResourceCustomization createNetworkResourceCustomization(IEntityDetails networkEntity,
ToscaResourceStructure toscaResourceStructure) {
NetworkResourceCustomization networkResourceCustomization = new NetworkResourceCustomization();
networkResourceCustomization.setModelInstanceName(
- testNull(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ testNull(networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
networkResourceCustomization.setModelCustomizationUUID(
- testNull(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
+ testNull(networkEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
networkResourceCustomization.setNetworkTechnology(
- testNull(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate,
- SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY)));
- networkResourceCustomization.setNetworkType(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(networkNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE)));
- networkResourceCustomization.setNetworkRole(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(networkNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE)));
- networkResourceCustomization.setNetworkScope(testNull(toscaResourceStructure.getSdcCsarHelper()
- .getNodeTemplatePropertyLeafValue(networkNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE)));
+ getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY));
+
+ networkResourceCustomization
+ .setNetworkType(getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE));
+
+ networkResourceCustomization
+ .setNetworkRole(getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE));
+
+ networkResourceCustomization
+ .setNetworkScope(getLeafPropertyValue(networkEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE));
+
return networkResourceCustomization;
}
- protected NetworkResource createNetworkResource(NodeTemplate networkNodeTemplate,
+ protected NetworkResource createNetworkResource(IEntityDetails vlEntity,
ToscaResourceStructure toscaResourceStructure, HeatTemplate heatTemplate, String aicMax, String aicMin) {
NetworkResource networkResource = new NetworkResource();
- String providerNetwork = toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(
- networkNodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK);
+ String providerNetwork =
+ getLeafPropertyValue(vlEntity, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK);
if ("true".equalsIgnoreCase(providerNetwork)) {
networkResource.setNeutronNetworkType(PROVIDER);
@@ -1589,21 +1591,19 @@ public class ToscaResourceInstaller {
networkResource.setNeutronNetworkType(BASIC);
}
- networkResource.setModelName(
- testNull(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
+ networkResource.setModelName(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
networkResource.setModelInvariantUUID(
- testNull(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
- networkResource.setModelUUID(
- testNull(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
- networkResource.setModelVersion(
- testNull(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
+ testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
+ networkResource.setModelUUID(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
+ networkResource
+ .setModelVersion(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
networkResource.setAicVersionMax(aicMax);
networkResource.setAicVersionMin(aicMin);
- networkResource.setToscaNodeType(networkNodeTemplate.getType());
- networkResource.setDescription(
- testNull(networkNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
+ networkResource.setToscaNodeType(vlEntity.getToscaType());
+ networkResource
+ .setDescription(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
networkResource.setOrchestrationMode(HEAT);
networkResource.setHeatTemplate(heatTemplate);
return networkResource;
@@ -2672,6 +2672,41 @@ public class ToscaResourceInstaller {
+ vfModuleStructure.getVfModuleMetadata().getVfModuleModelName();
}
+ protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, SdcTypes entityType,
+ SdcTypes topologyTemplate) {
+
+ EntityQuery entityQuery = EntityQuery.newBuilder(entityType).build();
+ TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(topologyTemplate).build();
+ List<IEntityDetails> entityDetails =
+ toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, false);
+
+ return entityDetails;
+
+ }
+
+ protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, String entityType,
+ SdcTypes topologyTemplate) {
+
+ EntityQuery entityQuery = EntityQuery.newBuilder(entityType).build();
+ TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(topologyTemplate).build();
+ List<IEntityDetails> entityDetails =
+ toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, true);
+
+ return entityDetails;
+
+ }
+
+ protected String getLeafPropertyValue(IEntityDetails entityDetails, String propName) {
+
+ Property leafProperty = entityDetails.getProperties().get(propName);
+
+ if (leafProperty != null && leafProperty.getValue() != null) {
+ return leafProperty.getValue().toString();
+ }
+
+ return null;
+ }
+
protected String getPropertyInput(String propertyName) {
String inputName = new String();
diff --git a/asdc-controller/src/main/resources/application-local.yaml b/asdc-controller/src/main/resources/application-local.yaml
deleted file mode 100644
index 1b21d8b571..0000000000
--- a/asdc-controller/src/main/resources/application-local.yaml
+++ /dev/null
@@ -1,95 +0,0 @@
-# will be used as entry in DB to say SITE OFF/ON for healthcheck
-
-server-port: 8080
-ssl-enable: false
-
-
-
-# H2
-spring:
- datasource:
- jdbc-url: jdbc:mariadb://localhost:3306/catalogdb
- username: root
- password: password
- driver-class-name: org.mariadb.jdbc.Driver
- initialize: true
-
- jpa:
- show-sql: true
- hibernate:
- ddl-auto: validate
- naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
- enable-lazy-load-no-trans: true
- database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
- security:
- usercredentials:
- -
- username: asdc
- password: '$2a$12$4R2QhxH7elzoZYoC.HJKTOHYDoaC9LbJD44Q9/tm4t/UzPF9Cgifi'
- role: Asdc-Client
- -
- username: mso_admin
- password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
- role: ACTUATOR
-request:
- datasource:
- jdbc-url: jdbc:mariadb://localhost:3306/requestdb
- username: root
- password: password
- driver-class-name: org.mariadb.jdbc.Driver
- initialize: true
- initialization-mode: never
-
-#Actuator
-management:
- endpoints:
- web:
- base-path: /manage
- server:
- servlet:
- context-path: /manage
- metrics:
- se-global-registry: false
- export:
- prometheus:
- enabled: true # Whether exporting of metrics to Prometheus is enabled.
- step: 1m # Step size (i.e. reporting frequency) to use.
-
-
-mso:
- logPath: logs
- catalog:
- db:
- spring:
- endpoint: "http://localhost:8090"
- db:
- auth: Basic YnBlbDptc28tZGItMTUwNyE=
- site-name: siteName
- aai:
- endpoint: https://localhost:8443
- asdc-connections:
- asdc-controller1:
- user: msopreist
- consumerGroup: msoasdc-id-local
- consumerId: msoasdc-id-local
- environmentName: Pre-IST
- asdcAddress: localhost:8443
- password: CB655C3C236F1F0370A347E3A0E0E133BE10ADCF4D16377E7378D3FE46A4BF60C27DF1FFB4
- pollingInterval: 30
- pollingTimeout: 30
- relevantArtifactTypes: HEAT,HEAT_ENV,HEAT_VOL
- useHttpsWithDmaap: true
- activateServerTLSAuth: false
- keyStorePassword:
- keyStorePath:
- watchDogTimeout: 1
- isFitlerInEmptyResources: true
- messageBusAddress: localhost,localhost,localhost
- asdc:
- config:
- key: 566B754875657232314F5548556D3665
- components:
- count: 3,
- componentNames: SO,AAI,SDNC
- scheduling:
- enabled: false
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
index bd8e877369..115af3adaf 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java
@@ -45,6 +45,7 @@ import org.mockito.MockitoAnnotations;
import org.onap.sdc.api.notification.IArtifactInfo;
import org.onap.sdc.api.notification.INotificationData;
import org.onap.sdc.api.notification.IResourceInstance;
+import org.onap.sdc.tosca.parser.api.IEntityDetails;
import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
import org.onap.sdc.tosca.parser.impl.SdcCsarHelperImpl;
import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
@@ -102,6 +103,8 @@ public class ToscaResourceInstallerTest extends BaseTest {
@Mock
private NodeTemplate nodeTemplate;
@Mock
+ private IEntityDetails entityDetails;
+ @Mock
private ToscaResourceStructure toscaResourceStructure;
@Mock
private ServiceProxyResourceCustomization spResourceCustomization;
diff --git a/asdc-controller/src/test/resources/resource-examples/vcpe-infra/service-Demovcpeinfra-csar.csar b/asdc-controller/src/test/resources/resource-examples/vcpe-infra/service-Demovcpeinfra-csar.csar
index 841c681088..40b8b7b45a 100644
--- a/asdc-controller/src/test/resources/resource-examples/vcpe-infra/service-Demovcpeinfra-csar.csar
+++ b/asdc-controller/src/test/resources/resource-examples/vcpe-infra/service-Demovcpeinfra-csar.csar
Binary files differ
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy
index d95dbe2184..c23150384e 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy
@@ -34,6 +34,7 @@ import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.logger.MessageEnum
+import org.onap.so.utils.TargetEntities
import org.slf4j.Logger
import org.slf4j.LoggerFactory
@@ -283,6 +284,16 @@ class ExceptionUtil extends AbstractServiceTaskProcessor {
execution.setVariable("WorkflowException", exception);
logger.debug("Outgoing WorkflowException is " + exception)
}
+
+ public void buildWorkflowException(DelegateExecution execution, int errorCode, String errorMessage, TargetEntities extSystemErrorSource) {
+ MsoUtils utils = new MsoUtils()
+ String processKey = getProcessKey(execution);
+ logger.debug("Building a WorkflowException for " + processKey)
+
+ WorkflowException exception = new WorkflowException(processKey, errorCode, errorMessage, extSystemErrorSource);
+ execution.setVariable("WorkflowException", exception);
+ logger.debug("Outgoing WorkflowException is " + exception)
+ }
/**
* This error handling method builds a WorkflowException Object and throws a
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
index a769eca3a1..866229f6b8 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
@@ -40,7 +40,6 @@ import java.util.UUID
-
class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
private static final Logger logger = LoggerFactory.getLogger( VnfAdapterRestV1.class);
@@ -81,7 +80,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no messageId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
execution.setVariable('VNFAResponse_CORRELATOR', messageId)
@@ -95,7 +94,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no notificationUrl in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
execution.setVariable(prefix + 'notificationUrl', notificationUrl)
@@ -109,7 +108,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': mso:adapters:vnf:rest:endpoint URN mapping is not defined'
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
while (vnfAdapterEndpoint.endsWith('/')) {
@@ -127,7 +126,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
vnfAdapterMethod = 'POST'
@@ -140,7 +139,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
String vfModuleId = getChildText(root, 'vfModuleId')
@@ -149,7 +148,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
vnfAdapterMethod = 'PUT'
@@ -163,7 +162,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
String vfModuleId = getChildText(root, 'vfModuleId')
@@ -172,7 +171,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
vnfAdapterMethod = 'DELETE'
@@ -186,7 +185,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vfModuleRollback in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
String vnfId = getChildText(vfModuleRollbackNode, 'vnfId')
@@ -195,7 +194,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vnfId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
String vfModuleId = getChildText(vfModuleRollbackNode, 'vfModuleId')
@@ -204,7 +203,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
vnfAdapterMethod = 'DELETE'
@@ -225,7 +224,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
vnfAdapterMethod = 'PUT'
@@ -241,7 +240,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
vnfAdapterMethod = 'DELETE'
@@ -257,7 +256,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
vnfAdapterMethod = 'DELETE'
@@ -270,7 +269,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = getProcessKey(execution) + ': Unsupported request type: ' + requestType
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
execution.setVariable(prefix + 'vnfAdapterMethod', vnfAdapterMethod)
@@ -307,7 +306,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
logger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
}
@@ -358,7 +357,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Unsupported HTTP method "' + vnfAdapterMethod + '" in ' + method + ": " + e
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
execution.setVariable(prefix + "vnfAdapterStatusCode", response.getStatus())
@@ -371,7 +370,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String msg = 'Caught exception in ' + method + ": " + e
logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
ErrorCode.UnknownError.getValue());
- exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, TargetEntity.SO)
}
}
@@ -400,7 +399,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
}
} catch (Exception e) {
logger.debug("Error encountered within VnfAdapterRest ProcessCallback method: {}", e.getMessage(), e)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7020, "Error encountered within VnfAdapterRest ProcessCallback method")
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7020, "Error encountered within VnfAdapterRest ProcessCallback method", TargetEntity.SO)
}
}
@@ -419,10 +418,10 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
String rolledBack = getChildText(root, "rolledBack")
rolledBack = rolledBack == null || rolledBack.isEmpty() ? "" : " rolledBack='" + rolledBack + "'"
exceptionUtil.buildWorkflowException(execution, 7020, "Received " + root.name() +
- " from VnfAdapter:" + category + message + rolledBack);
+ " from VnfAdapter:" + category + message + rolledBack, TargetEntity.OPENSTACK);
} catch (Exception e) {
response = response == null || String.valueOf(response).isEmpty() ? "NONE" : response
- exceptionUtil.buildWorkflowException(execution, 7020, "Received error from VnfAdapter: " + response)
+ exceptionUtil.buildWorkflowException(execution, 7020, "Received error from VnfAdapter: " + response, TargetEntity.OPENSTACK)
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/PostCompletionRequestsDbListener.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/PostCompletionRequestsDbListener.java
new file mode 100644
index 0000000000..f888e5333a
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/PostCompletionRequestsDbListener.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.common.listener.db;
+
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.db.request.beans.InfraActiveRequests;
+
+public interface PostCompletionRequestsDbListener {
+
+ public boolean shouldRunFor(BuildingBlockExecution execution);
+
+ public void run(InfraActiveRequests request, BuildingBlockExecution execution);
+
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/RequestsDbListenerRunner.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/RequestsDbListenerRunner.java
new file mode 100644
index 0000000000..68cda5c22b
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/db/RequestsDbListenerRunner.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.bpmn.common.listener.db;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+import javax.annotation.PostConstruct;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.common.listener.ListenerRunner;
+import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner;
+import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RequestsDbListenerRunner extends ListenerRunner {
+
+
+ private static Logger logger = LoggerFactory.getLogger(FlowManipulatorListenerRunner.class);
+
+ protected List<PostCompletionRequestsDbListener> postListeners;
+
+ @PostConstruct
+ protected void init() {
+
+ postListeners =
+ new ArrayList<>(Optional.ofNullable(context.getBeansOfType(PostCompletionRequestsDbListener.class))
+ .orElse(new HashMap<>()).values());
+
+ }
+
+ public void post(InfraActiveRequests request, BuildingBlockExecution execution) {
+
+ List<PostCompletionRequestsDbListener> filtered =
+ filterListeners(postListeners, (item -> item.shouldRunFor(execution)));
+
+ logger.info("Running post request db listeners:\n{}",
+ filtered.stream().map(item -> item.getClass().getName()).collect(Collectors.joining("\n")));
+ filtered.forEach(item -> item.run(request, execution));
+
+ }
+
+}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java
index 2b650e1eed..b1173bbf95 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/InstanceResourceList.java
@@ -24,16 +24,15 @@ import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
-import org.onap.so.bpmn.core.domain.GroupResource;
-import org.onap.so.bpmn.core.domain.Resource;
-import org.onap.so.bpmn.core.domain.ResourceType;
-import org.onap.so.bpmn.core.domain.VnfResource;
import java.lang.reflect.Type;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import org.apache.commons.lang3.StringUtils;
+import org.onap.so.bpmn.core.domain.GroupResource;
+import org.onap.so.bpmn.core.domain.Resource;
+import org.onap.so.bpmn.core.domain.VnfResource;
public class InstanceResourceList {
@@ -41,72 +40,6 @@ public class InstanceResourceList {
throw new IllegalStateException("Utility class");
}
- private static Map<String, List<List<GroupResource>>> convertUUIReqTOStd(final JsonObject reqInputJsonObj,
- List<Resource> seqResourceList) {
-
- Map<String, List<List<GroupResource>>> normalizedRequest = new HashMap<>();
- Resource lastVfProcessed = null;
- for (Resource r : seqResourceList) {
-
- if (r.getResourceType() == ResourceType.VNF) {
- String pk = getPrimaryKey(r);
-
- JsonElement vfNode = reqInputJsonObj.get(pk);
- lastVfProcessed = r;
-
- // if the service property is type of array then it
- // means it is a VF resource
- if (vfNode instanceof JsonArray) {
-
- for (int i = 0; i < ((JsonArray) vfNode).size(); i++) {
- List<List<GroupResource>> groupsList = normalizedRequest.get(pk);
- if (groupsList == null) {
- groupsList = new ArrayList<>();
- normalizedRequest.put(pk, groupsList);
- }
-
- groupsList.add(new ArrayList<>());
- }
- }
-
- } else if (r.getResourceType() == ResourceType.GROUP) {
- String sk = getPrimaryKey(r);
-
- // if sk is empty that means it is not list type
- if (sk.isEmpty()) {
- List<List<GroupResource>> vfList = normalizedRequest.get(getPrimaryKey(lastVfProcessed));
- for (List<GroupResource> grpList : vfList) {
- grpList.add((GroupResource) r);
- }
- continue;
- }
-
- String pk = getPrimaryKey(lastVfProcessed);
- JsonArray vfs = reqInputJsonObj.getAsJsonArray(pk);
-
- for (int i = 0; i < vfs.size(); i++) {
-
- JsonElement vfcsNode = vfs.get(i).getAsJsonObject().get(sk);
- if (vfcsNode instanceof JsonArray) {
-
- List<GroupResource> groupResources = normalizedRequest.get(pk).get(i);
-
- if (groupResources == null) {
- groupResources = new ArrayList<>();
- normalizedRequest.get(pk).add(i, groupResources);
- }
-
- for (int j = 0; j < ((JsonArray) vfcsNode).size(); j++) {
- groupResources.add((GroupResource) r);
- }
- }
- }
-
- }
- }
- return normalizedRequest;
- }
-
// this method returns key from resource input
// e.g. {\"sdwansite_emails\" : \"[sdwansiteresource_list(PK), INDEX, sdwansite_emails]|default\",
// ....}
@@ -129,45 +62,87 @@ public class InstanceResourceList {
return pkOpt.isPresent() ? pkOpt.get() : "";
} else {
- // TODO: handle the case if VNF resource is not list
- // e.g. { resourceInput
return "";
}
}
- private static List<Resource> convertToInstanceResourceList(Map<String, List<List<GroupResource>>> normalizedReq,
- List<Resource> seqResourceList) {
- List<Resource> flatResourceList = new ArrayList<>();
- for (Resource r : seqResourceList) {
- if (r.getResourceType() == ResourceType.VNF) {
- String primaryKey = getPrimaryKey(r);
- for (String pk : normalizedReq.keySet()) {
- if (primaryKey.equalsIgnoreCase(pk)) {
-
- List<List<GroupResource>> vfs = normalizedReq.get(pk);
+ public static List<Resource> getInstanceResourceList(final VnfResource vnfResource, final String uuiRequest) {
+ List<Resource> sequencedResourceList = new ArrayList<Resource>();
+ Gson gson = new Gson();
+ JsonObject servJsonObject = gson.fromJson(uuiRequest, JsonObject.class);
+ JsonObject reqInputJsonObj = servJsonObject.getAsJsonObject("service").getAsJsonObject("parameters")
+ .getAsJsonObject("requestInputs");
- vfs.stream().forEach(e -> {
- flatResourceList.add(r);
- flatResourceList.addAll(e);
- });
+ String pk = getPrimaryKey(vnfResource);
+ // if pk is not empty that means it can contain list of VNF
+ if (!pk.isEmpty()) {
+ JsonElement vfNode = reqInputJsonObj.get(pk);
+ if (vfNode.isJsonArray()) {
+ // multiple instance of VNF
+ JsonArray vfNodeList = vfNode.getAsJsonArray();
+ for (JsonElement vf : vfNodeList) {
+ JsonObject vfObj = vf.getAsJsonObject();
+
+ // Add VF first before adding groups
+ sequencedResourceList.add(vnfResource);
+ List<Resource> sequencedGroupResourceList = getGroupResourceInstanceList(vnfResource, vfObj);
+ if (!sequencedGroupResourceList.isEmpty()) {
+ sequencedResourceList.addAll(sequencedGroupResourceList);
}
}
}
+ } else {
+ // if pk is empty that means it has only one VNF Node
+ // Add VF first before adding groups
+ sequencedResourceList.add(vnfResource);
+ // check the groups for this VNF and add into resource list
+ List<Resource> sequencedGroupResourceList = getGroupResourceInstanceList(vnfResource, reqInputJsonObj);
+ if (!sequencedGroupResourceList.isEmpty()) {
+ sequencedResourceList.addAll(sequencedGroupResourceList);
+ }
}
- return flatResourceList;
- }
- public static List<Resource> getInstanceResourceList(final List<Resource> seqResourceList,
- final String uuiRequest) {
+ // In negative case consider only VNF resource only
+ if (sequencedResourceList.isEmpty()) {
+ sequencedResourceList.add(vnfResource);
+ }
- Gson gson = new Gson();
- JsonObject servJsonObject = gson.fromJson(uuiRequest, JsonObject.class);
- JsonObject reqInputJsonObj = servJsonObject.getAsJsonObject("service").getAsJsonObject("parameters")
- .getAsJsonObject("requestInputs");
+ return sequencedResourceList;
+ }
- // this will convert UUI request to normalized form
- Map<String, List<List<GroupResource>>> normalizedRequest = convertUUIReqTOStd(reqInputJsonObj, seqResourceList);
- return convertToInstanceResourceList(normalizedRequest, seqResourceList);
+ private static List<Resource> getGroupResourceInstanceList(VnfResource vnfResource, JsonObject vfObj) {
+ List<Resource> sequencedResourceList = new ArrayList<Resource>();
+ if (vnfResource.getGroupOrder() != null && !StringUtils.isEmpty(vnfResource.getGroupOrder())) {
+ String[] grpSequence = vnfResource.getGroupOrder().split(",");
+ for (String grpType : grpSequence) {
+ for (GroupResource gResource : vnfResource.getGroups()) {
+ if (StringUtils.containsIgnoreCase(gResource.getModelInfo().getModelName(), grpType)) {
+ // check the number of group instances from UUI to be added
+ String sk = getPrimaryKey(gResource);
+
+ // if sk is empty that means it is not list type
+ // only one group / vnfc to be considered
+ if (sk.isEmpty()) {
+ sequencedResourceList.add(gResource);
+ } else {
+ // check the number of list size of VNFC of a group
+ JsonElement vfcNode = vfObj.get(sk);
+ if (vfcNode.isJsonArray()) {
+ JsonArray vfcList = vfcNode.getAsJsonArray();
+ for (JsonElement vfc : vfcList) {
+ sequencedResourceList.add(gResource);
+ }
+ } else {
+ // consider only one vnfc/group if not an array
+ sequencedResourceList.add(gResource);
+ }
+ }
+
+ }
+ }
+ }
+ }
+ return sequencedResourceList;
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
index faa3d74dba..8d02fa3e4f 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java
@@ -113,7 +113,17 @@ public class ResourceRequestBuilder {
if (resource.getResourceType() == ResourceType.VNF) {
for (String eachResource : resourceList) {
String resCusUuid = JsonUtils.getJsonValue(eachResource, "resourceCustomizationUuid");
- if ((null != resCusUuid) && resCusUuid.equals(resource.getModelInfo().getModelCustomizationUuid())) {
+ // in case of external api invocation customizatoin id is coming null
+ if (resCusUuid == null || resCusUuid.contains("null") || resCusUuid.isEmpty()) {
+ logger.info("resource resolved using model uuid");
+ String uuid = (String) JsonUtils.getJsonValue(eachResource, "resourceUuid");
+ if ((null != uuid) && uuid.equals(resource.getModelInfo().getModelUuid())) {
+ logger.info("found resource uuid" + uuid);
+ String resourceParameters = JsonUtils.getJsonValue(eachResource, "parameters");
+ locationConstraints = JsonUtils.getJsonValue(resourceParameters, "locationConstraints");
+ }
+ } else if (resCusUuid.equals(resource.getModelInfo().getModelCustomizationUuid())) {
+ logger.info("resource resolved using customization-id");
String resourceParameters = JsonUtils.getJsonValue(eachResource, "parameters");
locationConstraints = JsonUtils.getJsonValue(resourceParameters, "locationConstraints");
}
@@ -122,8 +132,13 @@ public class ResourceRequestBuilder {
Map<String, Object> uuiRequestInputs = null;
if (JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs") != null) {
- uuiRequestInputs =
- getJsonObject((String) JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs"), Map.class);
+ String uuiRequestInputStr = JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs");
+ logger.info("resource input from UUI: " + uuiRequestInputStr);
+ if (uuiRequestInputStr == null || uuiRequestInputStr.isEmpty()) {
+ uuiRequestInputStr = "{}";
+ }
+
+ uuiRequestInputs = getJsonObject(uuiRequestInputStr, Map.class);
}
if (uuiRequestInputs == null) {
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
index 122e71851f..fd2054c3d0 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
@@ -30,10 +30,13 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.constants.Status;
import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
+import org.onap.so.utils.TargetEntities;
+import org.onap.so.utils.TargetEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -45,6 +48,7 @@ public class ExecuteBuildingBlockRainyDay {
private static final Logger logger = LoggerFactory.getLogger(ExecuteBuildingBlockRainyDay.class);
public static final String HANDLING_CODE = "handlingCode";
+ public static final String ROLLBACK_TARGET_STATE = "rollbackTargetState";
@Autowired
private CatalogDbClient catalogDbClient;
@@ -165,6 +169,18 @@ public class ExecuteBuildingBlockRainyDay {
if (handlingCode.equals("RollbackToAssigned") && !aLaCarte) {
handlingCode = "Rollback";
}
+ if (handlingCode.startsWith("Rollback")) {
+ String targetState = "";
+ if (handlingCode.equalsIgnoreCase("RollbackToAssigned")) {
+ targetState = Status.ROLLED_BACK_TO_ASSIGNED.toString();
+ } else if (handlingCode.equalsIgnoreCase("RollbackToCreated")) {
+ targetState = Status.ROLLED_BACK_TO_CREATED.toString();
+ } else {
+ targetState = Status.ROLLED_BACK.toString();
+ }
+ execution.setVariable(ROLLBACK_TARGET_STATE, targetState);
+ logger.debug("Rollback target state is: {}", targetState);
+ }
}
logger.debug("RainyDayHandler Status Code is: {}", handlingCode);
execution.setVariable(HANDLING_CODE, handlingCode);
@@ -185,4 +201,44 @@ public class ExecuteBuildingBlockRainyDay {
public void setHandlingStatusSuccess(DelegateExecution execution) {
execution.setVariable(HANDLING_CODE, "Success");
}
+
+ public void updateExtSystemErrorSource(DelegateExecution execution) {
+ try {
+ String requestId = (String) execution.getVariable("mso-request-id");
+ WorkflowException exception = (WorkflowException) execution.getVariable("WorkflowException");
+ TargetEntities extSystemErrorSource = exception.getExtSystemErrorSource();
+ InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
+ Boolean isRollbackFailure = (Boolean) execution.getVariable("isRollback");
+ if (isRollbackFailure == null) {
+ isRollbackFailure = false;
+ }
+
+ if (extSystemErrorSource != null) {
+ String extSystemErrorSourceString = extSystemErrorSource.toString();
+ if (isRollbackFailure) {
+ logger.debug("Updating extSystemErrorSource for isRollbackFailure to {} for request: {}",
+ extSystemErrorSourceString, requestId);
+ request.setRollbackExtSystemErrorSource(extSystemErrorSourceString);
+ } else {
+ logger.debug("Updating extSystemErrorSource to {} for request: {}", extSystemErrorSourceString,
+ requestId);
+ request.setExtSystemErrorSource(extSystemErrorSourceString);
+ }
+ } else if (isRollbackFailure) {
+ logger.debug(
+ "rollbackExtSystemErrorSource is null for isRollbackFailure. Setting rollbackExtSystemErrorSource to UNKNOWN");
+ request.setRollbackExtSystemErrorSource(TargetEntity.UNKNOWN.toString());
+ } else {
+ logger.debug("extSystemErrorSource is null. Setting extSystemErrorSource to UNKNOWN");
+ request.setExtSystemErrorSource(TargetEntity.UNKNOWN.toString());
+ }
+
+ request.setLastModifiedBy("CamundaBPMN");
+ requestDbclient.updateInfraActiveRequests(request);
+ } catch (Exception e) {
+ logger.error("Failed to update Request db with extSystemErrorSource or rollbackExtSystemErrorSource: "
+ + e.getMessage());
+ }
+ }
+
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
index b76316bf0e..b2dbd97bfc 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExtractPojosForBB.java
@@ -60,7 +60,7 @@ public class ExtractPojosForBB {
if (gBBInput.getCustomer().getServiceSubscription() == null
&& gBBInput.getServiceInstance() != null) {
result = Optional.of((T) gBBInput.getServiceInstance());
- } else {
+ } else if (gBBInput.getCustomer().getServiceSubscription() != null) {
result = lookupObjectInList(
gBBInput.getCustomer().getServiceSubscription().getServiceInstances(), value);
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java
index d656314fd1..100887dbbc 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java
@@ -43,6 +43,8 @@ import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvide
import org.onap.so.logger.MessageEnum;
import org.onap.so.objects.audit.AAIObjectAudit;
import org.onap.so.objects.audit.AAIObjectAuditList;
+import org.onap.so.utils.TargetEntities;
+import org.onap.so.utils.TargetEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -89,6 +91,39 @@ public class ExceptionBuilder {
buildAndThrowWorkflowException(execution, errorCode, msg);
}
+ public void buildAndThrowWorkflowException(BuildingBlockExecution execution, int errorCode, Exception exception,
+ TargetEntities extSystemErrorSource) {
+ String msg = "Exception in %s.%s ";
+ try {
+ logger.error("Exception occurred", exception);
+
+ String errorVariable = "Error%s%s";
+
+ StackTraceElement[] trace = Thread.currentThread().getStackTrace();
+ for (StackTraceElement traceElement : trace) {
+ if (!traceElement.getClassName().equals(this.getClass().getName())
+ && !traceElement.getClassName().equals(Thread.class.getName())) {
+ msg = String.format(msg, traceElement.getClassName(), traceElement.getMethodName());
+ String shortClassName =
+ traceElement.getClassName().substring(traceElement.getClassName().lastIndexOf(".") + 1);
+ errorVariable = String.format(errorVariable, shortClassName, traceElement.getMethodName());
+ break;
+ }
+ }
+
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ ErrorCode.UnknownError.getValue(), msg.toString());
+ execution.setVariable(errorVariable, exception.getMessage());
+ } catch (Exception ex) {
+ // log trace, allow process to complete gracefully
+ logger.error("Exception occurred", ex);
+ }
+
+ if (exception.getMessage() != null)
+ msg = msg.concat(exception.getMessage());
+ buildAndThrowWorkflowException(execution, errorCode, msg, extSystemErrorSource);
+ }
+
public void buildAndThrowWorkflowException(DelegateExecution execution, int errorCode, Exception exception) {
String msg = "Exception in %s.%s ";
try {
@@ -120,6 +155,38 @@ public class ExceptionBuilder {
buildAndThrowWorkflowException(execution, errorCode, msg);
}
+ public void buildAndThrowWorkflowException(DelegateExecution execution, int errorCode, Exception exception,
+ TargetEntities extSystemErrorSource) {
+ String msg = "Exception in %s.%s ";
+ try {
+ logger.error("Exception occurred", exception);
+
+ String errorVariable = "Error%s%s";
+
+ StackTraceElement[] trace = Thread.currentThread().getStackTrace();
+ for (StackTraceElement traceElement : trace) {
+ if (!traceElement.getClassName().equals(this.getClass().getName())
+ && !traceElement.getClassName().equals(Thread.class.getName())) {
+ msg = String.format(msg, traceElement.getClassName(), traceElement.getMethodName());
+ String shortClassName =
+ traceElement.getClassName().substring(traceElement.getClassName().lastIndexOf(".") + 1);
+ errorVariable = String.format(errorVariable, shortClassName, traceElement.getMethodName());
+ break;
+ }
+ }
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ ErrorCode.UnknownError.getValue(), msg.toString());
+ execution.setVariable(errorVariable, exception.getMessage());
+ } catch (Exception ex) {
+ // log trace, allow process to complete gracefully
+ logger.error("Exception occurred", ex);
+ }
+
+ if (exception.getMessage() != null)
+ msg = msg.concat(exception.getMessage());
+ buildAndThrowWorkflowException(execution, errorCode, msg, extSystemErrorSource);
+ }
+
public void buildAndThrowWorkflowException(BuildingBlockExecution execution, int errorCode, String errorMessage) {
if (execution instanceof DelegateExecutionImpl) {
buildAndThrowWorkflowException(((DelegateExecutionImpl) execution).getDelegateExecution(), errorCode,
@@ -127,6 +194,14 @@ public class ExceptionBuilder {
}
}
+ public void buildAndThrowWorkflowException(BuildingBlockExecution execution, int errorCode, String errorMessage,
+ TargetEntities extSystemErrorSource) {
+ if (execution instanceof DelegateExecutionImpl) {
+ buildAndThrowWorkflowException(((DelegateExecutionImpl) execution).getDelegateExecution(), errorCode,
+ errorMessage, extSystemErrorSource);
+ }
+ }
+
public void buildAndThrowWorkflowException(DelegateExecution execution, int errorCode, String errorMessage) {
String processKey = getProcessKey(execution);
logger.info("Building a WorkflowException for Subflow");
@@ -139,6 +214,19 @@ public class ExceptionBuilder {
throw new BpmnError("MSOWorkflowException");
}
+ public void buildAndThrowWorkflowException(DelegateExecution execution, int errorCode, String errorMessage,
+ TargetEntities extSystemErrorSource) {
+ String processKey = getProcessKey(execution);
+ logger.info("Building a WorkflowException for Subflow");
+
+ WorkflowException exception = new WorkflowException(processKey, errorCode, errorMessage, extSystemErrorSource);
+ execution.setVariable("WorkflowException", exception);
+ execution.setVariable("WorkflowExceptionErrorMessage", errorMessage);
+ logger.info("Outgoing WorkflowException is {}", exception);
+ logger.info("Throwing MSOWorkflowException");
+ throw new BpmnError("MSOWorkflowException");
+ }
+
public void buildAndThrowWorkflowException(DelegateExecution execution, String errorCode, String errorMessage) {
execution.setVariable("WorkflowExceptionErrorMessage", errorMessage);
throw new BpmnError(errorCode, errorMessage);
@@ -204,7 +292,8 @@ public class ExceptionBuilder {
if (flowShouldContinue) {
execution.setVariable("StatusMessage", errorMessage.toString());
} else {
- WorkflowException exception = new WorkflowException(processKey, 400, errorMessage.toString());
+ WorkflowException exception =
+ new WorkflowException(processKey, 400, errorMessage.toString(), TargetEntity.SO);
execution.setVariable("WorkflowException", exception);
execution.setVariable("WorkflowExceptionErrorMessage", errorMessage.toString());
logger.info("Outgoing WorkflowException is {}", exception);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/InstnaceResourceListTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/InstnaceResourceListTest.java
index 3be67c965c..f3233f2350 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/InstnaceResourceListTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/common/resource/InstnaceResourceListTest.java
@@ -3,6 +3,7 @@ package org.onap.so.bpmn.common.resource;
import org.junit.Assert;
import org.junit.Test;
import org.onap.so.bpmn.core.domain.GroupResource;
+import org.onap.so.bpmn.core.domain.ModelInfo;
import org.onap.so.bpmn.core.domain.Resource;
import org.onap.so.bpmn.core.domain.ResourceType;
import org.onap.so.bpmn.core.domain.VnfResource;
@@ -23,15 +24,67 @@ public class InstnaceResourceListTest {
String uuiRequest = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "InstanceResourceList" + ".json")));
List<Resource> instanceResourceList =
InstanceResourceList.getInstanceResourceList(createResourceSequence(), uuiRequest);
- Assert.assertEquals(4, instanceResourceList.size());
+ Assert.assertEquals(7, instanceResourceList.size());
Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(0).getResourceType());
Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(1).getResourceType());
- Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(2).getResourceType());
+ Assert.assertEquals("device", instanceResourceList.get(1).getModelInfo().getModelName());
+ Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(2).getResourceType());
+ Assert.assertEquals("sitewan", instanceResourceList.get(2).getModelInfo().getModelName());
Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(3).getResourceType());
+ Assert.assertEquals("sitewan", instanceResourceList.get(3).getModelInfo().getModelName());
+ Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(4).getResourceType());
+ Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(5).getResourceType());
+ Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(6).getResourceType());
}
- private List<Resource> createResourceSequence() {
- List<Resource> resourceList = new ArrayList<>();
+ // Test when PK is empty
+ @Test
+ public void testSimpleVFResource() throws IOException {
+ String uuiRequest = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "InstanceResourceList" + ".json")));
+ VnfResource vnfResource = new VnfResource();
+ vnfResource.setResourceInput("{\"a\":\"ipaddress|127.0.0.1\"}");
+ List<Resource> instanceResourceList = InstanceResourceList.getInstanceResourceList(vnfResource, uuiRequest);
+ Assert.assertEquals(1, instanceResourceList.size());
+ Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(0).getResourceType());
+ }
+
+ // Test when PK is not empty and PK does not contain any groups
+ @Test
+ public void testVFWithEmptyGroupResource() throws IOException {
+ String uuiRequest = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "InstanceResourceList" + ".json")));
+ VnfResource vnfResource = new VnfResource();
+ vnfResource.setResourceInput("{\"a\":\"[emptygroup_list,INDEX,name]\"}");
+ List<Resource> instanceResourceList = InstanceResourceList.getInstanceResourceList(vnfResource, uuiRequest);
+ Assert.assertEquals(1, instanceResourceList.size());
+ Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(0).getResourceType());
+ }
+
+ // Test when PK is not empty and contains a group which SK is empty
+ @Test
+ public void testVFWithEmptyGroupKeyResource() throws IOException {
+ String uuiRequest = new String(Files.readAllBytes(Paths.get(RESOURCE_PATH + "InstanceResourceList" + ".json")));
+ VnfResource vnfResource = new VnfResource();
+ vnfResource.setResourceInput("{\"a\":\"[emptygroup_list,INDEX,name]\"}");
+
+ VnfcResource vnfcResource = new VnfcResource();
+ vnfcResource.setResourceInput("{\"a\":\"test|default_value\"}");
+ GroupResource groupResource = new GroupResource();
+ groupResource.setVnfcs(Arrays.asList(vnfcResource));
+ ModelInfo wanModel = new ModelInfo();
+ wanModel.setModelName("wan");
+ groupResource.setModelInfo(wanModel);
+
+ vnfResource.setGroupOrder("wan");
+ vnfResource.setGroups(Arrays.asList(groupResource));
+
+ List<Resource> instanceResourceList = InstanceResourceList.getInstanceResourceList(vnfResource, uuiRequest);
+ Assert.assertEquals(2, instanceResourceList.size());
+ Assert.assertEquals(ResourceType.VNF, instanceResourceList.get(0).getResourceType());
+ Assert.assertEquals(ResourceType.GROUP, instanceResourceList.get(1).getResourceType());
+ Assert.assertEquals("wan", instanceResourceList.get(1).getModelInfo().getModelName());
+ }
+
+ private VnfResource createResourceSequence() {
VnfResource vnfResource = new VnfResource();
vnfResource.setResourceInput("{\"a\":\"[sdwansiteresource_list,INDEX,sdwansiteresource_list]\"}");
@@ -40,7 +93,20 @@ public class InstnaceResourceListTest {
GroupResource groupResource = new GroupResource();
groupResource.setVnfcs(Arrays.asList(vnfcResource));
+ ModelInfo wanModel = new ModelInfo();
+ wanModel.setModelName("sitewan");
+ groupResource.setModelInfo(wanModel);
+
+ VnfcResource vnfcDeviceResource = new VnfcResource();
+ vnfcDeviceResource.setResourceInput("{\"a\":\"[sdwandevice_list,INDEX,test]\"}");
+ GroupResource groupResource2 = new GroupResource();
+ groupResource2.setVnfcs(Arrays.asList(vnfcDeviceResource));
+ ModelInfo deviceModel = new ModelInfo();
+ deviceModel.setModelName("device");
+ groupResource2.setModelInfo(deviceModel);
- return Arrays.asList(vnfResource, groupResource);
+ vnfResource.setGroupOrder("device,sitewan");
+ vnfResource.setGroups(Arrays.asList(groupResource, groupResource2));
+ return vnfResource;
}
}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDayUnitTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDayUnitTest.java
new file mode 100644
index 0000000000..6a48558d11
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDayUnitTest.java
@@ -0,0 +1,129 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 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.
+ * 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.servicedecomposition.tasks;
+
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.core.WorkflowException;
+import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.onap.so.db.request.client.RequestsDbClient;
+import org.onap.so.utils.TargetEntity;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ExecuteBuildingBlockRainyDayUnitTest {
+
+ @Mock
+ private RequestsDbClient requestsDbClient;
+
+ @InjectMocks
+ @Spy
+ private ExecuteBuildingBlockRainyDay executeBuildingBlockRainyDay;
+
+ private DelegateExecution execution;
+ private DelegateExecution executionNullisRollback;
+ private String msoRequestId = "ef7c004b-829f-4773-a7d8-4de29feef5b1";
+ private InfraActiveRequests request = new InfraActiveRequests();
+ private WorkflowException exception;
+ private WorkflowException noExtSystemErrorSourceException;
+
+ @Before
+ public void setup() {
+ exception = new WorkflowException("Test exception", 7000, "", "", TargetEntity.SDNC);
+ noExtSystemErrorSourceException =
+ new WorkflowException("Test exception without extsystemErrorSource", 7000, "", "");
+
+ execution = new DelegateExecutionFake();
+ execution.setVariable("mso-request-id", "ef7c004b-829f-4773-a7d8-4de29feef5b1");
+
+ executionNullisRollback = new DelegateExecutionFake();
+ executionNullisRollback.setVariable("mso-request-id", "ef7c004b-829f-4773-a7d8-4de29feef5b1");
+ }
+
+ @Test
+ public void updateExtSystemErrorSourceTest() {
+ doReturn(request).when(requestsDbClient).getInfraActiveRequestbyRequestId(msoRequestId);
+ doNothing().when(requestsDbClient).updateInfraActiveRequests(request);
+ execution.setVariable("isRollback", false);
+ execution.setVariable("WorkflowException", exception);
+ executeBuildingBlockRainyDay.updateExtSystemErrorSource(execution);
+ request.setExtSystemErrorSource(TargetEntity.SDNC.toString());
+
+ verify(requestsDbClient, Mockito.times(1)).updateInfraActiveRequests(request);
+ }
+
+ @Test
+ public void updateExtSystemErrorSourceisRollbackTest() {
+ doReturn(request).when(requestsDbClient).getInfraActiveRequestbyRequestId(msoRequestId);
+ doNothing().when(requestsDbClient).updateInfraActiveRequests(request);
+ execution.setVariable("isRollback", true);
+ execution.setVariable("WorkflowException", exception);
+ executeBuildingBlockRainyDay.updateExtSystemErrorSource(execution);
+ request.setExtSystemErrorSource(TargetEntity.SDNC.toString());
+
+ verify(requestsDbClient, Mockito.times(1)).updateInfraActiveRequests(request);
+ }
+
+ @Test
+ public void updateExtSystemErrorSourceisRollbackTargetEntityNullTest() {
+ doReturn(request).when(requestsDbClient).getInfraActiveRequestbyRequestId(msoRequestId);
+ doNothing().when(requestsDbClient).updateInfraActiveRequests(request);
+ execution.setVariable("isRollback", true);
+ execution.setVariable("WorkflowException", noExtSystemErrorSourceException);
+ executeBuildingBlockRainyDay.updateExtSystemErrorSource(execution);
+ request.setExtSystemErrorSource(TargetEntity.UNKNOWN.toString());
+
+ verify(requestsDbClient, Mockito.times(1)).updateInfraActiveRequests(request);
+ }
+
+ @Test
+ public void updateExtSystemErrorSourceTargetEntityNullTest() {
+ doReturn(request).when(requestsDbClient).getInfraActiveRequestbyRequestId(msoRequestId);
+ doNothing().when(requestsDbClient).updateInfraActiveRequests(request);
+ execution.setVariable("isRollback", false);
+ execution.setVariable("WorkflowException", noExtSystemErrorSourceException);
+ executeBuildingBlockRainyDay.updateExtSystemErrorSource(execution);
+ request.setExtSystemErrorSource(TargetEntity.UNKNOWN.toString());
+
+ verify(requestsDbClient, Mockito.times(1)).updateInfraActiveRequests(request);
+ }
+
+ @Test
+ public void updateExtSystemErrorSourceTargetEntityisRollbackNullTest() {
+ doReturn(request).when(requestsDbClient).getInfraActiveRequestbyRequestId(msoRequestId);
+ doNothing().when(requestsDbClient).updateInfraActiveRequests(request);
+ executionNullisRollback.setVariable("WorkflowException", exception);
+ executeBuildingBlockRainyDay.updateExtSystemErrorSource(executionNullisRollback);
+ request.setExtSystemErrorSource(TargetEntity.SDNC.toString());
+
+ verify(requestsDbClient, Mockito.times(1)).updateInfraActiveRequests(request);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java
index c5da3cbd51..80373eb760 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java
@@ -38,6 +38,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
+import org.onap.so.constants.Status;
import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
import org.springframework.beans.factory.annotation.Autowired;
@@ -207,6 +208,7 @@ public class ExecuteBuildlingBlockRainyDayTest extends BaseTest {
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
assertEquals("Rollback", delegateExecution.getVariable("handlingCode"));
+ assertEquals(Status.ROLLED_BACK.toString(), delegateExecution.getVariable("rollbackTargetState"));
}
@Test
@@ -232,9 +234,37 @@ public class ExecuteBuildlingBlockRainyDayTest extends BaseTest {
executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
assertEquals("RollbackToAssigned", delegateExecution.getVariable("handlingCode"));
+ assertEquals(Status.ROLLED_BACK_TO_ASSIGNED.toString(), delegateExecution.getVariable("rollbackTargetState"));
}
@Test
+ public void queryRainyDayTableRollbackToCreated() throws Exception {
+ customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
+ serviceInstance.getModelInfoServiceInstance().setServiceType("st1");
+ vnf.setVnfType("vnft1");
+ delegateExecution.setVariable("aLaCarte", true);
+ delegateExecution.setVariable("suppressRollback", false);
+ delegateExecution.setVariable("WorkflowExceptionCode", "7000");
+ RainyDayHandlerStatus rainyDayHandlerStatus = new RainyDayHandlerStatus();
+ rainyDayHandlerStatus.setErrorCode("7000");
+ rainyDayHandlerStatus.setFlowName("AssignServiceInstanceBB");
+ rainyDayHandlerStatus.setServiceType("st1");
+ rainyDayHandlerStatus.setVnfType("vnft1");
+ rainyDayHandlerStatus.setPolicy("RollbackToCreated");
+ rainyDayHandlerStatus.setWorkStep(ASTERISK);
+ rainyDayHandlerStatus.setSecondaryPolicy("Abort");
+
+ doReturn(rainyDayHandlerStatus).when(MOCK_catalogDbClient).getRainyDayHandlerStatus("AssignServiceInstanceBB",
+ "st1", "vnft1", "7000", "*", "errorMessage");
+
+ executeBuildingBlockRainyDay.queryRainyDayTable(delegateExecution, true);
+
+ assertEquals("RollbackToCreated", delegateExecution.getVariable("handlingCode"));
+ assertEquals(Status.ROLLED_BACK_TO_CREATED.toString(), delegateExecution.getVariable("rollbackTargetState"));
+ }
+
+
+ @Test
public void suppressRollbackTest() throws Exception {
delegateExecution.setVariable("suppressRollback", true);
delegateExecution.setVariable("aLaCarte", true);
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderTest.java
index 5f9aef67e6..aae62445de 100644
--- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderTest.java
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderTest.java
@@ -55,6 +55,7 @@ public class ExceptionBuilderTest extends BaseTest {
@Mock
protected ExtractPojosForBB extractPojosForBB;
+
@Spy
@InjectMocks
private ExceptionBuilder exceptionBuilder = new ExceptionBuilder();
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderUnitTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderUnitTest.java
new file mode 100644
index 0000000000..b109ae258d
--- /dev/null
+++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/client/exception/ExceptionBuilderUnitTest.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 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.client.exception;
+
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import org.camunda.bpm.engine.delegate.BpmnError;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.utils.TargetEntity;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ExceptionBuilderUnitTest {
+ @Mock
+ private BuildingBlockExecution buildingBlockExecution;
+
+ @InjectMocks
+ @Spy
+ private ExceptionBuilder exceptionBuilder;
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ private Exception e = new Exception("failure message");
+ private DelegateExecution execution;
+
+ @Before
+ public void setup() {
+ execution = new DelegateExecutionFake();
+ }
+
+
+ @Test
+ public void buildAndThrowWorkflowExceptionTest() {
+ String expectedErrorMessage =
+ "Exception in org.onap.so.client.exception.ExceptionBuilder.buildAndThrowWorkflowException failure message";
+ doNothing().when(exceptionBuilder).buildAndThrowWorkflowException(execution, 7000, expectedErrorMessage,
+ TargetEntity.SDNC);
+
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e, TargetEntity.SDNC);
+
+ verify(exceptionBuilder, times(1)).buildAndThrowWorkflowException(execution, 7000, expectedErrorMessage,
+ TargetEntity.SDNC);
+ }
+
+ @Test
+ public void buildAndThrowWorkflowExceptionBuildingBlockExecutionTest() {
+ String expectedErrorMessage =
+ "Exception in org.onap.so.client.exception.ExceptionBuilder.buildAndThrowWorkflowException failure message";
+ doNothing().when(exceptionBuilder).buildAndThrowWorkflowException(buildingBlockExecution, 7000,
+ expectedErrorMessage, TargetEntity.SDNC);
+
+ exceptionBuilder.buildAndThrowWorkflowException(buildingBlockExecution, 7000, e, TargetEntity.SDNC);
+
+ verify(exceptionBuilder, times(1)).buildAndThrowWorkflowException(buildingBlockExecution, 7000,
+ expectedErrorMessage, TargetEntity.SDNC);
+ }
+
+ @Test
+ public void buildAndThrowWorkflowExceptionWithErrorMessageTest() {
+ doReturn("Process key").when(exceptionBuilder).getProcessKey(execution);
+
+ thrown.expect(BpmnError.class);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), TargetEntity.SDNC);
+ }
+}
diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/InstanceResourceList/InstanceResourceList.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/InstanceResourceList/InstanceResourceList.json
index 0b3d9f0bbe..a111ae2646 100644
--- a/bpmn/MSOCommonBPMN/src/test/resources/__files/InstanceResourceList/InstanceResourceList.json
+++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/InstanceResourceList/InstanceResourceList.json
@@ -67,6 +67,19 @@
}
],
"requestInputs":{
+ "emptygroup_list": [
+ {
+ "topology": "hub_spoke",
+ "name": "defaultvpn",
+ "role":"Hub",
+ "portType":"GE",
+ "portSwitch":"layer3-port",
+ "vlanId":"",
+ "ipAddress":"192.168.10.1",
+ "deviceName":"vCPE",
+ "portNumer":"0/0/1"
+ }
+ ],
"sdwanvpnresource_list":[
{
"sdwanvpn_topology":"hub_spoke",
@@ -117,6 +130,19 @@
"portNumber":"0/0/0",
"ipMode":"DHCP",
"publicIP":"119.3.7.113"
+ },
+ {
+ "providerIpAddress":"",
+ "portType":"GE",
+ "inputBandwidth":"1200",
+ "ipAddress":"",
+ "name":"10001",
+ "transportNetworkName":"internet",
+ "outputBandwidth":"10001",
+ "deviceName":"vCPE",
+ "portNumber":"0/0/0",
+ "ipMode":"DHCP",
+ "publicIP":"119.3.7.114"
}
],
"sdwandevice_list":[
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java
index 1692045d33..7d5bb0dcf1 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/WorkflowException.java
@@ -21,6 +21,7 @@
package org.onap.so.bpmn.core;
import java.io.Serializable;
+import org.onap.so.utils.TargetEntities;
/**
* An object that represents a workflow exception.
@@ -32,6 +33,7 @@ public class WorkflowException implements Serializable {
private final int errorCode;
private final String errorMessage;
private final String workStep;
+ private TargetEntities extSystemErrorSource;
/**
* Constructor
@@ -47,6 +49,15 @@ public class WorkflowException implements Serializable {
workStep = "*";
}
+ public WorkflowException(String processKey, int errorCode, String errorMessage,
+ TargetEntities extSystemErrorSource) {
+ this.processKey = processKey;
+ this.errorCode = errorCode;
+ this.errorMessage = errorMessage;
+ workStep = "*";
+ this.extSystemErrorSource = extSystemErrorSource;
+ }
+
public WorkflowException(String processKey, int errorCode, String errorMessage, String workStep) {
this.processKey = processKey;
this.errorCode = errorCode;
@@ -54,6 +65,15 @@ public class WorkflowException implements Serializable {
this.workStep = workStep;
}
+ public WorkflowException(String processKey, int errorCode, String errorMessage, String workStep,
+ TargetEntities extSystemErrorSource) {
+ this.processKey = processKey;
+ this.errorCode = errorCode;
+ this.errorMessage = errorMessage;
+ this.workStep = workStep;
+ this.extSystemErrorSource = extSystemErrorSource;
+ }
+
/**
* Returns the process key.
*/
@@ -82,12 +102,17 @@ public class WorkflowException implements Serializable {
return workStep;
}
+ public TargetEntities getExtSystemErrorSource() {
+ return extSystemErrorSource;
+ }
+
/**
* Returns a string representation of this object.
*/
@Override
public String toString() {
return getClass().getSimpleName() + "[processKey=" + getProcessKey() + ",errorCode=" + getErrorCode()
- + ",errorMessage=" + getErrorMessage() + ",workStep=" + getWorkStep() + "]";
+ + ",errorMessage=" + getErrorMessage() + ",workStep=" + getWorkStep() + ",extSystemErrorSource="
+ + extSystemErrorSource + "]";
}
}
diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/RollbackData.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/RollbackData.java
index 633736a25a..11b717c0d2 100644
--- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/RollbackData.java
+++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/RollbackData.java
@@ -29,7 +29,7 @@ public class RollbackData implements Serializable {
private static final long serialVersionUID = -4811571658272937718L;
private String requestId;
- private Map<String, String> additionalData = new HashMap<String, String>();
+ private Map<String, String> additionalData = new HashMap<>();
public String getRequestId() {
diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/xml/XmlToolTest.java b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/xml/XmlToolTest.java
index d099cbebcc..b6bccdb5c9 100644
--- a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/xml/XmlToolTest.java
+++ b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/xml/XmlToolTest.java
@@ -28,7 +28,7 @@ public class XmlToolTest {
private String encodeResponseNamespace =
"<Response xmlns:ns2=\"http://ecomp.att.com/mso/request/types/v1\">good</Response>";
private String attribute = "<Response>good&\"bad\"</Response>";
- private String updatedAttribute = "&lt;Response&gt;good&amp;&quot;bad&quot;&lt;/Response&gt;";
+ // private String updatedAttribute = "&lt;Response&gt;good&amp;&quot;bad&quot;&lt;/Response&gt;";
private String content = "<dummy><configuration-event>" + "<event-type>test</event-type>"
+ "<event-correlator-type>test</event-correlator-type>" + "<event-correlator>123</event-correlator>"
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java
index e8e4b85cae..ace6e1937d 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java
@@ -101,7 +101,7 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService {
try {
MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, getRequestId(inputVariables));
processor.startProcess(processKey, variableMap);
- WorkflowResponse response = waitForResponse(getRequestId(inputVariables));
+ WorkflowResponse response = waitForResponse(inputVariables);
return Response.status(202).entity(response).build();
} catch (WorkflowProcessorException e) {
WorkflowResponse response = e.getWorkflowResponse();
@@ -112,9 +112,12 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService {
}
}
- private WorkflowResponse waitForResponse(String requestId) throws Exception {
+ private WorkflowResponse waitForResponse(Map<String, Object> inputVariables) throws Exception {
+ String requestId = getRequestId(inputVariables);
long currentWaitTime = 0;
- while (DEFAULT_WAIT_TIME > currentWaitTime) {
+ long waitTime = getWaitTime(inputVariables);
+ logger.debug("WorkflowAsyncResource.waitForResponse using timeout: " + waitTime);
+ while (waitTime > currentWaitTime) {
Thread.sleep(workflowPollInterval);
currentWaitTime = currentWaitTime + workflowPollInterval;
WorkflowContext foundContext = contextHolder.getWorkflowContext(requestId);
@@ -123,7 +126,7 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService {
return buildResponse(foundContext);
}
}
- throw new Exception("TimeOutOccured");
+ throw new Exception("TimeOutOccured in WorkflowAsyncResource.waitForResponse for time " + waitTime + "ms");
}
private WorkflowResponse buildUnkownError(String requestId, String error) {
@@ -171,4 +174,25 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService {
return inputVariables;
}
+ /**
+ * Returns the wait time, this is used by the resource on how long it should wait to send a response If none
+ * specified DEFAULT_WAIT_TIME is used
+ *
+ * @param inputVariables
+ * @return
+ */
+ private long getWaitTime(Map<String, Object> inputVariables) {
+ String timeout = inputVariables.get("mso-service-request-timeout") == null ? null
+ : inputVariables.get("mso-service-request-timeout").toString();
+
+ if (timeout != null) {
+ try {
+ return Long.parseLong(timeout) * 1000;
+ } catch (NumberFormatException nex) {
+ logger.debug("Invalid input for mso-service-request-timeout");
+ }
+ }
+ return DEFAULT_WAIT_TIME;
+ }
+
}
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
index 4e9e9fdf0e..d33e7aed0c 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java
@@ -45,8 +45,7 @@ public class WorkflowProcessor extends ProcessEngineAwareService {
@Async
public void startProcess(String processKey, VariableMapImpl variableMap) {
- long startTime = System.currentTimeMillis();
- Map<String, Object> inputVariables = null;
+ Map<String, Object> inputVariables;
String processInstanceId = null;
try {
inputVariables = getInputVariables(variableMap);
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
index 20f3eb4fee..bcc3739c32 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowResource.java
@@ -116,7 +116,7 @@ public class WorkflowResource extends ProcessEngineAwareService {
long timeToWaitAfterProcessEnded = uriInfo == null ? 5000 : 60000;
AtomicLong timeProcessEnded = new AtomicLong(0);
boolean endedWithNoResponse = false;
-
+ logger.debug(LOGMARKER + "WorkflowResource.startProcessInstanceByKey using timeout: " + waitTime);
while (now <= endTime) {
Thread.sleep(pollingInterval);
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java
index 6572beaba9..a049f81906 100644
--- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java
+++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/CXFConfiguration.java
@@ -52,8 +52,6 @@ import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
@Configuration
public class CXFConfiguration {
- private static final Logger logger = LoggerFactory.getLogger(CXFConfiguration.class);
-
@Autowired
private Bus bus;
diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/BPMNUtil.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/BPMNUtil.java
index f417a550d1..a94713e9e0 100644
--- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/BPMNUtil.java
+++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/BPMNUtil.java
@@ -317,7 +317,8 @@ public class BPMNUtil {
*/
static class ProcessThread extends Thread {
- public WorkflowResponse workflowResponse = null;
+ public WorkflowResponse workflowResponse;
+ // public WorkflowResponse workflowResponse = null;
public String processKey;
public boolean started;
public ProcessEngineServices processEngineServices;
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 33335ab2c4..ca0f8452cf 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
@@ -2,13 +2,12 @@
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0">
<bpmn:process id="DeleteVfModuleBB" name="DeleteVfModuleBB" isExecutable="true">
<bpmn:startEvent id="DeleteVfModuleBB_Start">
- <bpmn:outgoing>SequenceFlow_1537yw5</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1oeootm</bpmn:outgoing>
</bpmn:startEvent>
- <bpmn:serviceTask id="DeleteVfModuleVnfAdapter" name="Delete Vf Module VnfAdapter" camunda:expression="${VnfAdapterDeleteTasks.deleteVfModule(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_1n8gab5</bpmn:incoming>
+ <bpmn:serviceTask id="DeleteVfModuleVnfAdapter" name="Prepare Request" camunda:expression="${VnfAdapterDeleteTasks.deleteVfModule(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
+ <bpmn:incoming>SequenceFlow_028rmiu</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_08tvhtf</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1537yw5" sourceRef="DeleteVfModuleBB_Start" targetRef="ExclusiveGateway_0xrgzm7" />
<bpmn:serviceTask id="UpdateVfModuleDeleteStatus" name="&#10;AAI &#10;Update&#10;(vf module)&#10;" camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusDeleteVfModule(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
<bpmn:incoming>SequenceFlow_01vfwtp</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_09l7pcg</bpmn:outgoing>
@@ -70,44 +69,22 @@
<bpmn:incoming>SequenceFlow_0khqfnc</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0yuz21z</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1n8gab5" sourceRef="ExclusiveGateway_0xrgzm7" targetRef="DeleteVfModuleVnfAdapter" />
- <bpmn:parallelGateway id="ExclusiveGateway_0xrgzm7">
- <bpmn:incoming>SequenceFlow_1537yw5</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1n8gab5</bpmn:outgoing>
- <bpmn:outgoing>SequenceFlow_1v3jgqe</bpmn:outgoing>
- </bpmn:parallelGateway>
- <bpmn:sequenceFlow id="SequenceFlow_032jv5j" name="Yes&#10;" sourceRef="ExclusiveGateway_1h2ystu" targetRef="Setup_Audit_Variable">
+ <bpmn:sequenceFlow id="SequenceFlow_032jv5j" name="Yes&#10;" sourceRef="auditEnabledCheck" targetRef="Setup_Audit_Variable">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("auditInventoryNeeded") == true}]]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
- <bpmn:sequenceFlow id="SequenceFlow_0qfmmgt" sourceRef="Audit_Inventory" targetRef="auditSuccessfulCheck" />
<bpmn:sequenceFlow id="SequenceFlow_14bu4ys" sourceRef="ExclusiveGateway_1yvh16a" targetRef="aaiThrow" />
- <bpmn:sequenceFlow id="SequenceFlow_1mgunf3" name="No" sourceRef="ExclusiveGateway_1h2ystu" targetRef="ExclusiveGateway_1pydilb" />
<bpmn:serviceTask id="Check_Audit" name="Check Audit Variable" camunda:expression="${AuditTasks.isDeleteAuditNeeded(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
- <bpmn:incoming>SequenceFlow_1v3jgqe</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1odt2wt</bpmn:outgoing>
+ <bpmn:incoming>SequenceFlow_1oeootm</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_10af0fk</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1v3jgqe" sourceRef="ExclusiveGateway_0xrgzm7" targetRef="Check_Audit" />
- <bpmn:sequenceFlow id="SequenceFlow_1odt2wt" sourceRef="Check_Audit" targetRef="ExclusiveGateway_1h2ystu" />
- <bpmn:sequenceFlow id="SequenceFlow_1swistn" sourceRef="Setup_Audit_Variable" targetRef="Audit_Inventory" />
- <bpmn:serviceTask id="Audit_Inventory" name="Audit Inventory For Delete in AAI" camunda:type="external" camunda:topic="InventoryDeleteAudit">
- <bpmn:incoming>SequenceFlow_1swistn</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0qfmmgt</bpmn:outgoing>
+ <bpmn:serviceTask id="Audit_Inventory" name="&#10;AAI&#10;Audit&#10;(vservers)&#10;" camunda:type="external" camunda:topic="InventoryDeleteAudit">
+ <bpmn:incoming>SequenceFlow_0f5ljoh</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0hpj2mm</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:serviceTask id="Setup_Audit_Variable" name="Setup Audit Variable" camunda:expression="${AuditTasks.setupAuditVariable(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
<bpmn:incoming>SequenceFlow_032jv5j</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1swistn</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1iulltd</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1ut7n32" sourceRef="ExclusiveGateway_1pydilb" targetRef="ExclusiveGateway_1yvh16a" />
- <bpmn:exclusiveGateway id="ExclusiveGateway_1h2ystu" name="Audit&#10; Enabled?" default="SequenceFlow_1mgunf3">
- <bpmn:incoming>SequenceFlow_1odt2wt</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_032jv5j</bpmn:outgoing>
- <bpmn:outgoing>SequenceFlow_1mgunf3</bpmn:outgoing>
- </bpmn:exclusiveGateway>
- <bpmn:exclusiveGateway id="ExclusiveGateway_1pydilb">
- <bpmn:incoming>SequenceFlow_1mgunf3</bpmn:incoming>
- <bpmn:incoming>SequenceFlow_17cd9e2</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1ut7n32</bpmn:outgoing>
- </bpmn:exclusiveGateway>
<bpmn:subProcess id="SubProcess_0grvkj2" name="Audit Exception Sub Process" triggeredByEvent="true">
<bpmn:endEvent id="EndEvent_1gzq57j">
<bpmn:incoming>SequenceFlow_1fhst92</bpmn:incoming>
@@ -120,7 +97,7 @@
<bpmn:sequenceFlow id="SequenceFlow_1fhst92" sourceRef="ServiceTask_1isbxvo" targetRef="EndEvent_1gzq57j" />
<bpmn:startEvent id="StartEvent_1euiddy" isInterrupting="false">
<bpmn:outgoing>SequenceFlow_0xuodpy</bpmn:outgoing>
- <bpmn:escalationEventDefinition escalationRef="Escalation_130je8j" camunda:escalationCodeVariable="test" />
+ <bpmn:escalationEventDefinition escalationRef="Escalation_130je8j" camunda:escalationCodeVariable="auditCode" />
</bpmn:startEvent>
</bpmn:subProcess>
<bpmn:sequenceFlow id="SequenceFlow_179btn2" sourceRef="aaiCatch" targetRef="DeleteNetworkPolicies" />
@@ -132,19 +109,14 @@
<bpmn:outgoing>SequenceFlow_179btn2</bpmn:outgoing>
<bpmn:linkEventDefinition name="AAI" />
</bpmn:intermediateCatchEvent>
- <bpmn:sequenceFlow id="SequenceFlow_17cd9e2" name="Yes/No" sourceRef="auditSuccessfulCheck" targetRef="ExclusiveGateway_1pydilb">
+ <bpmn:sequenceFlow id="SequenceFlow_17cd9e2" name="Yes/No" sourceRef="auditSuccessfulCheck" targetRef="ExclusiveGateway_01wvywu">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("auditIsSuccessful") == false || execution.getVariable("auditIsSuccessful") == true}]]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_1gdyk9j" name="No" sourceRef="auditSuccessfulCheck" targetRef="EndEvent_0b0ocu0">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("auditIsSuccessful") == false}]]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
- <bpmn:inclusiveGateway id="ExclusiveGateway_1yvh16a">
- <bpmn:incoming>SequenceFlow_02lpx87</bpmn:incoming>
- <bpmn:incoming>SequenceFlow_1ut7n32</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_14bu4ys</bpmn:outgoing>
- </bpmn:inclusiveGateway>
<bpmn:inclusiveGateway id="auditSuccessfulCheck" name="Audit&#10; Successful?">
- <bpmn:incoming>SequenceFlow_0qfmmgt</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_0hpj2mm</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_17cd9e2</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_1gdyk9j</bpmn:outgoing>
</bpmn:inclusiveGateway>
@@ -152,6 +124,54 @@
<bpmn:incoming>SequenceFlow_1gdyk9j</bpmn:incoming>
<bpmn:escalationEventDefinition escalationRef="Escalation_130je8j" />
</bpmn:endEvent>
+ <bpmn:exclusiveGateway id="auditEnabledCheck" name="Audit&#10; Enabled?" default="SequenceFlow_1bt1p2u">
+ <bpmn:incoming>SequenceFlow_10af0fk</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_032jv5j</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1bt1p2u</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_1t9q2jl">
+ <bpmn:incoming>SequenceFlow_1bt1p2u</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_0dzf7hz</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1bq9g02</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_1bt1p2u" name="No" sourceRef="auditEnabledCheck" targetRef="ExclusiveGateway_1t9q2jl" />
+ <bpmn:sequenceFlow id="SequenceFlow_1oeootm" sourceRef="DeleteVfModuleBB_Start" targetRef="Check_Audit" />
+ <bpmn:sequenceFlow id="SequenceFlow_10af0fk" sourceRef="Check_Audit" targetRef="auditEnabledCheck" />
+ <bpmn:serviceTask id="aicQueryStack" name="&#10;AIC&#10;Query&#10;(stack)&#10;" camunda:type="external" camunda:topic="InventoryQueryAudit">
+ <bpmn:incoming>SequenceFlow_1iulltd</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0dzf7hz</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1iulltd" sourceRef="Setup_Audit_Variable" targetRef="aicQueryStack" />
+ <bpmn:sequenceFlow id="SequenceFlow_0dzf7hz" sourceRef="aicQueryStack" targetRef="ExclusiveGateway_1t9q2jl" />
+ <bpmn:sequenceFlow id="SequenceFlow_1bq9g02" sourceRef="ExclusiveGateway_1t9q2jl" targetRef="ExclusiveGateway_1naduhl" />
+ <bpmn:sequenceFlow id="SequenceFlow_0mtzl4z" sourceRef="ExclusiveGateway_1naduhl" targetRef="ExclusiveGateway_13fhmpf" />
+ <bpmn:sequenceFlow id="SequenceFlow_028rmiu" sourceRef="ExclusiveGateway_1naduhl" targetRef="DeleteVfModuleVnfAdapter" />
+ <bpmn:parallelGateway id="ExclusiveGateway_1naduhl">
+ <bpmn:incoming>SequenceFlow_1bq9g02</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0mtzl4z</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_028rmiu</bpmn:outgoing>
+ </bpmn:parallelGateway>
+ <bpmn:inclusiveGateway id="ExclusiveGateway_1yvh16a">
+ <bpmn:incoming>SequenceFlow_02lpx87</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_13mlz57</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_14bu4ys</bpmn:outgoing>
+ </bpmn:inclusiveGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_0hpj2mm" sourceRef="Audit_Inventory" targetRef="auditSuccessfulCheck" />
+ <bpmn:exclusiveGateway id="ExclusiveGateway_13fhmpf" name="Audit&#10; Enabled?" default="SequenceFlow_1gjwivp">
+ <bpmn:incoming>SequenceFlow_0mtzl4z</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0f5ljoh</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1gjwivp</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_0f5ljoh" name="Yes" sourceRef="ExclusiveGateway_13fhmpf" targetRef="Audit_Inventory">
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("auditInventoryNeeded") == true}]]></bpmn:conditionExpression>
+ </bpmn:sequenceFlow>
+ <bpmn:exclusiveGateway id="ExclusiveGateway_01wvywu">
+ <bpmn:incoming>SequenceFlow_17cd9e2</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_1gjwivp</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_13mlz57</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_1gjwivp" name="No" sourceRef="ExclusiveGateway_13fhmpf" targetRef="ExclusiveGateway_01wvywu" />
+ <bpmn:sequenceFlow id="SequenceFlow_13mlz57" sourceRef="ExclusiveGateway_01wvywu" targetRef="ExclusiveGateway_1yvh16a" />
</bpmn:process>
<bpmn:error id="Error_0jjnve8" name="Error_3k24na6" errorCode="AAIInventoryFailure" />
<bpmn:escalation id="Escalation_130je8j" name="audit" escalationCode="audit1" />
@@ -164,40 +184,33 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_16798zf_di" bpmnElement="DeleteVfModuleVnfAdapter">
- <dc:Bounds x="382" y="303" width="100" height="80" />
+ <dc:Bounds x="888" y="312" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1537yw5_di" bpmnElement="SequenceFlow_1537yw5">
- <di:waypoint xsi:type="dc:Point" x="195" y="284" />
- <di:waypoint xsi:type="dc:Point" x="282" y="284" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="194" y="263" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0pbhsub_di" bpmnElement="UpdateVfModuleDeleteStatus">
<dc:Bounds x="907" y="468" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_08tvhtf_di" bpmnElement="SequenceFlow_08tvhtf">
- <di:waypoint xsi:type="dc:Point" x="482" y="343" />
- <di:waypoint xsi:type="dc:Point" x="511" y="343" />
+ <di:waypoint xsi:type="dc:Point" x="988" y="352" />
+ <di:waypoint xsi:type="dc:Point" x="1020" y="352" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="452" y="322" width="90" height="12" />
+ <dc:Bounds x="959" y="331" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_1rn6yvh_di" bpmnElement="DeleteVfModuleBB_End">
- <dc:Bounds x="1136" y="490" width="36" height="36" />
+ <dc:Bounds x="1268" y="490" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1109" y="530" width="90" height="0" />
+ <dc:Bounds x="1241" y="530" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_0whogn3_di" bpmnElement="VnfAdapter">
- <dc:Bounds x="511" y="303" width="100" height="80" />
+ <dc:Bounds x="1020" y="312" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_02lpx87_di" bpmnElement="SequenceFlow_02lpx87">
- <di:waypoint xsi:type="dc:Point" x="611" y="343" />
- <di:waypoint xsi:type="dc:Point" x="925" y="343" />
- <di:waypoint xsi:type="dc:Point" x="925" y="309" />
+ <di:waypoint xsi:type="dc:Point" x="1120" y="352" />
+ <di:waypoint xsi:type="dc:Point" x="1203" y="352" />
+ <di:waypoint xsi:type="dc:Point" x="1203" y="309" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="723" y="328" width="90" height="0" />
+ <dc:Bounds x="1116.5" y="337" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="SubProcess_11p7mrh_di" bpmnElement="SubProcess_11p7mrh" isExpanded="true">
@@ -234,9 +247,9 @@
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_09l7pcg_di" bpmnElement="SequenceFlow_09l7pcg">
<di:waypoint xsi:type="dc:Point" x="1007" y="508" />
- <di:waypoint xsi:type="dc:Point" x="1136" y="508" />
+ <di:waypoint xsi:type="dc:Point" x="1268" y="508" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1027" y="493" width="90" height="0" />
+ <dc:Bounds x="1092.5" y="493" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0xyu3pk_di" bpmnElement="SequenceFlow_0xyu3pk">
@@ -279,101 +292,29 @@
<bpmndi:BPMNShape id="ServiceTask_0v8naz9_di" bpmnElement="UpdateVfModuleContrailServiceInstanceFqdn">
<dc:Bounds x="654" y="468" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1n8gab5_di" bpmnElement="SequenceFlow_1n8gab5">
- <di:waypoint xsi:type="dc:Point" x="307" y="309" />
- <di:waypoint xsi:type="dc:Point" x="307" y="343" />
- <di:waypoint xsi:type="dc:Point" x="382" y="343" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="277" y="320" width="90" height="13" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ParallelGateway_18x6mx2_di" bpmnElement="ExclusiveGateway_0xrgzm7">
- <dc:Bounds x="282" y="259" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="262" y="312" width="90" height="13" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_032jv5j_di" bpmnElement="SequenceFlow_032jv5j">
- <di:waypoint xsi:type="dc:Point" x="492" y="174" />
- <di:waypoint xsi:type="dc:Point" x="492" y="133" />
- <di:waypoint xsi:type="dc:Point" x="531" y="133" />
+ <di:waypoint xsi:type="dc:Point" x="397" y="259" />
+ <di:waypoint xsi:type="dc:Point" x="397" y="214" />
+ <di:waypoint xsi:type="dc:Point" x="444" y="214" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="499" y="139" width="19" height="24" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0qfmmgt_di" bpmnElement="SequenceFlow_0qfmmgt">
- <di:waypoint xsi:type="dc:Point" x="754" y="133" />
- <di:waypoint xsi:type="dc:Point" x="780" y="133" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="722" y="111.5" width="90" height="13" />
+ <dc:Bounds x="405.5348837209302" y="217.95121951219514" width="19" height="24" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_14bu4ys_di" bpmnElement="SequenceFlow_14bu4ys">
- <di:waypoint xsi:type="dc:Point" x="950" y="284" />
- <di:waypoint xsi:type="dc:Point" x="1100" y="283" />
+ <di:waypoint xsi:type="dc:Point" x="1228" y="284" />
+ <di:waypoint xsi:type="dc:Point" x="1323" y="284" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="980" y="262" width="90" height="13" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1mgunf3_di" bpmnElement="SequenceFlow_1mgunf3">
- <di:waypoint xsi:type="dc:Point" x="492" y="224" />
- <di:waypoint xsi:type="dc:Point" x="492" y="257" />
- <di:waypoint xsi:type="dc:Point" x="868" y="257" />
- <di:waypoint xsi:type="dc:Point" x="868" y="224" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="503.9261744966443" y="237" width="14" height="12" />
+ <dc:Bounds x="1230.5" y="262.5" width="90" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_1vmz3zo_di" bpmnElement="Check_Audit">
- <dc:Bounds x="339" y="159" width="100" height="80" />
+ <dc:Bounds x="244" y="244" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1v3jgqe_di" bpmnElement="SequenceFlow_1v3jgqe">
- <di:waypoint xsi:type="dc:Point" x="307" y="259" />
- <di:waypoint xsi:type="dc:Point" x="307" y="199" />
- <di:waypoint xsi:type="dc:Point" x="339" y="199" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="277" y="223" width="90" height="13" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1odt2wt_di" bpmnElement="SequenceFlow_1odt2wt">
- <di:waypoint xsi:type="dc:Point" x="439" y="199" />
- <di:waypoint xsi:type="dc:Point" x="467" y="199" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="408" y="178" width="90" height="13" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1swistn_di" bpmnElement="SequenceFlow_1swistn">
- <di:waypoint xsi:type="dc:Point" x="631" y="133" />
- <di:waypoint xsi:type="dc:Point" x="654" y="133" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="598" y="112" width="90" height="13" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_1l8r2a6_di" bpmnElement="Audit_Inventory">
- <dc:Bounds x="654" y="93" width="100" height="80" />
+ <dc:Bounds x="930" y="117" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1gttdjr_di" bpmnElement="Setup_Audit_Variable">
- <dc:Bounds x="531" y="93" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1ut7n32_di" bpmnElement="SequenceFlow_1ut7n32">
- <di:waypoint xsi:type="dc:Point" x="893" y="199" />
- <di:waypoint xsi:type="dc:Point" x="925" y="199" />
- <di:waypoint xsi:type="dc:Point" x="925" y="259" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="864" y="177.5" width="90" height="13" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ExclusiveGateway_1olwkdn_di" bpmnElement="ExclusiveGateway_1h2ystu" isMarkerVisible="true">
- <dc:Bounds x="467" y="174" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="519" y="187" width="45" height="24" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ExclusiveGateway_1d1pmqz_di" bpmnElement="ExclusiveGateway_1pydilb" isMarkerVisible="true">
- <dc:Bounds x="843" y="174" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="733" y="227" width="90" height="13" />
- </bpmndi:BPMNLabel>
+ <dc:Bounds x="444" y="174" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="SubProcess_0grvkj2_di" bpmnElement="SubProcess_0grvkj2" isExpanded="true">
<dc:Bounds x="231" y="642" width="350" height="200" />
@@ -409,9 +350,9 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="IntermediateThrowEvent_1sftyjz_di" bpmnElement="aaiThrow">
- <dc:Bounds x="1100" y="266" width="36" height="36" />
+ <dc:Bounds x="1323" y="266" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1092" y="305" width="55" height="12" />
+ <dc:Bounds x="1315" y="305" width="55" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateCatchEvent_13y483m_di" bpmnElement="aaiCatch">
@@ -421,30 +362,26 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_17cd9e2_di" bpmnElement="SequenceFlow_17cd9e2">
- <di:waypoint xsi:type="dc:Point" x="830" y="133" />
- <di:waypoint xsi:type="dc:Point" x="868" y="133" />
- <di:waypoint xsi:type="dc:Point" x="868" y="174" />
+ <di:waypoint xsi:type="dc:Point" x="1108" y="157" />
+ <di:waypoint xsi:type="dc:Point" x="1156" y="157" />
+ <di:waypoint xsi:type="dc:Point" x="1156" y="189" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="830" y="114" width="36" height="12" />
+ <dc:Bounds x="1111.0434782608695" y="137" width="36" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1gdyk9j_di" bpmnElement="SequenceFlow_1gdyk9j">
- <di:waypoint xsi:type="dc:Point" x="805" y="108" />
- <di:waypoint xsi:type="dc:Point" x="805" y="56" />
+ <di:waypoint xsi:type="dc:Point" x="1083" y="132" />
+ <di:waypoint xsi:type="dc:Point" x="1083" y="109" />
+ <di:waypoint xsi:type="dc:Point" x="1083" y="109" />
+ <di:waypoint xsi:type="dc:Point" x="1083" y="84" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="812" y="77" width="14" height="12" />
+ <dc:Bounds x="1083" y="110.74468085106383" width="14" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="InclusiveGateway_0cjvlht_di" bpmnElement="ExclusiveGateway_1yvh16a">
- <dc:Bounds x="900" y="259" width="50" height="50" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="879" y="312" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="InclusiveGateway_0i6rdd1_di" bpmnElement="auditSuccessfulCheck">
- <dc:Bounds x="780" y="108" width="50" height="50" />
+ <dc:Bounds x="1058" y="132" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="775" y="162" width="60" height="24" />
+ <dc:Bounds x="1053" y="186" width="60" height="24" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_04qhoba_di" bpmnElement="StartEvent_1euiddy">
@@ -454,11 +391,143 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1onxfk1_di" bpmnElement="EndEvent_0b0ocu0">
- <dc:Bounds x="787" y="20" width="36" height="36" />
+ <dc:Bounds x="1065" y="48" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1024" y="87" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_05scr6c_di" bpmnElement="auditEnabledCheck" isMarkerVisible="true">
+ <dc:Bounds x="371.6051332675222" y="259" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="421" y="272" width="45" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_1t9q2jl_di" bpmnElement="ExclusiveGateway_1t9q2jl" isMarkerVisible="true">
+ <dc:Bounds x="697" y="259" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="677" y="313" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1bt1p2u_di" bpmnElement="SequenceFlow_1bt1p2u">
+ <di:waypoint xsi:type="dc:Point" x="397" y="309" />
+ <di:waypoint xsi:type="dc:Point" x="397" y="352" />
+ <di:waypoint xsi:type="dc:Point" x="722" y="352" />
+ <di:waypoint xsi:type="dc:Point" x="722" y="309" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="407" y="326" width="14" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1oeootm_di" bpmnElement="SequenceFlow_1oeootm">
+ <di:waypoint xsi:type="dc:Point" x="195" y="284" />
+ <di:waypoint xsi:type="dc:Point" x="244" y="284" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="219.5" y="263" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_10af0fk_di" bpmnElement="SequenceFlow_10af0fk">
+ <di:waypoint xsi:type="dc:Point" x="344" y="284" />
+ <di:waypoint xsi:type="dc:Point" x="372" y="284" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="358" y="263" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_1l7z1c0_di" bpmnElement="aicQueryStack">
+ <dc:Bounds x="571" y="174" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1iulltd_di" bpmnElement="SequenceFlow_1iulltd">
+ <di:waypoint xsi:type="dc:Point" x="544" y="214" />
+ <di:waypoint xsi:type="dc:Point" x="571" y="214" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="557.5" y="193" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0dzf7hz_di" bpmnElement="SequenceFlow_0dzf7hz">
+ <di:waypoint xsi:type="dc:Point" x="671" y="214" />
+ <di:waypoint xsi:type="dc:Point" x="722" y="214" />
+ <di:waypoint xsi:type="dc:Point" x="722" y="259" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="651.5" y="193" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1bq9g02_di" bpmnElement="SequenceFlow_1bq9g02">
+ <di:waypoint xsi:type="dc:Point" x="747" y="284" />
+ <di:waypoint xsi:type="dc:Point" x="796" y="284" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="726.5" y="263" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0mtzl4z_di" bpmnElement="SequenceFlow_0mtzl4z">
+ <di:waypoint xsi:type="dc:Point" x="821" y="259" />
+ <di:waypoint xsi:type="dc:Point" x="821" y="214" />
+ <di:waypoint xsi:type="dc:Point" x="846" y="214" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="791" y="231" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_028rmiu_di" bpmnElement="SequenceFlow_028rmiu">
+ <di:waypoint xsi:type="dc:Point" x="821" y="309" />
+ <di:waypoint xsi:type="dc:Point" x="821" y="352" />
+ <di:waypoint xsi:type="dc:Point" x="888" y="352" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="791" y="324.5" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ParallelGateway_1we1ooj_di" bpmnElement="ExclusiveGateway_1naduhl">
+ <dc:Bounds x="796" y="259" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="760" y="59" width="0" height="12" />
+ <dc:Bounds x="775" y="313" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="InclusiveGateway_07wvmp4_di" bpmnElement="ExclusiveGateway_1yvh16a">
+ <dc:Bounds x="1178" y="259" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1067" y="312" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0hpj2mm_di" bpmnElement="SequenceFlow_0hpj2mm">
+ <di:waypoint xsi:type="dc:Point" x="1030" y="157" />
+ <di:waypoint xsi:type="dc:Point" x="1058" y="157" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="999" y="136" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_13fhmpf_di" bpmnElement="ExclusiveGateway_13fhmpf" isMarkerVisible="true">
+ <dc:Bounds x="846" y="189" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="898" y="202" width="45" height="24" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0f5ljoh_di" bpmnElement="SequenceFlow_0f5ljoh">
+ <di:waypoint xsi:type="dc:Point" x="871" y="189" />
+ <di:waypoint xsi:type="dc:Point" x="871" y="157" />
+ <di:waypoint xsi:type="dc:Point" x="930" y="157" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="877.601615925754" y="162.89580806038546" width="19" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ExclusiveGateway_01wvywu_di" bpmnElement="ExclusiveGateway_01wvywu" isMarkerVisible="true">
+ <dc:Bounds x="1131" y="189" width="50" height="50" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1111" y="243" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1gjwivp_di" bpmnElement="SequenceFlow_1gjwivp">
+ <di:waypoint xsi:type="dc:Point" x="871" y="239" />
+ <di:waypoint xsi:type="dc:Point" x="871" y="266" />
+ <di:waypoint xsi:type="dc:Point" x="1156" y="266" />
+ <di:waypoint xsi:type="dc:Point" x="1156" y="239" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="879" y="244" width="14" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_13mlz57_di" bpmnElement="SequenceFlow_13mlz57">
+ <di:waypoint xsi:type="dc:Point" x="1181" y="214" />
+ <di:waypoint xsi:type="dc:Point" x="1203" y="214" />
+ <di:waypoint xsi:type="dc:Point" x="1203" y="259" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1147" y="193" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </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 0a6a7731ce..e64c44eb94 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
@@ -11,6 +11,7 @@
<camunda:in source="mso-request-id" target="mso-request-id" />
<camunda:out source="WorkflowExceptionErrorMessage" target="WorkflowExceptionErrorMessage" />
<camunda:out source="StatusMessage" target="StatusMessage" />
+ <camunda:in source="isRollback" target="isRollback" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_19wuics</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_01h9qmz</bpmn:outgoing>
@@ -37,13 +38,8 @@
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_0je0y25" sourceRef="StatusPolicy" targetRef="CheckOrchestrationStatusValidationResults" />
<bpmn:subProcess id="SubProcess_0tv8zda" name="Error Handling&#10;&#10;" triggeredByEvent="true">
- <bpmn:startEvent id="StartEvent_0tmcs9g">
- <bpmn:outgoing>SequenceFlow_09synl9</bpmn:outgoing>
- <bpmn:errorEventDefinition camunda:errorCodeVariable="WorkflowExceptionCode" camunda:errorMessageVariable="WorkflowExceptionMessage" />
- </bpmn:startEvent>
- <bpmn:sequenceFlow id="SequenceFlow_09synl9" sourceRef="StartEvent_0tmcs9g" targetRef="Task_QueryRainyDayTable" />
<bpmn:serviceTask id="Task_QueryRainyDayTable" name="QueryRainyDayTable" camunda:expression="${ExecuteBuildingBlockRainyDay.queryRainyDayTable(execution,true)}">
- <bpmn:incoming>SequenceFlow_09synl9</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_0vdeqxv</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0a62t4c</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:exclusiveGateway id="ExclusiveGateway_1aonzik" name="Check HandlingCode" default="SequenceFlow_0h8v45y">
@@ -93,6 +89,16 @@
<bpmn:incoming>SequenceFlow_0541bid</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_12ps9at</bpmn:outgoing>
</bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0vdeqxv" sourceRef="Task_UpdateExtErrorSource" targetRef="Task_QueryRainyDayTable" />
+ <bpmn:sequenceFlow id="SequenceFlow_09synl9" sourceRef="StartEvent_0tmcs9g" targetRef="Task_UpdateExtErrorSource" />
+ <bpmn:startEvent id="StartEvent_0tmcs9g">
+ <bpmn:outgoing>SequenceFlow_09synl9</bpmn:outgoing>
+ <bpmn:errorEventDefinition camunda:errorCodeVariable="WorkflowExceptionCode" camunda:errorMessageVariable="WorkflowExceptionMessage" />
+ </bpmn:startEvent>
+ <bpmn:serviceTask id="Task_UpdateExtErrorSource" name="Update ExtErrorSource" camunda:expression="${ExecuteBuildingBlockRainyDay.updateExtSystemErrorSource(execution)}">
+ <bpmn:incoming>SequenceFlow_09synl9</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0vdeqxv</bpmn:outgoing>
+ </bpmn:serviceTask>
</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">
@@ -163,63 +169,63 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_0ey4zpt_di" bpmnElement="ExclusiveGateway_0ey4zpt" isMarkerVisible="true">
- <dc:Bounds x="721" y="385" width="50" height="50" />
+ <dc:Bounds x="692" y="389" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="716" y="360" width="63" height="13" />
+ <dc:Bounds x="686" y="364" width="65" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateCatchEvent_0qjyidb_di" bpmnElement="IntermediateCatchEvent_RetryTimer">
- <dc:Bounds x="965" y="392" width="36" height="36" />
+ <dc:Bounds x="936" y="396" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="956" y="367" width="55" height="13" />
+ <dc:Bounds x="927" y="371" width="56" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_1aonzik_di" bpmnElement="ExclusiveGateway_1aonzik" isMarkerVisible="true">
- <dc:Bounds x="568" y="385" width="50" height="50" />
+ <dc:Bounds x="539" y="389" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="558" y="347" width="70" height="25" />
+ <dc:Bounds x="528" y="351" width="72" height="24" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1wbevp0_di" bpmnElement="SequenceFlow_1wbevp0">
- <di:waypoint xsi:type="dc:Point" x="771" y="410" />
- <di:waypoint xsi:type="dc:Point" x="836" y="410" />
+ <di:waypoint xsi:type="dc:Point" x="742" y="414" />
+ <di:waypoint xsi:type="dc:Point" x="807" y="414" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="788" y="385" width="18" height="13" />
+ <dc:Bounds x="759" y="389" width="19" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0fwsjva_di" bpmnElement="SequenceFlow_0fwsjva">
- <di:waypoint xsi:type="dc:Point" x="618" y="410" />
- <di:waypoint xsi:type="dc:Point" x="721" y="410" />
+ <di:waypoint xsi:type="dc:Point" x="589" y="414" />
+ <di:waypoint xsi:type="dc:Point" x="692" y="414" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="656" y="418" width="27" height="13" />
+ <dc:Bounds x="627" y="422" width="28" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0h8v45y_di" bpmnElement="SequenceFlow_0h8v45y">
- <di:waypoint xsi:type="dc:Point" x="593" y="435" />
- <di:waypoint xsi:type="dc:Point" x="593" y="491" />
+ <di:waypoint xsi:type="dc:Point" x="564" y="439" />
+ <di:waypoint xsi:type="dc:Point" x="564" y="495" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="600" y="456" width="85" height="13" />
+ <dc:Bounds x="570" y="460" width="88" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_1tifgqh_di" bpmnElement="Task_QueryRainyDayTable">
- <dc:Bounds x="425" y="370" width="100" height="80" />
+ <dc:Bounds x="396" y="374" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0ndt8ft_di" bpmnElement="SequenceFlow_0ndt8ft">
- <di:waypoint xsi:type="dc:Point" x="936" y="410" />
- <di:waypoint xsi:type="dc:Point" x="965" y="410" />
+ <di:waypoint xsi:type="dc:Point" x="907" y="414" />
+ <di:waypoint xsi:type="dc:Point" x="936" y="414" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="906" y="389" width="90" height="12" />
+ <dc:Bounds x="877" y="393" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_07a1ytc_di" bpmnElement="SequenceFlow_07a1ytc">
- <di:waypoint xsi:type="dc:Point" x="1001" y="410" />
- <di:waypoint xsi:type="dc:Point" x="1039" y="410" />
+ <di:waypoint xsi:type="dc:Point" x="972" y="414" />
+ <di:waypoint xsi:type="dc:Point" x="1010" y="414" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="975" y="389" width="90" height="12" />
+ <dc:Bounds x="946" y="393" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_1obvxht_di" bpmnElement="Task_SetRetryTimer">
- <dc:Bounds x="836" y="370" width="100" height="80" />
+ <dc:Bounds x="807" y="374" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0kdjsnx_di" bpmnElement="Continue">
<di:waypoint xsi:type="dc:Point" x="508" y="180" />
@@ -245,38 +251,25 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0a62t4c_di" bpmnElement="SequenceFlow_0a62t4c">
- <di:waypoint xsi:type="dc:Point" x="525" y="410" />
- <di:waypoint xsi:type="dc:Point" x="568" y="410" />
+ <di:waypoint xsi:type="dc:Point" x="496" y="414" />
+ <di:waypoint xsi:type="dc:Point" x="539" y="414" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="502" y="389" width="90" height="13" />
+ <dc:Bounds x="473" y="393" width="90" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="SubProcess_0tv8zda_di" bpmnElement="SubProcess_0tv8zda" isExpanded="true">
- <dc:Bounds x="320" y="294" width="802" height="290" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="StartEvent_0tmcs9g_di" bpmnElement="StartEvent_0tmcs9g">
- <dc:Bounds x="340" y="392" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="223" y="428" width="90" height="12" />
- </bpmndi:BPMNLabel>
+ <dc:Bounds x="171" y="298" width="922" height="295" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_09synl9_di" bpmnElement="SequenceFlow_09synl9">
- <di:waypoint xsi:type="dc:Point" x="376" y="410" />
- <di:waypoint xsi:type="dc:Point" x="425" y="410" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="356" y="389" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_0mvmk3i_di" bpmnElement="EndEvent_0mvmk3i">
- <dc:Bounds x="575" y="491" width="36" height="36" />
+ <dc:Bounds x="546" y="495" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="548" y="531" width="90" height="12" />
+ <dc:Bounds x="519" y="535" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1aww7yx_di" bpmnElement="EndEvent_1sez2lh">
- <dc:Bounds x="1039" y="392" width="36" height="36" />
+ <dc:Bounds x="1010" y="396" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1049" y="432" width="19" height="13" />
+ <dc:Bounds x="1020" y="436" width="20" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_16lmcxp_di" bpmnElement="SequenceFlow_16lmcxp">
@@ -319,27 +312,50 @@
<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="746" y="435" />
- <di:waypoint xsi:type="dc:Point" x="746" y="459" />
+ <di:waypoint xsi:type="dc:Point" x="717" y="439" />
+ <di:waypoint xsi:type="dc:Point" x="717" y="463" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="757" y="436" width="13" height="13" />
+ <dc:Bounds x="728" y="440" width="13" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_12ps9at_di" bpmnElement="SequenceFlow_12ps9at">
- <di:waypoint xsi:type="dc:Point" x="796" y="499" />
- <di:waypoint xsi:type="dc:Point" x="868" y="499" />
+ <di:waypoint xsi:type="dc:Point" x="767" y="503" />
+ <di:waypoint xsi:type="dc:Point" x="839" y="503" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="787" y="478" width="90" height="12" />
+ <dc:Bounds x="758" y="482" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_05vw85n_di" bpmnElement="EndEvent_0ex9298">
- <dc:Bounds x="868" y="481" width="36" height="36" />
+ <dc:Bounds x="839" y="485" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="877" y="521" width="19" height="13" />
+ <dc:Bounds x="848" y="525" width="20" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_11f2c91_di" bpmnElement="Task_QuerySecondaryPolicy">
- <dc:Bounds x="696" y="459" width="100" height="80" />
+ <dc:Bounds x="667" y="463" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0vdeqxv_di" bpmnElement="SequenceFlow_0vdeqxv">
+ <di:waypoint xsi:type="dc:Point" x="361" y="414" />
+ <di:waypoint xsi:type="dc:Point" x="396" y="414" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="378.5" y="393" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="StartEvent_0tmcs9g_di" bpmnElement="StartEvent_0tmcs9g">
+ <dc:Bounds x="196" y="396" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="79" y="432" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_09synl9_di" bpmnElement="SequenceFlow_09synl9">
+ <di:waypoint xsi:type="dc:Point" x="232" y="414" />
+ <di:waypoint xsi:type="dc:Point" x="261" y="414" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="201.5" y="393" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_10v49qn_di" bpmnElement="Task_UpdateExtErrorSource">
+ <dc:Bounds x="261" y="374" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/HomingBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/HomingBB.bpmn
index b66ecfa329..11227ede4d 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/HomingBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/HomingBB.bpmn
@@ -50,6 +50,7 @@ ex.processJavaException(execution)]]></bpmn2:script>
<camunda:in source="asyncCorrelator" target="RCVWFMSG_correlator" />
<camunda:in source="asyncTimeout" target="RCVWFMSG_timeout" />
<camunda:out source="WorkflowResponse" target="asyncResponse" />
+ <camunda:in source="mso-request-id" target="mso-request-id" />
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_0qrwjzu</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_03cy5y5</bpmn2:outgoing>
diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn
index 35b77d9189..efdee8601e 100644
--- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn
+++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.7.2">
+<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="2.0.3">
<bpmn:process id="WorkflowActionBB" name="WorkflowActionBB" isExecutable="true">
<bpmn:startEvent id="Start_WorkflowActionBB" name="start">
<bpmn:outgoing>SequenceFlow_15s0okp</bpmn:outgoing>
@@ -23,6 +23,9 @@
<camunda:out source="RetryDuration" target="RetryDuration" />
<camunda:in source="suppressRollback" target="suppressRollback" />
<camunda:out source="StatusMessage" target="StatusMessage" />
+ <camunda:in source="isRollback" target="isRollback" />
+ <camunda:in source="rollbackTargetState" target="rollbackTargetState" />
+ <camunda:out source="rollbackTargetState" target="rollbackTargetState" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_0mew9im</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1hsqed1</bpmn:outgoing>
@@ -43,7 +46,7 @@
<bpmn:outgoing>SequenceFlow_0l7kaba</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_1m2eezj" name="Completed = true" sourceRef="ExclusiveGateway_Finished" targetRef="ExclusiveGateway_isTopLevelFlowC">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("completed")==true&&execution.getVariable("isRollback")==false&&execution.getVariable("handlingCode")=="Success"}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("completed")==true&amp;&amp;execution.getVariable("isRollback")==false&amp;&amp;execution.getVariable("handlingCode")=="Success"}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:serviceTask id="Task_RetrieveBBExectuionList" name="Retrieve BB Execution List" camunda:expression="${WorkflowAction.selectExecutionList(execution)}">
<bpmn:incoming>SequenceFlow_15s0okp</bpmn:incoming>
@@ -80,7 +83,7 @@
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_024g0d1" name="no" sourceRef="ExclusiveGateway_10q79b6" targetRef="Task_UpdateDb" />
<bpmn:sequenceFlow id="SequenceFlow_0vi883o" name="yes" sourceRef="ExclusiveGateway_10q79b6" targetRef="Task_SendSyncAckError">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("isTopLevelFlow")==true&&execution.getVariable("sentSyncResponse")==false}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isTopLevelFlow")==true&amp;&amp;execution.getVariable("sentSyncResponse")==false}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_0eana0l" sourceRef="Task_SendSyncAckError" targetRef="Task_UpdateDb" />
<bpmn:serviceTask id="Task_SendSyncAckError" name="Send Sync Ack API Handler" camunda:asyncAfter="true" camunda:expression="${WorkflowActionBBTasks.sendSyncAck(execution)}">
@@ -89,10 +92,10 @@
</bpmn:serviceTask>
</bpmn:subProcess>
<bpmn:sequenceFlow id="SequenceFlow_0v588sm" name="Rollback = true" sourceRef="ExclusiveGateway_Finished" targetRef="Task_RollbackExecutionPath">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("handlingCode")=="Rollback"||execution.getVariable("handlingCode")=="RollbackToAssigned"||execution.getVariable("handlingCode")=="RollbackToCreated"}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("handlingCode")=="Rollback"||execution.getVariable("handlingCode")=="RollbackToAssigned"||execution.getVariable("handlingCode")=="RollbackToCreated"}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_1atzsgn" sourceRef="Task_RollbackExecutionPath" targetRef="Task_SelectBB">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("isRollbackNeeded")==true}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isRollbackNeeded")==true}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:serviceTask id="Task_RollbackExecutionPath" name="Rollback Execution Path" camunda:expression="${WorkflowActionBBTasks.rollbackExecutionPath(execution)}">
<bpmn:incoming>SequenceFlow_0v588sm</bpmn:incoming>
@@ -101,7 +104,7 @@
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0vc9go9" sourceRef="Task_RetrieveBBExectuionList" targetRef="ExclusiveGateway_isTopLevelFlow" />
<bpmn:sequenceFlow id="SequenceFlow_11530ei" name="Abort = true" sourceRef="ExclusiveGateway_Finished" targetRef="ExclusiveGateway_isTopLevelFlowAbort">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("handlingCode")=="Abort"}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("handlingCode")=="Abort"}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:serviceTask id="Task_AbortAndCallErrorHandling" name="Update Request To Failed" camunda:expression="${WorkflowActionBBFailure.updateRequestStatusToFailed(execution)}">
<bpmn:incoming>SequenceFlow_02ksbt0</bpmn:incoming>
@@ -125,7 +128,7 @@
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_0sckerv" name="yes" sourceRef="ExclusiveGateway_isTopLevelFlow" targetRef="Task_SendSync" />
<bpmn:sequenceFlow id="SequenceFlow_0unbew4" name="no" sourceRef="ExclusiveGateway_isTopLevelFlow" targetRef="Task_PreValidateWorkflow">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("isTopLevelFlow")==false}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isTopLevelFlow")==false}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:exclusiveGateway id="ExclusiveGateway_isTopLevelFlowAbort" name="Is Top-Level Flow?" default="SequenceFlow_02ksbt0">
<bpmn:incoming>SequenceFlow_11530ei</bpmn:incoming>
@@ -134,7 +137,7 @@
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_02ksbt0" name="yes" sourceRef="ExclusiveGateway_isTopLevelFlowAbort" targetRef="Task_AbortAndCallErrorHandling" />
<bpmn:sequenceFlow id="SequenceFlow_1r570x3" name="no" sourceRef="ExclusiveGateway_isTopLevelFlowAbort" targetRef="EndEvent_0lzz1ya">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("isTopLevelFlow")==false}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isTopLevelFlow")==false}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:exclusiveGateway id="ExclusiveGateway_isTopLevelFlowC" name="Is Top-Level Flow?" default="SequenceFlow_0kf5sen">
<bpmn:incoming>SequenceFlow_1m2eezj</bpmn:incoming>
@@ -142,13 +145,13 @@
<bpmn:outgoing>SequenceFlow_0kf5sen</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_0x4urgp" name="no" sourceRef="ExclusiveGateway_isTopLevelFlowC" targetRef="End_WorkflowActionBB">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("isTopLevelFlow")==false}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isTopLevelFlow")==false}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:endEvent id="End_RollbackFailed" name="end">
<bpmn:incoming>SequenceFlow_1ui67mc</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_11dlyzt" name="Rollback Not Needed" sourceRef="Task_RollbackExecutionPath" targetRef="Task_UpdateRequestToFailed">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("isRollbackNeeded")==false}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isRollbackNeeded")==false}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:serviceTask id="Task_UpdateRequestToFailed" name="Update Request To Failed" camunda:expression="${WorkflowActionBBFailure.updateRequestStatusToFailedWithRollback(execution)}">
<bpmn:incoming>SequenceFlow_11dlyzt</bpmn:incoming>
@@ -156,7 +159,7 @@
<bpmn:outgoing>SequenceFlow_1ui67mc</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="SequenceFlow_0l7kaba" name="Rollback Completed" sourceRef="ExclusiveGateway_Finished" targetRef="Task_UpdateRequestToFailed">
- <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[${execution.getVariable("completed")==true&&execution.getVariable("isRollback")==true&&execution.getVariable("handlingCode")=="Success"}]]></bpmn:conditionExpression>
+ <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("completed")==true&amp;&amp;execution.getVariable("isRollback")==true&amp;&amp;execution.getVariable("handlingCode")=="Success"}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_1ui67mc" sourceRef="Task_UpdateRequestToFailed" targetRef="End_RollbackFailed" />
<bpmn:subProcess id="SubProcess_0fuugr9" name="Java Exception Handling Sub Process" triggeredByEvent="true">
@@ -210,8 +213,8 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_15s0okp_di" bpmnElement="SequenceFlow_15s0okp">
- <di:waypoint xsi:type="dc:Point" x="-398" y="120" />
- <di:waypoint xsi:type="dc:Point" x="-365" y="120" />
+ <di:waypoint x="-398" y="120" />
+ <di:waypoint x="-365" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-381" y="99" width="0" height="0" />
</bpmndi:BPMNLabel>
@@ -220,8 +223,8 @@
<dc:Bounds x="560" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0mqrkxv_di" bpmnElement="SequenceFlow_0mqrkxv">
- <di:waypoint xsi:type="dc:Point" x="339" y="120" />
- <di:waypoint xsi:type="dc:Point" x="400" y="120" />
+ <di:waypoint x="339" y="120" />
+ <di:waypoint x="400" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="324.5" y="105" width="90" height="0" />
</bpmndi:BPMNLabel>
@@ -236,9 +239,9 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1m2eezj_di" bpmnElement="SequenceFlow_1m2eezj">
- <di:waypoint xsi:type="dc:Point" x="949" y="132" />
- <di:waypoint xsi:type="dc:Point" x="980" y="165" />
- <di:waypoint xsi:type="dc:Point" x="1060" y="165" />
+ <di:waypoint x="949" y="132" />
+ <di:waypoint x="980" y="165" />
+ <di:waypoint x="1060" y="165" />
<bpmndi:BPMNLabel>
<dc:Bounds x="968" y="168" width="83" height="12" />
</bpmndi:BPMNLabel>
@@ -253,9 +256,9 @@
<dc:Bounds x="1161" y="206" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1pz6edz_di" bpmnElement="SequenceFlow_1pz6edz">
- <di:waypoint xsi:type="dc:Point" x="1261" y="246" />
- <di:waypoint xsi:type="dc:Point" x="1322" y="246" />
- <di:waypoint xsi:type="dc:Point" x="1322" y="183" />
+ <di:waypoint x="1261" y="246" />
+ <di:waypoint x="1322" y="246" />
+ <di:waypoint x="1322" y="183" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1247" y="231" width="90" height="0" />
</bpmndi:BPMNLabel>
@@ -276,16 +279,16 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0v588sm_di" bpmnElement="SequenceFlow_0v588sm">
- <di:waypoint xsi:type="dc:Point" x="936" y="145" />
- <di:waypoint xsi:type="dc:Point" x="936" y="262" />
- <di:waypoint xsi:type="dc:Point" x="339" y="262" />
+ <di:waypoint x="936" y="145" />
+ <di:waypoint x="936" y="262" />
+ <di:waypoint x="339" y="262" />
<bpmndi:BPMNLabel>
<dc:Bounds x="769.202380952381" y="272" width="73" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1atzsgn_di" bpmnElement="SequenceFlow_1atzsgn">
- <di:waypoint xsi:type="dc:Point" x="289" y="222" />
- <di:waypoint xsi:type="dc:Point" x="289" y="160" />
+ <di:waypoint x="289" y="222" />
+ <di:waypoint x="289" y="160" />
<bpmndi:BPMNLabel>
<dc:Bounds x="259" y="191" width="90" height="0" />
</bpmndi:BPMNLabel>
@@ -294,16 +297,16 @@
<dc:Bounds x="239" y="222" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0vc9go9_di" bpmnElement="SequenceFlow_0vc9go9">
- <di:waypoint xsi:type="dc:Point" x="-265" y="120" />
- <di:waypoint xsi:type="dc:Point" x="-228" y="120" />
+ <di:waypoint x="-265" y="120" />
+ <di:waypoint x="-228" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-246" y="105" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_11530ei_di" bpmnElement="SequenceFlow_11530ei">
- <di:waypoint xsi:type="dc:Point" x="946" y="105" />
- <di:waypoint xsi:type="dc:Point" x="983" y="44" />
- <di:waypoint xsi:type="dc:Point" x="1060" y="45" />
+ <di:waypoint x="946" y="105" />
+ <di:waypoint x="983" y="44" />
+ <di:waypoint x="1060" y="45" />
<bpmndi:BPMNLabel>
<dc:Bounds x="975" y="17" width="58" height="12" />
</bpmndi:BPMNLabel>
@@ -318,28 +321,28 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1p8yxu6_di" bpmnElement="SequenceFlow_1p8yxu6">
- <di:waypoint xsi:type="dc:Point" x="1276" y="-36" />
- <di:waypoint xsi:type="dc:Point" x="1359" y="-36" />
- <di:waypoint xsi:type="dc:Point" x="1359" y="45" />
- <di:waypoint xsi:type="dc:Point" x="1386" y="45" />
+ <di:waypoint x="1276" y="-36" />
+ <di:waypoint x="1359" y="-36" />
+ <di:waypoint x="1359" y="45" />
+ <di:waypoint x="1386" y="45" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1329" y="5" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1wb59ic_di" bpmnElement="SequenceFlow_1wb59ic">
- <di:waypoint xsi:type="dc:Point" x="-32" y="34" />
- <di:waypoint xsi:type="dc:Point" x="32" y="34" />
- <di:waypoint xsi:type="dc:Point" x="32" y="120" />
- <di:waypoint xsi:type="dc:Point" x="80" y="120" />
+ <di:waypoint x="-32" y="34" />
+ <di:waypoint x="32" y="34" />
+ <di:waypoint x="32" y="120" />
+ <di:waypoint x="80" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="47" y="77" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_01j184u_di" bpmnElement="SequenceFlow_01j184u">
- <di:waypoint xsi:type="dc:Point" x="936" y="95" />
- <di:waypoint xsi:type="dc:Point" x="936" y="55" />
- <di:waypoint xsi:type="dc:Point" x="936" y="55" />
- <di:waypoint xsi:type="dc:Point" x="936" y="4" />
+ <di:waypoint x="936" y="95" />
+ <di:waypoint x="936" y="55" />
+ <di:waypoint x="936" y="55" />
+ <di:waypoint x="936" y="4" />
<bpmndi:BPMNLabel>
<dc:Bounds x="906" y="49" width="90" height="0" />
</bpmndi:BPMNLabel>
@@ -354,16 +357,16 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0sckerv_di" bpmnElement="SequenceFlow_0sckerv">
- <di:waypoint xsi:type="dc:Point" x="-202" y="96" />
- <di:waypoint xsi:type="dc:Point" x="-202" y="34" />
- <di:waypoint xsi:type="dc:Point" x="-132" y="34" />
+ <di:waypoint x="-202" y="96" />
+ <di:waypoint x="-202" y="34" />
+ <di:waypoint x="-132" y="34" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-195" y="55.55555555555556" width="18" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0unbew4_di" bpmnElement="SequenceFlow_0unbew4">
- <di:waypoint xsi:type="dc:Point" x="-178" y="120" />
- <di:waypoint xsi:type="dc:Point" x="80" y="120" />
+ <di:waypoint x="-178" y="120" />
+ <di:waypoint x="80" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-87" y="99.95468180757382" width="12" height="12" />
</bpmndi:BPMNLabel>
@@ -375,16 +378,16 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_02ksbt0_di" bpmnElement="SequenceFlow_02ksbt0">
- <di:waypoint xsi:type="dc:Point" x="1085" y="20" />
- <di:waypoint xsi:type="dc:Point" x="1085" y="-37" />
- <di:waypoint xsi:type="dc:Point" x="1176" y="-37" />
+ <di:waypoint x="1085" y="20" />
+ <di:waypoint x="1085" y="-37" />
+ <di:waypoint x="1176" y="-37" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1091" y="-8" width="19" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1r570x3_di" bpmnElement="SequenceFlow_1r570x3">
- <di:waypoint xsi:type="dc:Point" x="1110" y="45" />
- <di:waypoint xsi:type="dc:Point" x="1386" y="45" />
+ <di:waypoint x="1110" y="45" />
+ <di:waypoint x="1386" y="45" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1242" y="20" width="12" height="12" />
</bpmndi:BPMNLabel>
@@ -396,10 +399,10 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0x4urgp_di" bpmnElement="SequenceFlow_0x4urgp">
- <di:waypoint xsi:type="dc:Point" x="1110" y="165" />
- <di:waypoint xsi:type="dc:Point" x="1220" y="165" />
- <di:waypoint xsi:type="dc:Point" x="1220" y="165" />
- <di:waypoint xsi:type="dc:Point" x="1304" y="165" />
+ <di:waypoint x="1110" y="165" />
+ <di:waypoint x="1220" y="165" />
+ <di:waypoint x="1220" y="165" />
+ <di:waypoint x="1304" y="165" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1256" y="140" width="12" height="12" />
</bpmndi:BPMNLabel>
@@ -411,9 +414,9 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_11dlyzt_di" bpmnElement="SequenceFlow_11dlyzt">
- <di:waypoint xsi:type="dc:Point" x="289" y="302" />
- <di:waypoint xsi:type="dc:Point" x="289" y="368" />
- <di:waypoint xsi:type="dc:Point" x="960" y="368" />
+ <di:waypoint x="289" y="302" />
+ <di:waypoint x="289" y="368" />
+ <di:waypoint x="960" y="368" />
<bpmndi:BPMNLabel>
<dc:Bounds x="381.45685840707966" y="325" width="63" height="24" />
</bpmndi:BPMNLabel>
@@ -425,33 +428,33 @@
<dc:Bounds x="960" y="325" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0l7kaba_di" bpmnElement="SequenceFlow_0l7kaba">
- <di:waypoint xsi:type="dc:Point" x="942" y="139" />
- <di:waypoint xsi:type="dc:Point" x="976" y="252" />
- <di:waypoint xsi:type="dc:Point" x="1016" y="252" />
- <di:waypoint xsi:type="dc:Point" x="1016" y="325" />
+ <di:waypoint x="942" y="139" />
+ <di:waypoint x="976" y="252" />
+ <di:waypoint x="1016" y="252" />
+ <di:waypoint x="1016" y="325" />
<bpmndi:BPMNLabel>
<dc:Bounds x="959" y="255" width="52" height="24" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1edjl5x_di" bpmnElement="SequenceFlow_1edjl5x">
- <di:waypoint xsi:type="dc:Point" x="556" y="657" />
- <di:waypoint xsi:type="dc:Point" x="602" y="657" />
+ <di:waypoint x="556" y="657" />
+ <di:waypoint x="602" y="657" />
<bpmndi:BPMNLabel>
<dc:Bounds x="534" y="636" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0wvzfgf_di" bpmnElement="SequenceFlow_0wvzfgf">
- <di:waypoint xsi:type="dc:Point" x="813" y="657" />
- <di:waypoint xsi:type="dc:Point" x="880" y="657" />
+ <di:waypoint x="813" y="657" />
+ <di:waypoint x="880" y="657" />
<bpmndi:BPMNLabel>
<dc:Bounds x="801.5" y="636" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1ui67mc_di" bpmnElement="SequenceFlow_1ui67mc">
- <di:waypoint xsi:type="dc:Point" x="1060" y="365" />
- <di:waypoint xsi:type="dc:Point" x="1134" y="365" />
- <di:waypoint xsi:type="dc:Point" x="1134" y="365" />
- <di:waypoint xsi:type="dc:Point" x="1159" y="365" />
+ <di:waypoint x="1060" y="365" />
+ <di:waypoint x="1134" y="365" />
+ <di:waypoint x="1134" y="365" />
+ <di:waypoint x="1159" y="365" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1104" y="359" width="90" height="13" />
</bpmndi:BPMNLabel>
@@ -463,25 +466,25 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_024g0d1_di" bpmnElement="SequenceFlow_024g0d1">
- <di:waypoint xsi:type="dc:Point" x="652" y="657" />
- <di:waypoint xsi:type="dc:Point" x="683" y="657" />
- <di:waypoint xsi:type="dc:Point" x="683" y="657" />
- <di:waypoint xsi:type="dc:Point" x="713" y="657" />
+ <di:waypoint x="652" y="657" />
+ <di:waypoint x="683" y="657" />
+ <di:waypoint x="683" y="657" />
+ <di:waypoint x="713" y="657" />
<bpmndi:BPMNLabel>
<dc:Bounds x="677" y="634" width="12" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0vi883o_di" bpmnElement="SequenceFlow_0vi883o">
- <di:waypoint xsi:type="dc:Point" x="627" y="632" />
- <di:waypoint xsi:type="dc:Point" x="627" y="548" />
- <di:waypoint xsi:type="dc:Point" x="713" y="548" />
+ <di:waypoint x="627" y="632" />
+ <di:waypoint x="627" y="548" />
+ <di:waypoint x="713" y="548" />
<bpmndi:BPMNLabel>
<dc:Bounds x="633" y="584" width="18" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0eana0l_di" bpmnElement="SequenceFlow_0eana0l">
- <di:waypoint xsi:type="dc:Point" x="763" y="588" />
- <di:waypoint xsi:type="dc:Point" x="763" y="617" />
+ <di:waypoint x="763" y="588" />
+ <di:waypoint x="763" y="617" />
<bpmndi:BPMNLabel>
<dc:Bounds x="778" y="596.5" width="0" height="12" />
</bpmndi:BPMNLabel>
@@ -508,15 +511,15 @@
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_11d126w_di" bpmnElement="SequenceFlow_11d126w">
- <di:waypoint xsi:type="dc:Point" x="606" y="875" />
- <di:waypoint xsi:type="dc:Point" x="690" y="875" />
+ <di:waypoint x="606" y="875" />
+ <di:waypoint x="690" y="875" />
<bpmndi:BPMNLabel>
<dc:Bounds x="603" y="854" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0w4sx88_di" bpmnElement="SequenceFlow_0w4sx88">
- <di:waypoint xsi:type="dc:Point" x="790" y="875" />
- <di:waypoint xsi:type="dc:Point" x="856" y="875" />
+ <di:waypoint x="790" y="875" />
+ <di:waypoint x="856" y="875" />
<bpmndi:BPMNLabel>
<dc:Bounds x="778" y="854" width="0" height="12" />
</bpmndi:BPMNLabel>
@@ -525,25 +528,25 @@
<dc:Bounds x="400" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0mew9im_di" bpmnElement="SequenceFlow_0mew9im">
- <di:waypoint xsi:type="dc:Point" x="500" y="120" />
- <di:waypoint xsi:type="dc:Point" x="560" y="120" />
+ <di:waypoint x="500" y="120" />
+ <di:waypoint x="560" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="530" y="99" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0kf5sen_di" bpmnElement="SequenceFlow_0kf5sen">
- <di:waypoint xsi:type="dc:Point" x="1085" y="190" />
- <di:waypoint xsi:type="dc:Point" x="1085" y="246" />
- <di:waypoint xsi:type="dc:Point" x="1161" y="246" />
+ <di:waypoint x="1085" y="190" />
+ <di:waypoint x="1085" y="246" />
+ <di:waypoint x="1161" y="246" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1091" y="218" width="19" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1tfizxf_di" bpmnElement="SequenceFlow_1tfizxf">
- <di:waypoint xsi:type="dc:Point" x="180" y="120" />
- <di:waypoint xsi:type="dc:Point" x="211" y="120" />
- <di:waypoint xsi:type="dc:Point" x="211" y="120" />
- <di:waypoint xsi:type="dc:Point" x="239" y="120" />
+ <di:waypoint x="180" y="120" />
+ <di:waypoint x="211" y="120" />
+ <di:waypoint x="211" y="120" />
+ <di:waypoint x="239" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="226" y="120" width="0" height="0" />
</bpmndi:BPMNLabel>
@@ -555,23 +558,23 @@
<dc:Bounds x="735" y="80" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1hsqed1_di" bpmnElement="SequenceFlow_1hsqed1">
- <di:waypoint xsi:type="dc:Point" x="660" y="120" />
- <di:waypoint xsi:type="dc:Point" x="735" y="120" />
+ <di:waypoint x="660" y="120" />
+ <di:waypoint x="735" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="697.5" y="99" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1fftixk_di" bpmnElement="SequenceFlow_1fftixk">
- <di:waypoint xsi:type="dc:Point" x="835" y="120" />
- <di:waypoint xsi:type="dc:Point" x="911" y="120" />
+ <di:waypoint x="835" y="120" />
+ <di:waypoint x="911" y="120" />
<bpmndi:BPMNLabel>
<dc:Bounds x="873" y="99" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1pnkpim_di" bpmnElement="SequenceFlow_1pnkpim">
- <di:waypoint xsi:type="dc:Point" x="886" y="-36" />
- <di:waypoint xsi:type="dc:Point" x="289" y="-36" />
- <di:waypoint xsi:type="dc:Point" x="289" y="80" />
+ <di:waypoint x="886" y="-36" />
+ <di:waypoint x="289" y="-36" />
+ <di:waypoint x="289" y="80" />
<bpmndi:BPMNLabel>
<dc:Bounds x="587.5" y="-57" width="0" height="12" />
</bpmndi:BPMNLabel>
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java
index 051f373eaf..bd29e5570a 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 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
@@ -93,8 +95,7 @@ public class WorkflowActionBBTest extends BaseBPMNTest {
Map<String, String> map = new HashMap<>();
map.put("handlingCode", "Abort");
- doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowActionBBFailure)
- .abortCallErrorHandling(any(DelegateExecution.class));
+ doThrow(new BpmnError("7000", "TESTING ERRORS")).when(workflowActionBBFailure).abortCallErrorHandling();
mockSubprocess("ExecuteBuildingBlock", "Mocked ExecuteBuildingBlock", "GenericStub", map);
ProcessInstance pi = runtimeService.startProcessInstanceByKey("WorkflowActionBB", variables);
diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java
index d9166c9138..47d0ad9b7f 100644
--- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java
+++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/subprocess/DeleteVfModuleBBTest.java
@@ -46,18 +46,20 @@ public class DeleteVfModuleBBTest extends BaseBPMNTest {
mockSubprocess("VnfAdapter", "Mocked VnfAdapter", "GenericStub");
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVfModuleBB", variables);
List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
- .topic("InventoryDeleteAudit", 60L * 1000L).execute();
+ .topic("InventoryDeleteAudit", 60L * 1000L).topic("InventoryQueryAudit", 60L * 1000L).execute();
while (!tasks.isEmpty()) {
for (LockedExternalTask task : tasks) {
externalTaskService.complete(task.getId(), "externalWorkerId");
}
tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryDeleteAudit", 60L * 1000L)
- .execute();
+ .topic("InventoryQueryAudit", 60L * 1000L).execute();
}
assertThat(pi).isNotNull();
- assertThat(pi).isStarted().hasPassed("DeleteVfModuleBB_Start", "ExclusiveGateway_0xrgzm7",
- "ExclusiveGateway_1yvh16a", "Check_Audit", "Setup_Audit_Variable", "Audit_Inventory",
- "DeleteVfModuleVnfAdapter", "VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress",
+ assertThat(pi).isStarted().hasPassed("DeleteVfModuleBB_Start", "Check_Audit", "auditEnabledCheck",
+ "Setup_Audit_Variable", "Setup_Audit_Variable", "aicQueryStack", "ExclusiveGateway_1t9q2jl",
+ "ExclusiveGateway_1naduhl", "ExclusiveGateway_13fhmpf", "DeleteVfModuleVnfAdapter", "VnfAdapter",
+ "Audit_Inventory", "ExclusiveGateway_1yvh16a", "auditSuccessfulCheck", "ExclusiveGateway_01wvywu",
+ "ExclusiveGateway_1yvh16a", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress",
"UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn",
"UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus", "DeleteVfModuleBB_End");
assertThat(pi).isEnded();
@@ -68,19 +70,22 @@ public class DeleteVfModuleBBTest extends BaseBPMNTest {
doThrow(BpmnError.class).when(vnfAdapterDeleteTasks).deleteVfModule(any(BuildingBlockExecution.class));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("DeleteVfModuleBB", variables);
List<LockedExternalTask> tasks = externalTaskService.fetchAndLock(100, "externalWorkerId")
- .topic("InventoryDeleteAudit", 60L * 1000L).execute();
+ .topic("InventoryDeleteAudit", 60L * 1000L).topic("InventoryQueryAudit", 60L * 1000L).execute();
while (!tasks.isEmpty()) {
for (LockedExternalTask task : tasks) {
externalTaskService.complete(task.getId(), "externalWorkerId");
}
tasks = externalTaskService.fetchAndLock(100, "externalWorkerId").topic("InventoryDeleteAudit", 60L * 1000L)
- .execute();
+ .topic("InventoryQueryAudit", 60L * 1000L).execute();
}
assertThat(pi).isNotNull();
- assertThat(pi).isStarted().hasPassed("DeleteVfModuleBB_Start", "DeleteVfModuleVnfAdapter").hasNotPassed(
- "VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress", "UpdateVnfManagementV6Address",
- "UpdateVfModuleContrailServiceInstanceFqdn", "UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus",
- "DeleteVfModuleBB_End");
+ assertThat(pi).isStarted()
+ .hasPassed("DeleteVfModuleBB_Start", "Check_Audit", "auditEnabledCheck", "Setup_Audit_Variable",
+ "Setup_Audit_Variable", "aicQueryStack", "ExclusiveGateway_1t9q2jl", "ExclusiveGateway_1naduhl",
+ "ExclusiveGateway_13fhmpf")
+ .hasNotPassed("VnfAdapter", "DeleteNetworkPolicies", "UpdateVnfIpv4OamAddress",
+ "UpdateVnfManagementV6Address", "UpdateVfModuleContrailServiceInstanceFqdn",
+ "UpdateVfModuleHeatStackId", "UpdateVfModuleDeleteStatus", "DeleteVfModuleBB_End");
assertThat(pi).isEnded();
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
index 0338647ce7..30b5cc8567 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
@@ -83,9 +83,14 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
//the operationType from worflow(first node) is highest priority.
operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType")
}
+ String operationTypeFromConfig = UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() + ".operation-type")
+ if (StringUtils.isNotEmpty(operationTypeFromConfig)) {
+ // highest priority if operation type configured
+ operationType = operationTypeFromConfig
+ }
String sdnc_svcAction = "activate"
- String sdnc_requestAction = sdnc_svcAction.capitalize() + UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".operation-type") + "Instance"
+ String sdnc_requestAction = sdnc_svcAction.capitalize() + operationType + "Instance"
execution.setVariable(Prefix + "svcAction", sdnc_svcAction)
execution.setVariable(Prefix + "requestAction", sdnc_requestAction)
@@ -194,24 +199,6 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
String sdncTopologyActivateRequest = ""
String modelType = resourceInputObj.getResourceModelInfo().getModelType()
- //When a new resource creation request reaches SO, the parent resources information needs to be provided
- //while creating the child resource.
- String vnfid = ""
- String vnfmodelInvariantUuid = ""
- String vnfmodelCustomizationUuid = ""
- String vnfmodelUuid = ""
- String vnfmodelVersion = ""
- String vnfmodelName = ""
- if(modelType.equalsIgnoreCase(ResourceType.GROUP.toString())) {
- vnfid = resourceInputObj.getVnfId()
- ModelInfo vfModelInfo = resourceInputObj.getVfModelInfo()
- vnfmodelInvariantUuid = vfModelInfo.getModelInvariantUuid()
- vnfmodelCustomizationUuid = vfModelInfo.getModelCustomizationUuid()
- vnfmodelUuid = vfModelInfo.getModelUuid()
- vnfmodelVersion = vfModelInfo.getModelVersion()
- vnfmodelName = vfModelInfo.getModelName()
- }
-
switch (modelType) {
case "VNF" :
sdncTopologyActivateRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
@@ -272,6 +259,15 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
break
case "GROUP" :
+ //When a new resource creation request reaches SO, the parent resources information needs to be provided
+ //while creating the child resource.
+ String vnfid = resourceInputObj.getVnfId()
+ ModelInfo vfModelInfo = resourceInputObj.getVfModelInfo()
+ String vnfmodelInvariantUuid = vfModelInfo.getModelInvariantUuid()
+ String vnfmodelCustomizationUuid = vfModelInfo.getModelCustomizationUuid()
+ String vnfmodelUuid = vfModelInfo.getModelUuid()
+ String vnfmodelVersion = vfModelInfo.getModelVersion()
+ String vnfmodelName = vfModelInfo.getModelName()
sdncTopologyActivateRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
@@ -335,6 +331,61 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
</aetgt:SDNCAdapterWorkflowRequest>""".trim()
break
+ // sdwanvpnattachment or sotnvpnattachment
+ case "ALLOTTED_RESOURCE" :
+ sdncTopologyActivateRequest =
+ """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
+ xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>${msoUtils.xmlEscape(hdrRequestId)}</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>${msoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>${msoUtils.xmlEscape(sdnc_svcAction)}</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>connection-attachment-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <sdncadapterworkflow:SDNCRequestData>
+ <request-information>
+ <request-id>${msoUtils.xmlEscape(hdrRequestId)}</request-id>
+ <request-action>${msoUtils.xmlEscape(sdnc_requestAction)}</request-action>
+ <source>${msoUtils.xmlEscape(source)}</source>
+ <notification-url></notification-url>
+ <order-number></order-number>
+ <order-version></order-version>
+ </request-information>
+ <service-information>
+ <service-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-id>
+ <subscription-service-type>${msoUtils.xmlEscape(serviceType)}</subscription-service-type>
+ <onap-model-information>
+ <model-invariant-uuid>${msoUtils.xmlEscape(serviceModelInvariantUuid)}</model-invariant-uuid>
+ <model-uuid>${msoUtils.xmlEscape(serviceModelUuid)}</model-uuid>
+ <model-version>${msoUtils.xmlEscape(serviceModelVersion)}</model-version>
+ <model-name>${msoUtils.xmlEscape(serviceModelName)}</model-name>
+ </onap-model-information>
+ <service-instance-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
+ <global-customer-id>${msoUtils.xmlEscape(globalCustomerId)}</global-customer-id>
+ </service-information>
+ <allotted-resource-information>
+ <allotted-resource-id>${msoUtils.xmlEscape(resourceInstanceId)}</allotted-resource-id>
+ <allotted-resource-type></allotted-resource-type>
+ <parent-service-instance-id>$parentServiceInstanceId</parent-service-instance-id>
+ <onap-model-information>
+ <model-invariant-uuid>${msoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-uuid>
+ <model-customization-uuid>${msoUtils.xmlEscape(modelCustomizationUuid)}</model-customization-uuid>
+ <model-uuid>${msoUtils.xmlEscape(modelUuid)}</model-uuid>
+ <model-version>${msoUtils.xmlEscape(modelVersion)}</model-version>
+ <model-name>${msoUtils.xmlEscape(modelName)}</model-name>
+ </onap-model-information>
+ </allotted-resource-information>
+ <connection-attachment-request-input>
+ $netowrkInputParameters
+ </connection-attachment-request-input>
+ </sdncadapterworkflow:SDNCRequestData>
+ </aetgt:SDNCAdapterWorkflowRequest>""".trim()
+
+ break
+
// for SDWANConnectivity and SOTN Connectivity
default:
sdncTopologyActivateRequest =
@@ -371,7 +422,6 @@ public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
<global-customer-id>${msoUtils.xmlEscape(globalCustomerId)}</global-customer-id>
</service-information>
<network-information>
- <!-- TODO: to be filled by response from create -->
<network-id>${msoUtils.xmlEscape(resourceInstanceId)}</network-id>
<onap-model-information>
<model-invariant-uuid>${msoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-uuid>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
index 1578f0f7c0..8bb48a203b 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
@@ -22,6 +22,7 @@
package org.onap.so.bpmn.infrastructure.scripts
+import com.google.gson.JsonObject
import org.json.JSONArray
import org.json.JSONObject
import org.json.XML
@@ -93,11 +94,12 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
// set local resourceInput
execution.setVariable(Prefix + "ResourceInput", resourceInputObj)
+ String spPartnerModelName = UrnPropertiesReader.getVariable("sp-partner.modelName")
boolean is3rdONAPExist = false
- if(inputParameters.has("sppartner_url"))
+ if(inputParameters.has(spPartnerModelName + "_url"))
{
- String sppartnerUrl = inputParameters.get("sppartner_url")
+ String sppartnerUrl = inputParameters.get(spPartnerModelName + "_url")
if(!isBlank(sppartnerUrl)) {
execution.setVariable(Prefix + "SppartnerUrl", sppartnerUrl)
is3rdONAPExist = true
@@ -108,9 +110,9 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
logger.debug(msg)
}
}
- if(inputParameters.has("sppartner_providingServiceUuid"))
+ if(inputParameters.has(spPartnerModelName + "_providingServiceUuid"))
{
- String sppartnerUUID= inputParameters.get("sppartner_providingServiceUuid")
+ String sppartnerUUID= inputParameters.get(spPartnerModelName + "_providingServiceUuid")
execution.setVariable(Prefix + "SppartnerUUID", sppartnerUUID)
is3rdONAPExist = true
}
@@ -119,9 +121,9 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String msg = "sppartner providingServiceUuid is blank."
logger.debug(msg)
}
- if(inputParameters.has("sppartner_providingServiceInvariantUuid"))
+ if(inputParameters.has(spPartnerModelName + "_providingServiceInvariantUuid"))
{
- String sppartnerInvarianteUUID = inputParameters.get("sppartner_providingServiceInvariantUuid")
+ String sppartnerInvarianteUUID = inputParameters.get(spPartnerModelName + "_providingServiceInvariantUuid")
execution.setVariable(Prefix + "SppartnerInvarianteUUID", sppartnerInvarianteUUID)
is3rdONAPExist = true
}
@@ -131,9 +133,9 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
logger.debug(msg)
}
- if(inputParameters.has("sppartner_handoverMode"))
+ if(inputParameters.has(spPartnerModelName + "_handoverMode"))
{
- String handoverMode = inputParameters.get("sppartner_handoverMode")
+ String handoverMode = inputParameters.get(spPartnerModelName + "_handoverMode")
execution.setVariable(Prefix + "HandoverMode", handoverMode)
is3rdONAPExist = true
}
@@ -167,7 +169,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String serviceParameters = JsonUtils.getJsonValue(incomingRequest, "service.parameters")
String requestInputs = JsonUtils.getJsonValue(serviceParameters, "requestInputs")
JSONObject inputParameters = new JSONObject(requestInputs)
- execution.setVariable(Prefix + "ServiceParameters", inputParameters)
+ execution.setVariable(Prefix + "ServiceParameters", inputParameters.toString())
// CallSource is added only when ONAP SO calling 3rdONAP(External API) SO(Remote call)
boolean isLocalCall = true
@@ -182,7 +184,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
}
execution.setVariable(Prefix + "CallSource", callSource)
- logger.debug("callSource is: " + callSource )
+ logger.info("callSource is: " + callSource )
execution.setVariable("IsLocalCall", isLocalCall)
@@ -308,39 +310,39 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String handoverMode = execution.getVariable(Prefix + "HandoverMode")
if("SOTN".equalsIgnoreCase(handoverMode)) {
// Put TP Link info into serviceParameters
- JSONObject inputParameters = execution.getVariable(Prefix + "ServiceParameters")
+ JSONObject inputParameters = new JSONObject(execution.getVariable(Prefix + "ServiceParameters"))
if(inputParameters.has("remote-access-provider-id")) {
Map<String, Object> crossTPs = new HashMap<String, Object>();
- crossTPs.put("local-access-provider-id", inputParameters.get("remote-access-provider-id"));
- crossTPs.put("local-access-client-id", inputParameters.get("remote-access-client-id"));
- crossTPs.put("local-access-topology-id", inputParameters.get("remote-access-topology-id"));
- crossTPs.put("local-access-node-id", inputParameters.get("remote-access-node-id"));
- crossTPs.put("local-access-ltp-id", inputParameters.get("remote-access-ltp-id"));
- crossTPs.put("remote-access-provider-id", inputParameters.get("local-access-provider-id"));
- crossTPs.put("remote-access-client-id", inputParameters.get("local-access-client-id"));
- crossTPs.put("remote-access-topology-id", inputParameters.get("local-access-topology-id"));
- crossTPs.put("remote-access-node-id", inputParameters.get("local-access-node-id"));
- crossTPs.put("remote-access-ltp-id", inputParameters.get("local-access-ltp-id"));
-
- inputParameters.put("local-access-provider-id", crossTPs.get("local-access-provider-id"));
- inputParameters.put("local-access-client-id", crossTPs.get("local-access-client-id"));
- inputParameters.put("local-access-topology-id", crossTPs.get("local-access-topology-id"));
- inputParameters.put("local-access-node-id", crossTPs.get("local-access-node-id"));
- inputParameters.put("local-access-ltp-id", crossTPs.get("local-access-ltp-id"));
- inputParameters.put("remote-access-provider-id", crossTPs.get("remote-access-provider-id"));
- inputParameters.put("remote-access-client-id", crossTPs.get("remote-access-client-id"));
- inputParameters.put("remote-access-topology-id", crossTPs.get("remote-access-topology-id"));
- inputParameters.put("remote-access-node-id", crossTPs.get("remote-access-node-id"));
- inputParameters.put("remote-access-ltp-id", crossTPs.get("remote-access-ltp-id"));
-
- execution.setVariable(Prefix + "ServiceParameters", inputParameters)
+ crossTPs.put("local-access-provider-id", inputParameters.get("remote-access-provider-id"))
+ crossTPs.put("local-access-client-id", inputParameters.get("remote-access-client-id"))
+ crossTPs.put("local-access-topology-id", inputParameters.get("remote-access-topology-id"))
+ crossTPs.put("local-access-node-id", inputParameters.get("remote-access-node-id"))
+ crossTPs.put("local-access-ltp-id", inputParameters.get("remote-access-ltp-id"))
+ crossTPs.put("remote-access-provider-id", inputParameters.get("local-access-provider-id"))
+ crossTPs.put("remote-access-client-id", inputParameters.get("local-access-client-id"))
+ crossTPs.put("remote-access-topology-id", inputParameters.get("local-access-topology-id"))
+ crossTPs.put("remote-access-node-id", inputParameters.get("local-access-node-id"))
+ crossTPs.put("remote-access-ltp-id", inputParameters.get("local-access-ltp-id"))
+
+ inputParameters.put("local-access-provider-id", crossTPs.get("local-access-provider-id"))
+ inputParameters.put("local-access-client-id", crossTPs.get("local-access-client-id"))
+ inputParameters.put("local-access-topology-id", crossTPs.get("local-access-topology-id"))
+ inputParameters.put("local-access-node-id", crossTPs.get("local-access-node-id"))
+ inputParameters.put("local-access-ltp-id", crossTPs.get("local-access-ltp-id"))
+ inputParameters.put("remote-access-provider-id", crossTPs.get("remote-access-provider-id"))
+ inputParameters.put("remote-access-client-id", crossTPs.get("remote-access-client-id"))
+ inputParameters.put("remote-access-topology-id", crossTPs.get("remote-access-topology-id"))
+ inputParameters.put("remote-access-node-id", crossTPs.get("remote-access-node-id"))
+ inputParameters.put("remote-access-ltp-id", crossTPs.get("remote-access-ltp-id"))
+
+ execution.setVariable(Prefix + "ServiceParameters", inputParameters.toString())
}
else {
logger.error("No allocated CrossONAPResource found in ServiceParameters")
}
}
- logger.info("Exit " + allocateCrossONAPResource)
+ logger.info("Exit allocateCrossONAPResource")
}
public void prepare3rdONAPRequest(DelegateExecution execution) {
@@ -353,6 +355,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
// ExternalAPI message format
String externalId = execution.getVariable("resourceName")
+ String serviceType = execution.getVariable("serviceType")
String category = "E2E Service"
String description = "Service Order from SPPartner"
String requestedStartDate = utils.generateCurrentTimeInUtc()
@@ -360,7 +363,9 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String priority = "1" // 0-4 0:highest
String subscriberId = execution.getVariable("globalSubscriberId")
String customerRole = "ONAPcustomer"
- String subscriberName = subscriberId
+ // Below SO will pass serviceType as subscriberName and externalAPI will use
+ // the same serviceType in another domain instead of model name
+ String subscriberName = serviceType
String referredType = "Consumer"
String orderItemId = "1"
String action = "add" //for create
@@ -401,13 +406,12 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
_requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
requestInputsMap.clear()
- String serviceType = execution.getVariable("serviceType")
requestInputsMap.put("inputName", '"serviceType"')
requestInputsMap.put("inputValue", '"' + serviceType + '"')
_requestInputs_ += ",\n" + externalAPIUtil.setTemplate(ExternalAPIUtil.RequestInputsTemplate, requestInputsMap)
// Transfer all uuiRequest incomeParameters to ExternalAPI format
- JSONObject inputParameters = execution.getVariable(Prefix + "ServiceParameters")
+ JSONObject inputParameters = new JSONObject(execution.getVariable(Prefix + "ServiceParameters"))
for(String key : inputParameters.keySet()) {
String inputName = key
String inputValue = inputParameters.opt(key)
@@ -420,7 +424,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String payload = externalAPIUtil.setTemplate(ExternalAPIUtil.PostServiceOrderRequestsTemplate, valueMap)
execution.setVariable(Prefix + "Payload", payload)
- logger.info("Exit " + prepare3rdONAPRequest)
+ logger.info(" ***** Exit prepare3rdONAPRequest *****")
}
public void doCreateE2ESIin3rdONAP(DelegateExecution execution) {
@@ -464,7 +468,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
logger.error("doCreateE2ESIin3rdONAP exception:" + e.getMessage())
}
- logger.info("Exit " + doCreateE2ESIin3rdONAP)
+ logger.info(" ***** Exit doCreateE2ESIin3rdONAP *****")
}
@@ -504,7 +508,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
JSONArray items = responseObj.getJSONArray("orderItem")
- JSONObject item = items[0]
+ JSONObject item = items.get(0)
JSONObject service = item.get("service")
String sppartnerServiceId = service.get("id")
if(sppartnerServiceId == null || sppartnerServiceId.equals("null")) {
@@ -562,7 +566,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
execution.setVariable("statusDescription", "Get Create ServiceOrder Exception")
logger.error("getE2ESIProgressin3rdONAP exception:" + e.getMessage())
}
- logger.info("Exit " + getE2ESIProgressin3rdONAP)
+ logger.info(" ***** Exit getE2ESIProgressin3rdONAP *****")
}
/**
@@ -570,7 +574,9 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
*/
public void timeDelay(DelegateExecution execution) {
try {
+ logger.debug("going to sleep for 5 sec")
Thread.sleep(5000)
+ logger.debug("wakeup after 5 sec")
} catch(InterruptedException e) {
logger.error("Time Delay exception" + e)
}
@@ -599,6 +605,8 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
AAIResourcesClient client = new AAIResourcesClient()
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SP_PARTNER, sppartnerId)
+ logger.info("sending request to create sp-partner: " + uri.toString())
+ logger.info("requestbody: " + partner)
client.create(uri, partner)
AAIResourceUri siUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId)
@@ -608,7 +616,7 @@ public class Create3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
logger.info(msg)
// throw new BpmnError("MSOWorkflowException")
}
- logger.info("Exit " + saveSPPartnerInAAI)
+ logger.info(" ***** Exit saveSPPartnerInAAI *****")
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
index d431bdc3b4..bcd33530b1 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
@@ -22,7 +22,7 @@
package org.onap.so.bpmn.infrastructure.scripts
-import com.google.gson.Gson
+
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
@@ -32,11 +32,8 @@ import org.onap.aai.domain.yang.ServiceInstance
import org.onap.aai.domain.yang.ServiceInstances
import org.onap.aai.domain.yang.v13.Metadata
import org.onap.aai.domain.yang.v13.Metadatum
-import org.onap.aai.domain.yang.v13.Pnf
-import org.onap.aai.domain.yang.v13.Pnfs
import org.onap.so.bpmn.common.recipe.ResourceInput
import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
-import org.onap.so.bpmn.common.scripts.AaiUtil
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.MsoUtils
@@ -52,8 +49,6 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.slf4j.Logger
import org.slf4j.LoggerFactory
-import static org.apache.commons.lang3.StringUtils.*
-
/**
* This groovy class supports the <class>CreateSDNCCNetworkResource.bpmn</class> process.
* flow for SDNC Network Resource Create
@@ -88,7 +83,6 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
//Deal with recipeParams
String recipeParamsFromWf = execution.getVariable("recipeParamXsd")
- String resourceName = resourceInputObj.getResourceInstanceName()
//For sdnc requestAction default is "createNetworkInstance"
String operationType = "Network"
@@ -100,9 +94,14 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
//the operationType from worflow(first node) is highest priority.
operationType = jsonUtil.getJsonValue(recipeParamsFromWf, "operationType")
}
+ String operationTypeFromConfig = UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() + ".operation-type")
+ if (StringUtils.isNotEmpty(operationTypeFromConfig)) {
+ // highest priority if operation type configured
+ operationType = operationTypeFromConfig
+ }
String sdnc_svcAction = "create"
- String sdnc_requestAction = sdnc_svcAction.capitalize() + UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".operation-type") + "Instance"
+ String sdnc_requestAction = sdnc_svcAction.capitalize() + operationType + "Instance"
String isActivateRequired = UrnPropertiesReader.getVariable("resource-config." + resourceInputObj.resourceModelInfo.getModelName() +".activation-required")
execution.setVariable("isActivateRequired", isActivateRequired)
@@ -277,28 +276,49 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
case ~/[\w\s\W]*sdwanvpnattachment[\w\s\W]*/ :
case ~/[\w\s\W]*sotnvpnattachment[\w\s\W]*/ :
+ case ~/[\w\s\W]*SOTN-Attachment[\w\s\W]*/ :
// fill attachment TP in networkInputParamJson
- String customer = resourceInputObj.getGlobalSubscriberId()
- String serviceType = resourceInputObj.getServiceType()
-
- def vpnName = StringUtils.containsIgnoreCase(modelName, "sotnvpnattachment") ? "sotnvpnattachmentvf_sotncondition_sotnVpnName" : "sdwanvpnattachmentvf_sdwancondition_sdwanVpnName"
- String parentServiceName = jsonUtil.getJsonValueForKey(resourceInputObj.getRequestsInputs(), vpnName)
-
- AAIResourcesClient client = new AAIResourcesClient()
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.SERVICE_INSTANCE, customer, serviceType).queryParam("service-instance-name", parentServiceName)
- ServiceInstances sis = client.get(uri).asBean(ServiceInstances.class).get()
- ServiceInstance si = sis.getServiceInstance().get(0)
-
- def parentServiceInstanceId = si.getServiceInstanceId()
- execution.setVariable("parentServiceInstanceId", parentServiceInstanceId)
+ def vpnName = StringUtils.containsIgnoreCase(modelName, "sotnvpnattachment") ? "sotnvpnattachmentvf_sotncondition_sotnVpnName" : (StringUtils.containsIgnoreCase(modelName, "SOTN-Attachment") ? "elinesotnattachmentvf0_elinesotnattachmentvfc0_sotnVpnName" : "sdwanvpnattachmentvf_sdwancondition_sdwanVpnName")
+ fillAttachmentTPInfo(resourceInputObj, execution, vpnName)
break
default:
+ // Special case for handling alloted resource types
+ // in case name is different as expected
+ if ("ALLOTTED_RESOURCE".equals(resourceInputObj.getResourceModelInfo().getModelType())) {
+ def vpnName = modelName + "_sotnVpnName"
+ fillAttachmentTPInfo(resourceInputObj, execution, vpnName)
+ }
break
}
return resourceInputObj
}
+ private void fillAttachmentTPInfo(ResourceInput resourceInputObj, DelegateExecution execution, String vpnName) {
+
+ String parentServiceName = jsonUtil.getJsonValueForKey(resourceInputObj.getRequestsInputs(), vpnName)
+
+ AAIResourcesClient client = new AAIResourcesClient()
+ logger.info("sending request to resolve vpn-name:" + vpnName)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(new AAIObjectPlurals("/nodes", "/service-instances", "queryByName")).queryParam("service-instance-name", parentServiceName)
+ Optional<ServiceInstances> serviceInstancesOpt = client.get(ServiceInstances.class, uri)
+
+ if(serviceInstancesOpt.isPresent()) {
+ List<ServiceInstance> serviceInstanceList = serviceInstancesOpt.get().getServiceInstance()
+ logger.info("response from aai:" + serviceInstanceList.toString())
+ if (serviceInstanceList.size() > 0) {
+ ServiceInstance si = serviceInstanceList.get(0)
+ String parentServiceInstanceId = si.getServiceInstanceId()
+ execution.setVariable("parentServiceInstanceId", parentServiceInstanceId)
+ logger.info("setting parentService id:" + parentServiceInstanceId)
+ } else {
+ logger.error("No service instance found for given name.")
+ }
+ } else {
+ logger.error("No nodes found with this name" + vpnName)
+ }
+ }
+
/**
* Pre Process the BPMN Flow Request
* Includes:
@@ -339,26 +359,7 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
// 1. prepare assign topology via SDNC Adapter SUBFLOW call
String sdncTopologyCreateRequest = "";
-
-
- //When a new resource creation request reaches SO, the parent resources information needs to be provided
- //while creating the child resource.
- String vnfid = ""
- String vnfmodelInvariantUuid = ""
- String vnfmodelCustomizationUuid = ""
- String vnfmodelUuid = ""
- String vnfmodelVersion = ""
- String vnfmodelName = ""
String modelType = resourceInputObj.getResourceModelInfo().getModelType()
- if(modelType.equalsIgnoreCase(ResourceType.GROUP.toString())) {
- vnfid = resourceInputObj.getVnfId()
- ModelInfo vfModelInfo = resourceInputObj.getVfModelInfo()
- vnfmodelInvariantUuid = vfModelInfo.getModelInvariantUuid()
- vnfmodelCustomizationUuid = vfModelInfo.getModelCustomizationUuid()
- vnfmodelUuid = vfModelInfo.getModelUuid()
- vnfmodelVersion = vfModelInfo.getModelVersion()
- vnfmodelName = vfModelInfo.getModelName()
- }
switch (modelType) {
case "VNF" :
@@ -418,6 +419,13 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
</aetgt:SDNCAdapterWorkflowRequest>""".trim()
break
case "GROUP" :
+ String vnfid = resourceInputObj.getVnfId()
+ ModelInfo vfModelInfo = resourceInputObj.getVfModelInfo()
+ String vnfmodelInvariantUuid = vfModelInfo.getModelInvariantUuid()
+ String vnfmodelCustomizationUuid = vfModelInfo.getModelCustomizationUuid()
+ String vnfmodelUuid = vfModelInfo.getModelUuid()
+ String vnfmodelVersion = vfModelInfo.getModelVersion()
+ String vnfmodelName = vfModelInfo.getModelName()
sdncTopologyCreateRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
@@ -480,7 +488,62 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
</aetgt:SDNCAdapterWorkflowRequest>""".trim()
break
- // for SDWANConnectivity and SOTNConnectivity:
+ // sdwanvpnattachment or sotnvpnattachment
+ case "ALLOTTED_RESOURCE" :
+ sdncTopologyCreateRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
+ xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>${msoUtils.xmlEscape(hdrRequestId)}</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>${msoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>${msoUtils.xmlEscape(sdnc_svcAction)}</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>connection-attachment-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <sdncadapterworkflow:SDNCRequestData>
+ <request-information>
+ <request-id>${msoUtils.xmlEscape(hdrRequestId)}</request-id>
+ <request-action>${msoUtils.xmlEscape(sdnc_requestAction)}</request-action>
+ <source>${msoUtils.xmlEscape(source)}</source>
+ <notification-url></notification-url>
+ <order-number></order-number>
+ <order-version></order-version>
+ </request-information>
+ <service-information>
+ <service-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-id>
+ <subscription-service-type>${msoUtils.xmlEscape(serviceType)}</subscription-service-type>
+ <onap-model-information>
+ <model-invariant-uuid>${msoUtils.xmlEscape(serviceModelInvariantUuid)}</model-invariant-uuid>
+ <model-uuid>${msoUtils.xmlEscape(serviceModelUuid)}</model-uuid>
+ <model-version>${msoUtils.xmlEscape(serviceModelVersion)}</model-version>
+ <model-name>${msoUtils.xmlEscape(serviceModelName)}</model-name>
+ </onap-model-information>
+ <service-instance-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
+ <global-customer-id>${msoUtils.xmlEscape(globalCustomerId)}</global-customer-id>
+ <subscriber-name>${msoUtils.xmlEscape(globalCustomerId)}</subscriber-name>
+ </service-information>
+ <allotted-resource-information>
+ <allotted-resource-id></allotted-resource-id>
+ <allotted-resource-type></allotted-resource-type>
+ <parent-service-instance-id>$parentServiceInstanceId</parent-service-instance-id>
+ <onap-model-information>
+ <model-invariant-uuid>${msoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-uuid>
+ <model-customization-uuid>${msoUtils.xmlEscape(modelCustomizationUuid)}</model-customization-uuid>
+ <model-uuid>${msoUtils.xmlEscape(modelUuid)}</model-uuid>
+ <model-version>${msoUtils.xmlEscape(modelVersion)}</model-version>
+ <model-name>${msoUtils.xmlEscape(modelName)}</model-name>
+ </onap-model-information>
+ </allotted-resource-information>
+ <connection-attachment-request-input>
+ $netowrkInputParameters
+ </connection-attachment-request-input>
+ </sdncadapterworkflow:SDNCRequestData>
+ </aetgt:SDNCAdapterWorkflowRequest>""".trim()
+
+ break
+
+ // for SDWANConnectivity and SOTNConnectivity:
default:
sdncTopologyCreateRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
@@ -532,198 +595,6 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
}
-
-
-
- //switch (modelName) {
- // case ~/[\w\s\W]*deviceVF[\w\s\W]*/
- // case ~/[\w\s\W]*SiteWANVF[\w\s\W]*/ :
- // case ~/[\w\s\W]*SiteVF[\w\s\W]*/:
- /* sdncTopologyCreateRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
- xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
- xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>${msoUtils.xmlEscape(hdrRequestId)}</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>${msoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>${msoUtils.xmlEscape(sdnc_svcAction)}</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <sdncadapterworkflow:SDNCRequestData>
- <request-information>
- <request-id>${msoUtils.xmlEscape(hdrRequestId)}</request-id>
- <request-action>${msoUtils.xmlEscape(sdnc_requestAction)}</request-action>
- <source>${msoUtils.xmlEscape(source)}</source>
- <notification-url></notification-url>
- <order-number></order-number>
- <order-version></order-version>
- </request-information>
- <service-information>
- <service-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-id>
- <subscription-service-type>${msoUtils.xmlEscape(serviceType)}</subscription-service-type>
- <onap-model-information>
- <model-invariant-uuid>${msoUtils.xmlEscape(serviceModelInvariantUuid)}</model-invariant-uuid>
- <model-uuid>${msoUtils.xmlEscape(serviceModelUuid)}</model-uuid>
- <model-version>${msoUtils.xmlEscape(serviceModelVersion)}</model-version>
- <model-name>${msoUtils.xmlEscape(serviceModelName)}</model-name>
- </onap-model-information>
- <service-instance-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
- <global-customer-id>${msoUtils.xmlEscape(globalCustomerId)}</global-customer-id>
- <subscriber-name>${msoUtils.xmlEscape(globalCustomerId)}</subscriber-name>
- </service-information>
- <vnf-information>
- <vnf-id></vnf-id>
- <vnf-type></vnf-type>
- <onap-model-information>
- <model-invariant-uuid>${msoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-uuid>
- <model-customization-uuid>${msoUtils.xmlEscape(modelCustomizationUuid)}</model-customization-uuid>
- <model-uuid>${msoUtils.xmlEscape(modelUuid)}</model-uuid>
- <model-version>${msoUtils.xmlEscape(modelVersion)}</model-version>
- <model-name>${msoUtils.xmlEscape(modelName)}</model-name>
- </onap-model-information>
- </vnf-information>
- <vnf-request-input>
- <vnf-input-parameters>
- $netowrkInputParameters
- </vnf-input-parameters>
- <request-version></request-version>
- <vnf-name></vnf-name>
- <vnf-networks>
- </vnf-networks>
- </vnf-request-input>
- </sdncadapterworkflow:SDNCRequestData>
- </aetgt:SDNCAdapterWorkflowRequest>""".trim()
-
-
- break
-
- //case ~/[\w\s\W]*sdwanvpnattachment[\w\s\W]*/
- //case ~/[\w\s\W]*sotnvpnattachment[\w\s\W]*/ :
- /* sdncTopologyCreateRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
- xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
- xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>${msoUtils.xmlEscape(hdrRequestId)}</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>${msoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>${msoUtils.xmlEscape(sdnc_svcAction)}</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>connection-attachment-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <sdncadapterworkflow:SDNCRequestData>
- <request-information>
- <request-id>${msoUtils.xmlEscape(hdrRequestId)}</request-id>
- <request-action>${msoUtils.xmlEscape(sdnc_requestAction)}</request-action>
- <source>${msoUtils.xmlEscape(source)}</source>
- <notification-url></notification-url>
- <order-number></order-number>
- <order-version></order-version>
- </request-information>
- <service-information>
- <service-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-id>
- <subscription-service-type>${msoUtils.xmlEscape(serviceType)}</subscription-service-type>
- <onap-model-information>
- <model-invariant-uuid>${msoUtils.xmlEscape(serviceModelInvariantUuid)}</model-invariant-uuid>
- <model-uuid>${msoUtils.xmlEscape(serviceModelUuid)}</model-uuid>
- <model-version>${msoUtils.xmlEscape(serviceModelVersion)}</model-version>
- <model-name>${msoUtils.xmlEscape(serviceModelName)}</model-name>
- </onap-model-information>
- <service-instance-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
- <global-customer-id>${msoUtils.xmlEscape(globalCustomerId)}</global-customer-id>
- <subscriber-name>${msoUtils.xmlEscape(globalCustomerId)}</subscriber-name>
- </service-information><vnf-information>
- <vnf-id></vnf-id>
- <vnf-type></vnf-type>
- <onap-model-information>
- <model-invariant-uuid>${msoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-uuid>
- <model-customization-uuid>${msoUtils.xmlEscape(modelCustomizationUuid)}</model-customization-uuid>
- <model-uuid>${msoUtils.xmlEscape(modelUuid)}</model-uuid>
- <model-version>${msoUtils.xmlEscape(modelVersion)}</model-version>
- <model-name>${msoUtils.xmlEscape(modelName)}</model-name>
- </onap-model-information>
- </vnf-information>
- <vnf-request-input>
- <vnf-input-parameters>
- $netowrkInputParameters
- </vnf-input-parameters>
- <request-version></request-version>
- <vnf-name></vnf-name>
- <vnf-networks>
- </vnf-networks>
- </vnf-request-input>
- <allotted-resource-information>
- <!-- TODO: to be filled as per the request input -->
- <allotted-resource-id></allotted-resource-id>
- <allotted-resource-type></allotted-resource-type>
- <parent-service-instance-id>$parentServiceInstanceId</parent-service-instance-id>
- <onap-model-information>
- <model-invariant-uuid>${msoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-uuid>
- <model-customization-uuid>${msoUtils.xmlEscape(modelCustomizationUuid)}</model-customization-uuid>
- <model-uuid>${msoUtils.xmlEscape(modelUuid)}</model-uuid>
- <model-version>${msoUtils.xmlEscape(modelVersion)}</model-version>
- <model-name>${msoUtils.xmlEscape(modelName)}</model-name>
- </onap-model-information>
- </allotted-resource-information>
- <connection-attachment-request-input>
- $netowrkInputParameters
- </connection-attachment-request-input>
- </sdncadapterworkflow:SDNCRequestData>
- </aetgt:SDNCAdapterWorkflowRequest>""".trim()
- break
-
- // for SDWANConnectivity and SOTNConnectivity:
- default:
- sdncTopologyCreateRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
- xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
- xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
- <sdncadapter:RequestHeader>
- <sdncadapter:RequestId>${hdrRequestId}</sdncadapter:RequestId>
- <sdncadapter:SvcInstanceId>${msoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId>
- <sdncadapter:SvcAction>${msoUtils.xmlEscape(sdnc_svcAction)}</sdncadapter:SvcAction>
- <sdncadapter:SvcOperation>network-topology-operation</sdncadapter:SvcOperation>
- <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
- <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
- </sdncadapter:RequestHeader>
- <sdncadapterworkflow:SDNCRequestData>
- <request-information>
- <request-id>${msoUtils.xmlEscape(hdrRequestId)}</request-id>
- <request-action>${msoUtils.xmlEscape(sdnc_requestAction)}</request-action>
- <source>${msoUtils.xmlEscape(source)}</source>
- <notification-url></notification-url>
- <order-number></order-number>
- <order-version></order-version>
- </request-information>
- <service-information>
- <service-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-id>
- <subscription-service-type>${msoUtils.xmlEscape(serviceType)}</subscription-service-type>
- <onap-model-information>
- <model-invariant-uuid>${msoUtils.xmlEscape(serviceModelInvariantUuid)}</model-invariant-uuid>
- <model-uuid>${msoUtils.xmlEscape(serviceModelUuid)}</model-uuid>
- <model-version>${msoUtils.xmlEscape(serviceModelVersion)}</model-version>
- <model-name>${msoUtils.xmlEscape(serviceModelName)}</model-name>
- </onap-model-information>
- <service-instance-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
- <global-customer-id>${msoUtils.xmlEscape(globalCustomerId)}</global-customer-id>
- </service-information>
- <network-information>
- <onap-model-information>
- <model-invariant-uuid>${msoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-uuid>
- <model-customization-uuid>${msoUtils.xmlEscape(modelCustomizationUuid)}</model-customization-uuid>
- <model-uuid>${msoUtils.xmlEscape(modelUuid)}</model-uuid>
- <model-version>${msoUtils.xmlEscape(modelVersion)}</model-version>
- <model-name>${msoUtils.xmlEscape(modelName)}</model-name>
- </onap-model-information>
- </network-information>
- <network-request-input>
- <network-input-parameters>$netowrkInputParameters</network-input-parameters>
- </network-request-input>
- </sdncadapterworkflow:SDNCRequestData>
- </aetgt:SDNCAdapterWorkflowRequest>""".trim()
- }
-
- **/
-
String sndcTopologyCreateRequesAsString = utils.formatXml(sdncTopologyCreateRequest)
execution.setVariable("sdncAdapterWorkflowRequest", sndcTopologyCreateRequesAsString)
logger.debug("sdncAdapterWorkflowRequest - " + "\n" + sndcTopologyCreateRequesAsString)
@@ -813,40 +684,20 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
String responseCode = execution.getVariable(Prefix + "sdncCreateReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
- def instnaceId = getInstnaceId(execution)
+ def instnaceId = getInstanceId(execution)
execution.setVariable("resourceInstanceId", instnaceId)
logger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
logger.info(" ***** Exit prepareSDNCRequest *****")
}
- private def getInstnaceId(DelegateExecution execution) {
+ private def getInstanceId(DelegateExecution execution) {
def response = new XmlSlurper().parseText(execution.getVariable("CRENWKI_createSDNCResponse"))
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(execution.getVariable(Prefix + "resourceInput"), ResourceInput.class)
String modelName = resourceInputObj.getResourceModelInfo().getModelName()
def val = ""
-
- //switch (modelName) {
- // case ~/[\w\s\W]*deviceVF[\w\s\W]*/ :
- // case ~/[\w\s\W]*SiteWANVF[\w\s\W]*/ :
- // case ~/[\w\s\W]*Site[\w\s\W]*/:
- // val = response."response-data"."RequestData"."output"."vnf-response-information"."instance-id"
- // break
-
- // case ~/[\w\s\W]*sdwanvpnattachment[\w\s\W]*/ :
- // case ~/[\w\s\W]*sotnvpprepareUpdateAfterCreateSDNCResourcenattachment[\w\s\W]*/:
- // val = response."response-data"."RequestData"."output"."connection-attachment-response-information"."instance-id"
- // break
-
- // for SDWANConnectivity and SOTNConnectivity and default:
- // default:
- // val = response."response-data"."RequestData"."output"."network-response-information"."instance-id"
- // break
- //}
-
-
String modelType = resourceInputObj.getResourceModelInfo().getModelType()
switch (modelType) {
case "VNF" :
@@ -855,7 +706,12 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor {
case "GROUP":
val = response."response-data"."RequestData"."output"."vf-module-response-information"."instance-id"
break
+ case "ALLOTTED_RESOURCE":
+ // sdwanvpnattachment or sotnvpnattachment
+ val = response."response-data"."RequestData"."output"."connection-attachment-response-information"."instance-id"
+ break
default:
+ // SDWANConnectivity or SOTN Connectivity
val = response."response-data"."RequestData"."output"."network-response-information"."instance-id"
break
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
index 3d62a6ca90..097a1be291 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
@@ -118,6 +118,8 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
String serviceInstanceId = execution.getVariable(Prefix + "serviceInstanceId")
String source = execution.getVariable("source")
String sdnc_service_id = execution.getVariable(Prefix + "sdncServiceId")
+ String resourceInput = execution.getVariable("resourceInput")
+ String allotedParentServiceInstanceId = execution.getVariable("allotedParentServiceInstanceId")
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
String serviceType = resourceInputObj.getServiceType()
String serviceModelInvariantUuid = resourceInputObj.getServiceModelInfo().getModelInvariantUuid()
@@ -268,6 +270,61 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
</aetgt:SDNCAdapterWorkflowRequest>""".trim()
break
+ // sdwanvpnattachment or sotnvpnattachment
+ case "ALLOTTED_RESOURCE" :
+
+ sdncTopologyDeleteRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
+ xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>${msoUtils.xmlEscape(hdrRequestId)}</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>${msoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>${msoUtils.xmlEscape(sdnc_svcAction)}</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>connection-attachment-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <sdncadapterworkflow:SDNCRequestData>
+ <request-information>
+ <request-id>${msoUtils.xmlEscape(hdrRequestId)}</request-id>
+ <request-action>${msoUtils.xmlEscape(sdnc_requestAction)}</request-action>
+ <source>${msoUtils.xmlEscape(source)}</source>
+ <notification-url></notification-url>
+ <order-number></order-number>
+ <order-version></order-version>
+ </request-information>
+ <service-information>
+ <service-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-id>
+ <subscription-service-type>${msoUtils.xmlEscape(serviceType)}</subscription-service-type>
+ <onap-model-information>
+ <model-invariant-uuid>${msoUtils.xmlEscape(serviceModelInvariantUuid)}</model-invariant-uuid>
+ <model-uuid>${msoUtils.xmlEscape(serviceModelUuid)}</model-uuid>
+ <model-version>${msoUtils.xmlEscape(serviceModelVersion)}</model-version>
+ <model-name>${msoUtils.xmlEscape(serviceModelName)}</model-name>
+ </onap-model-information>
+ <service-instance-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
+ <global-customer-id>${msoUtils.xmlEscape(globalCustomerId)}</global-customer-id>
+ <subscriber-name></subscriber-name>
+ </service-information>
+ <allotted-resource-information>
+ <allotted-resource-id>$resourceInstnaceId</allotted-resource-id>
+ <allotted-resource-type></allotted-resource-type>
+ <parent-service-instance-id>$allotedParentServiceInstanceId</parent-service-instance-id>
+ <onap-model-information>
+ <model-invariant-uuid>${msoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-uuid>
+ <model-customization-uuid>${msoUtils.xmlEscape(modelCustomizationUuid)}</model-customization-uuid>
+ <model-uuid>${msoUtils.xmlEscape(modelUuid)}</model-uuid>
+ <model-version>${msoUtils.xmlEscape(modelVersion)}</model-version>
+ <model-name>${msoUtils.xmlEscape(modelName)}</model-name>
+ </onap-model-information>
+ </allotted-resource-information>
+ <connection-attachment-request-input>
+ </connection-attachment-request-input>
+ </sdncadapterworkflow:SDNCRequestData>
+ </aetgt:SDNCAdapterWorkflowRequest>""".trim()
+
+ break
+
// for SDWANConnectivity and SOTNConnectivity:
default:
sdncTopologyDeleteRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
@@ -334,6 +391,7 @@ public class DeActivateSDNCNetworkResource extends AbstractServiceTaskProcessor
}
public void prepareUpdateAfterDeActivateSDNCResource(DelegateExecution execution) {
+ String resourceInput = execution.getVariable("resourceInput")
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
String operType = resourceInputObj.getOperationType()
String resourceCustomizationUuid = resourceInputObj.getResourceModelInfo().getModelCustomizationUuid()
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
index 443c8f6616..64ae3dfbef 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
@@ -217,6 +217,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
// ExternalAPI message format
String externalId = execution.getVariable("resourceName")
+ String serviceType = execution.getVariable("serviceType")
String category = "E2E Service"
String description = "Service Order from SPPartner"
String requestedStartDate = utils.generateCurrentTimeInUtc()
@@ -224,13 +225,14 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String priority = "1" // 0-4 0:highest
String subscriberId = execution.getVariable("globalSubscriberId")
String customerRole = "ONAPcustomer"
- String subscriberName = subscriberId
+ // Below SO will pass serviceType as subscriberName and externalAPI will use
+ // the same serviceType in another domain instead of model name
+ String subscriberName = serviceType
String referredType = "Consumer"
String orderItemId = "1"
String action = "delete" //for delete
String serviceState = "active"
String serviceName = ""
- String serviceType = execution.getVariable("serviceType")
String serviceId = execution.getVariable(Prefix + "SppartnerId")
queryServicefrom3rdONAP(execution)
@@ -260,7 +262,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
String payload = externalAPIUtil.setTemplate(ExternalAPIUtil.PostServiceOrderRequestsTemplate, valueMap)
execution.setVariable(Prefix + "Payload", payload)
- logger.info( "Exit " + prepare3rdONAPRequest)
+ logger.info( "***** Exit prepare3rdONAPRequest *****")
}
private void queryServicefrom3rdONAP(DelegateExecution execution)
@@ -294,7 +296,8 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
{
logger.debug("Get Service Received a Good Response")
JSONArray responseList = new JSONArray(extApiResponse)
- for(JSONObject obj : responseList) {
+ for(int i=0; i< responseList.length(); i++) {
+ JSONObject obj = responseList.getJSONObject(i)
String svcId = obj.get("id")
if(StringUtils.equalsIgnoreCase(SppartnerServiceId, svcId)) {
JSONObject serviceSpecification = obj.get("serviceSpecification")
@@ -311,7 +314,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}catch(Exception e) {
logger.error("queryServicefrom3rdONAP exception:" + e.getMessage())
}
- logger.info( "Exit " + queryServicefrom3rdONAP)
+ logger.info( "***** Exit queryServicefrom3rdONAP *****")
}
public void doDeleteE2ESIin3rdONAP(DelegateExecution execution) {
@@ -354,7 +357,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}catch(Exception e) {
logger.error("doDeleteE2ESIin3rdONAP exception:" + e.getMessage())
}
- logger.info( "Exit " + doDeleteE2ESIin3rdONAP)
+ logger.info( "***** Exit doDeleteE2ESIin3rdONAP *****")
}
@@ -450,7 +453,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
execution.setVariable("statusDescription", "Get Delete ServiceOrder Exception")
logger.error("getE2ESIProgressin3rdONAP exception:" + e.getMessage())
}
- logger.info( "Exit " + getE2ESIProgressin3rdONAP)
+ logger.info( "***** Exit getE2ESIProgressin3rdONAP *****")
}
/**
@@ -495,7 +498,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
// throw new BpmnError("MSOWorkflowException")
}
- logger.info( "Exit " + getSPPartnerInAAI)
+ logger.info( "***** Exit getSPPartnerInAAI *****")
}
public void deleteSPPartnerInAAI(DelegateExecution execution) {
@@ -516,7 +519,7 @@ public class Delete3rdONAPE2EServiceInstance extends AbstractServiceTaskProcesso
}
- logger.info( "Exit " + deleteSPPartnerInAAI)
+ logger.info( "**** Exit deleteSPPartnerInAAI ****")
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
index 49f0e14d17..7c8b7eb7cc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
@@ -25,6 +25,9 @@ package org.onap.so.bpmn.infrastructure.scripts
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.onap.aai.domain.yang.AllottedResource
+import org.onap.aai.domain.yang.Relationship
+import org.onap.aai.domain.yang.RelationshipData
import org.onap.so.bpmn.common.recipe.ResourceInput
import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
@@ -35,9 +38,16 @@ import org.onap.so.bpmn.core.domain.ModelInfo
import org.onap.so.bpmn.core.domain.ResourceType
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.core.UrnPropertiesReader
+import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.AAIResourcesClient
+import org.onap.so.client.aai.entities.AAIResultWrapper
+import org.onap.so.client.aai.entities.uri.AAIResourceUri
+import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.slf4j.Logger
import org.slf4j.LoggerFactory
+import javax.ws.rs.NotFoundException
+
import static org.apache.commons.lang3.StringUtils.*
/**
@@ -76,6 +86,27 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
//Deal with recipeParams
String recipeParamsFromWf = execution.getVariable("recipeParamXsd")
String resourceModelName = resourceInputObj.getResourceModelInfo().getModelName()
+ String resourceInstanceId = resourceInputObj.getResourceInstancenUuid()
+ String globalCustomerId = resourceInputObj.getGlobalSubscriberId()
+ String serviceType = resourceInputObj.getServiceType()
+ String serviceInstanceId = resourceInputObj.getServiceInstanceId()
+
+ // fetch parent instance id for allotted resources
+ String modelType = resourceInputObj.getResourceModelInfo().getModelType()
+ switch (modelType) {
+ // sdwanvpnattachment or sotnvpnattachment
+ case "ALLOTTED_RESOURCE":
+ String parentServiceId = fetchParentServiceInstance(globalCustomerId, serviceType, serviceInstanceId, resourceInstanceId)
+ if (null != parentServiceId) {
+ execution.setVariable("allotedParentServiceInstanceId", parentServiceId)
+ } else {
+ logger.warn("Alloted Resource ParentServiceInstanceId not found in AAI response for allotedId: " + resourceInstanceId)
+ }
+ break;
+ default:
+ break;
+ }
+
//For sdnc requestAction default is "NetworkInstance"
String operationType = "Network"
if(!StringUtils.isBlank(recipeParamsFromRequest) && "null" != recipeParamsFromRequest){
@@ -106,13 +137,47 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
} catch (BpmnError e) {
throw e;
} catch (Exception ex){
- msg = "Exception in preProcessRequest " + ex.getMessage()
+ String msg = "Exception in preProcessRequest " + ex.getMessage()
logger.debug( msg)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
logger.info(" ***** Exit preProcessRequest *****")
}
+ private String fetchParentServiceInstance(String globalCustId, String serviceType, String serviceInstanceId, String allotedResourceId ) {
+ logger.trace("Entered fetchParentServiceInstance")
+ try {
+ String parentServiceId = "";
+ AAIResourcesClient resourceClient = new AAIResourcesClient();
+ AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.ALLOTTED_RESOURCE, globalCustId, serviceType, serviceInstanceId, allotedResourceId)
+ AAIResultWrapper aaiResult = resourceClient.get(serviceInstanceUri, NotFoundException.class)
+ Optional<AllottedResource> si = aaiResult.asBean(AllottedResource.class)
+ if((si.present) && (null != si.get().getRelationshipList()) && (null != si.get().getRelationshipList().getRelationship())) {
+ logger.debug("SI Data relationship-list exists")
+ List<Relationship> relationshipList = si.get().getRelationshipList().getRelationship()
+ for (Relationship relationship : relationshipList) {
+ String rt = relationship.getRelatedTo()
+ List<RelationshipData> rl_datas = relationship.getRelationshipData()
+ if(rt.equals("service-instance") ){
+ for (RelationshipData rl_data : rl_datas) {
+ String eKey = rl_data.getRelationshipKey()
+ String eValue = rl_data.getRelationshipValue()
+ if(eKey.equals("service-instance.service-instance-id") && (!eValue.equals(serviceInstanceId))){
+ return eValue
+ }
+ }
+ }
+ }
+ }
+
+ logger.trace("Exited fetchParentServiceInstance")
+ }catch(Exception e){
+ logger.debug("Error occured within deleteServiceInstance method: " + e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Error occured during deleteServiceInstance from aai")
+ }
+ return null
+ }
+
/**
* Pre Process the BPMN Flow Request
* Includes:
@@ -135,6 +200,7 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
String sdnc_service_id = execution.getVariable(Prefix + "sdncServiceId")
String resourceInput = execution.getVariable(Prefix + "resourceInput")
logger.info("The resourceInput is: " + resourceInput)
+ String allotedParentServiceInstanceId = execution.getVariable("allotedParentServiceInstanceId")
ResourceInput resourceInputObj = ResourceRequestBuilder.getJsonObject(resourceInput, ResourceInput.class)
String serviceType = resourceInputObj.getServiceType()
String serviceModelInvariantUuid = resourceInputObj.getServiceModelInfo().getModelInvariantUuid()
@@ -285,7 +351,61 @@ public class DeleteSDNCNetworkResource extends AbstractServiceTaskProcessor {
</aetgt:SDNCAdapterWorkflowRequest>""".trim()
break
- // for SDWANConnectivity and SOTNConnectivity:
+ // sdwanvpnattachment or sotnvpnattachment
+ case "ALLOTTED_RESOURCE" :
+ sdncTopologyDeleteRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
+ xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
+ xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1">
+ <sdncadapter:RequestHeader>
+ <sdncadapter:RequestId>${msoUtils.xmlEscape(hdrRequestId)}</sdncadapter:RequestId>
+ <sdncadapter:SvcInstanceId>${msoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId>
+ <sdncadapter:SvcAction>${msoUtils.xmlEscape(sdnc_svcAction)}</sdncadapter:SvcAction>
+ <sdncadapter:SvcOperation>connection-attachment-topology-operation</sdncadapter:SvcOperation>
+ <sdncadapter:CallbackUrl>sdncCallback</sdncadapter:CallbackUrl>
+ <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction>
+ </sdncadapter:RequestHeader>
+ <sdncadapterworkflow:SDNCRequestData>
+ <request-information>
+ <request-id>${msoUtils.xmlEscape(hdrRequestId)}</request-id>
+ <request-action>${msoUtils.xmlEscape(sdnc_requestAction)}</request-action>
+ <source>${msoUtils.xmlEscape(source)}</source>
+ <notification-url></notification-url>
+ <order-number></order-number>
+ <order-version></order-version>
+ </request-information>
+ <service-information>
+ <service-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-id>
+ <subscription-service-type>${msoUtils.xmlEscape(serviceType)}</subscription-service-type>
+ <onap-model-information>
+ <model-invariant-uuid>${msoUtils.xmlEscape(serviceModelInvariantUuid)}</model-invariant-uuid>
+ <model-uuid>${msoUtils.xmlEscape(serviceModelUuid)}</model-uuid>
+ <model-version>${msoUtils.xmlEscape(serviceModelVersion)}</model-version>
+ <model-name>${msoUtils.xmlEscape(serviceModelName)}</model-name>
+ </onap-model-information>
+ <service-instance-id>${msoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
+ <global-customer-id>${msoUtils.xmlEscape(globalCustomerId)}</global-customer-id>
+ <subscriber-name></subscriber-name>
+ </service-information>
+ <allotted-resource-information>
+ <allotted-resource-id>$resourceInstnaceId</allotted-resource-id>
+ <allotted-resource-type></allotted-resource-type>
+ <parent-service-instance-id>$allotedParentServiceInstanceId</parent-service-instance-id>
+ <onap-model-information>
+ <model-invariant-uuid>${msoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-uuid>
+ <model-customization-uuid>${msoUtils.xmlEscape(modelCustomizationUuid)}</model-customization-uuid>
+ <model-uuid>${msoUtils.xmlEscape(modelUuid)}</model-uuid>
+ <model-version>${msoUtils.xmlEscape(modelVersion)}</model-version>
+ <model-name>${msoUtils.xmlEscape(modelName)}</model-name>
+ </onap-model-information>
+ </allotted-resource-information>
+ <connection-attachment-request-input>
+ </connection-attachment-request-input>
+ </sdncadapterworkflow:SDNCRequestData>
+ </aetgt:SDNCAdapterWorkflowRequest>""".trim()
+
+ break
+
+ // for SDWANConnectivity and SOTNConnectivity:
default:
sdncTopologyDeleteRequest = """<aetgt:SDNCAdapterWorkflowRequest xmlns:aetgt="http://org.onap/so/workflow/schema/v1"
xmlns:sdncadapter="http://org.onap.so/workflow/sdnc/adapter/schema/v1"
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
index a5a92b6b06..0191439dac 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
@@ -22,6 +22,9 @@
*/
package org.onap.so.bpmn.infrastructure.scripts
+import com.fasterxml.jackson.databind.ObjectMapper
+import com.fasterxml.jackson.databind.SerializationFeature
+
import org.onap.so.logger.LoggingAnchor
import org.onap.so.logger.ErrorCode;
@@ -31,6 +34,7 @@ import javax.ws.rs.NotFoundException
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.onap.aai.domain.yang.Relationship
import org.onap.aai.domain.yang.ServiceInstance
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
@@ -291,6 +295,103 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
logger.trace("Exit createServiceInstance ")
}
+ public void createCustomRelationship(DelegateExecution execution) {
+ logger.trace("createCustomRelationship ")
+ String msg = ""
+ try {
+ String uuiRequest = execution.getVariable("uuiRequest")
+ String vpnName = isNeedProcessCustomRelationship(uuiRequest)
+
+ if(null != vpnName){
+ logger.debug("fetching resource-link information for the given sotnVpnName:"+vpnName)
+ // fetch the service instance to link the relationship
+ AAIResourcesClient client = new AAIResourcesClient()
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.NODES_QUERY).queryParam("search-node-type","service-instance").queryParam("filter","service-instance-name:EQUALS:"+vpnName)
+ AAIResultWrapper aaiResult = client.get(uri,NotFoundException.class)
+ Map<String, Object> result = aaiResult.asMap()
+ List<Object> resources =
+ (List<Object>) result.getOrDefault("result-data", Collections.emptyList());
+ if(resources.size()>0) {
+ String relationshipUrl = ((Map<String, Object>) resources.get(0)).get("resource-link")
+
+ final Relationship body = new Relationship();
+ body.setRelatedLink(relationshipUrl)
+
+ createRelationShipInAAI(execution, body)
+ } else {
+ logger.warn("No resource-link found for the given sotnVpnName:"+vpnName)
+ }
+
+ } else {
+ logger.error("VPNName not found in request input")
+ }
+
+
+
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception ex) {
+
+ msg = "Exception in DoCreateE2EServiceInstance.createCustomRelationship. " + ex.getMessage()
+ logger.info(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ logger.trace("Exit createCustomRelationship ")
+ }
+
+ private void createRelationShipInAAI(DelegateExecution execution, final Relationship relationship){
+ logger.trace("createRelationShipInAAI ")
+ String msg = ""
+ try {
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ AAIResourcesClient client = new AAIResourcesClient()
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("serviceType"), serviceInstanceId).relationshipAPI()
+ client.create(uri, relationship)
+
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception ex) {
+
+ msg = "Exception in DoCreateE2EServiceInstance.createRelationShipInAAI. " + ex.getMessage()
+ logger.info(msg)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ logger.trace("Exit createRelationShipInAAI ")
+
+ }
+
+ private String isNeedProcessCustomRelationship(String uuiRequest) {
+ String requestInput = jsonUtil.getJsonValue(uuiRequest, "service.parameters.requestInputs")
+ Map<String, String> requestInputObject = getJsonObject(requestInput, Map.class);
+ if (requestInputObject == null) {
+ return null;
+ }
+
+ Optional<Map.Entry> firstKey =
+ requestInputObject.entrySet()
+ .stream()
+ .filter({entry -> entry.getKey().toString().contains("_sotnVpnName")})
+ .findFirst()
+ if (firstKey.isPresent()) {
+ return firstKey.get().getValue()
+ }
+
+ return null
+ }
+
+ private static <T> T getJsonObject(String jsonstr, Class<T> type) {
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
+ try {
+ return mapper.readValue(jsonstr, type);
+ } catch (IOException e) {
+ logger.error("{} {} fail to unMarshal json", MessageEnum.RA_NS_EXC.toString(),
+ ErrorCode.BusinessProcesssError.getValue(), e);
+ }
+ return null;
+ }
+
+
/**
* Gets the service instance and its relationships from aai
*/
@@ -483,6 +584,13 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
List<Resource> addResourceList = serviceDecomposition.getServiceResources()
execution.setVariable("addResourceList", addResourceList)
+ boolean isCreateResourceListValid = true
+ if (addResourceList == null || addResourceList.isEmpty()) {
+ isCreateResourceListValid = false
+ }
+
+ execution.setVariable("isCreateResourceListValid", isCreateResourceListValid)
+
logger.trace("COMPLETED preProcessForAddResource Process ")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
index 587337b647..b1356b9fb6 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy
@@ -28,7 +28,6 @@ import com.google.gson.Gson
import org.apache.http.util.EntityUtils
import org.onap.so.bpmn.common.resource.InstanceResourceList
import org.onap.so.bpmn.common.scripts.CatalogDbUtilsFactory
-import org.onap.so.bpmn.core.domain.GroupResource
import org.onap.so.bpmn.core.domain.ModelInfo
import org.onap.so.bpmn.core.domain.ResourceType
import org.onap.so.bpmn.infrastructure.properties.BPMNProperties
@@ -96,16 +95,6 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
logger.trace("Exit preProcessRequest ")
}
- // this method will convert resource list to instance_resource_list
- public void prepareInstanceResourceList(DelegateExecution execution) {
-
- String uuiRequest = execution.getVariable("uuiRequest")
- List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
- List<Resource> instanceResourceList = InstanceResourceList.getInstanceResourceList(sequencedResourceList, uuiRequest)
-
- execution.setVariable("instanceResourceList", instanceResourceList)
- }
-
public void sequenceResoure(DelegateExecution execution) {
logger.trace("Start sequenceResoure Process ")
@@ -134,23 +123,20 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
for (resourceType in resourceSequence) {
for (resource in addResourceList) {
if (StringUtils.containsIgnoreCase(resource.getModelInfo().getModelName(), resourceType)) {
- sequencedResourceList.add(resource)
+
// if resource type is vnfResource then check for groups also
// Did not use continue because if same model type is used twice
// then we would like to add it twice for processing
- // e.g. S{ V1{G1, G2, G1}} --> S{ V1{G1, G1, G2}}
- if (resource instanceof VnfResource) {
- if (resource.getGroupOrder() != null && !StringUtils.isEmpty(resource.getGroupOrder())) {
- String[] grpSequence = resource.getGroupOrder().split(",")
- for (String grpType in grpSequence) {
- for (GroupResource gResource in resource.getGroups()) {
- if (StringUtils.containsIgnoreCase(gResource.getModelInfo().getModelName(), grpType)) {
- sequencedResourceList.add(gResource)
- }
- }
- }
- }
+ // ex-1. S{ V1{G1, G2}} --> S{ V1{G1, G1, G2}}
+ // ex-2. S{ V1{G1, G2}} --> S{ V1{G1, G2, G2, G2} V1 {G1, G1, G2}}
+ if ((resource.getResourceType() == ResourceType.VNF) && (resource instanceof VnfResource)) {
+
+ // check the size of VNF/Group list from UUI
+ List<Resource> sequencedInstanceResourceList = InstanceResourceList.getInstanceResourceList((VnfResource) resource, incomingRequest)
+ sequencedResourceList.addAll(sequencedInstanceResourceList)
+ } else {
+ sequencedResourceList.add(resource)
}
if (resource instanceof NetworkResource) {
networkResourceList.add(resource)
@@ -167,7 +153,9 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
for (Resource rc : addResourceList){
if (rc instanceof VnfResource) {
- vnfResourceList.add(rc)
+ // check the size of VNF/Group list from UUI
+ List<Resource> sequencedGroupResourceList = InstanceResourceList.getInstanceResourceList((VnfResource) rc, incomingRequest)
+ vnfResourceList.addAll(sequencedGroupResourceList)
} else if (rc instanceof NetworkResource) {
networkResourceList.add(rc)
} else if (rc instanceof AllottedResource) {
@@ -216,8 +204,8 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
public void getCurrentResoure(DelegateExecution execution){
logger.trace("Start getCurrentResoure Process ")
def currentIndex = execution.getVariable("currentResourceIndex")
- List<Resource> instanceResourceList = execution.getVariable("instanceResourceList")
- Resource currentResource = instanceResourceList.get(currentIndex)
+ List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
+ Resource currentResource = sequencedResourceList.get(currentIndex)
execution.setVariable("resourceType", currentResource.getModelInfo().getModelName())
logger.info("Now we deal with resource:" + currentResource.getModelInfo().getModelName())
logger.trace("COMPLETED getCurrentResource Process ")
@@ -228,8 +216,8 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
def currentIndex = execution.getVariable("currentResourceIndex")
def nextIndex = currentIndex + 1
execution.setVariable("currentResourceIndex", nextIndex)
- List<Resource> instanceResourceList = execution.getVariable("instanceResourceList")
- if(nextIndex >= instanceResourceList.size()){
+ List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
+ if(nextIndex >= sequencedResourceList.size()){
execution.setVariable("allResourceFinished", "true")
}else{
execution.setVariable("allResourceFinished", "false")
@@ -256,7 +244,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
resourceInput.setOperationId(operationId)
resourceInput.setOperationType(operationType);
def currentIndex = execution.getVariable("currentResourceIndex")
- List<Resource> sequencedResourceList = execution.getVariable("instanceResourceList")
+ List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList")
Resource currentResource = sequencedResourceList.get(currentIndex)
resourceInput.setResourceModelInfo(currentResource.getModelInfo())
resourceInput.getResourceModelInfo().setModelType(currentResource.getResourceType().toString())
@@ -320,8 +308,8 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{
HttpResponse resp = bpmnRestClient.post(recipeURL, requestId, recipeTimeOut, requestAction, serviceInstanceId, serviceType, resourceInput, recipeParamXsd)
def currentIndex = execution.getVariable("currentResourceIndex")
- List<Resource> instanceResourceList = execution.getVariable("instanceResourceList") as List<Resource>
- Resource currentResource = instanceResourceList.get(currentIndex)
+ List<Resource> sequencedResourceList = execution.getVariable("sequencedResourceList") as List<Resource>
+ Resource currentResource = sequencedResourceList.get(currentIndex)
if(ResourceType.VNF == currentResource.getResourceType()) {
if (resp.getStatusLine().getStatusCode() > 199 && resp.getStatusLine().getStatusCode() < 300) {
String responseString = EntityUtils.toString(resp.getEntity(), "UTF-8")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
index e24597aab3..481a79a7ef 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteE2EServiceInstance.groovy
@@ -58,9 +58,9 @@ import org.onap.so.utils.TargetEntity
import org.springframework.web.util.UriUtils
import javax.ws.rs.NotFoundException
+import javax.ws.rs.core.MediaType
import javax.ws.rs.core.Response
-
import static org.apache.commons.lang3.StringUtils.isBlank
/**
@@ -237,6 +237,9 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
)) {
jObj.put("resourceInstanceId", eValue)
}
+ else if (rt.equals("allotted-resource") && eKey.equals("allotted-resource.id")){
+ jObj.put("resourceInstanceId", eValue)
+ }
// for sp-partner and others
else if (eKey.endsWith("-id")) {
jObj.put("resourceInstanceId", eValue)
@@ -386,7 +389,10 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
URL url = new URL(serviceAaiPath)
HttpClient client = new HttpClientFactory().newXmlClient(url, TargetEntity.AAI)
-
+ client.addBasicAuthHeader(UrnPropertiesReader.getVariable("aai.auth", execution), UrnPropertiesReader.getVariable("mso.msoKey", execution))
+ client.addAdditionalHeader("X-FromAppId", "MSO")
+ client.addAdditionalHeader("X-TransactionId", utils.getRequestID())
+ client.setAcceptType(MediaType.APPLICATION_XML)
Response response = client.get()
int responseCode = response.getStatus()
@@ -413,12 +419,17 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
if(jObj.has("model-invariant-id")) {
modelInvariantId = jObj.get("model-invariant-id")
modelUuid = jObj.get("model-version-id")
- modelCustomizationId = jObj.get("model-customization-id")
+ if (jObj.has("model-customization-id")) {
+ modelCustomizationId = jObj.get("model-customization-id")
+ } else {
+ logger.info("resource customization id is not found for :" + url)
+ }
}
jObj.put("modelInvariantId", modelInvariantId)
jObj.put("modelVersionId", modelUuid)
jObj.put("modelCustomizationId", modelCustomizationId)
+ logger.info("resource detail from AAI:" + jObj)
}
else {
String exceptionMessage = "Get RelatedResource Received a Bad Response Code. Response Code is: " + responseCode
@@ -505,11 +516,12 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
String modelName = resource.getModelInfo().getModelName()
String modelCustomizationUuid = resource.getModelInfo().getModelCustomizationUuid()
+ String modelUuid = resource.getModelInfo().getModelUuid()
if (StringUtils.containsIgnoreCase(obj.get("resourceType"), modelName)) {
resource.setResourceId(obj.get("resourceInstanceId"))
//deleteRealResourceList.add(resource)
matches = true;
- } else if (modelCustomizationUuid.equals(obj.get("modelCustomizationId"))) {
+ } else if (modelCustomizationUuid.equals(obj.get("modelCustomizationId")) || modelUuid.equals(obj.get("model-version-id")) ) {
resource.setResourceId(obj.get("resourceInstanceId"))
resource.setResourceInstanceName(obj.get("resourceType"))
//deleteRealResourceList.add(resource)
@@ -624,4 +636,26 @@ public class DoDeleteE2EServiceInstance extends AbstractServiceTaskProcessor {
//to do
}
+ /**
+ * Deletes the service instance in aai
+ */
+ public void deleteServiceInstance(DelegateExecution execution) {
+ logger.trace("Entered deleteServiceInstance")
+ try {
+ String globalCustId = execution.getVariable("globalSubscriberId")
+ String serviceType = execution.getVariable("serviceType")
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+
+ AAIResourcesClient resourceClient = new AAIResourcesClient();
+ AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustId, serviceType, serviceInstanceId)
+ resourceClient.delete(serviceInstanceUri)
+
+ logger.trace("Exited deleteServiceInstance")
+ }catch(Exception e){
+ logger.debug("Error occured within deleteServiceInstance method: " + e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Error occured during deleteServiceInstance from aai")
+ }
+ }
+
+
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
index 21f9484cbc..df8735aaaa 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
@@ -267,7 +267,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
execution.setVariable(Prefix + "queryAAIResponse", l3Network.get())
execution.setVariable(Prefix + "isAAIGood", true)
if (relationships.isPresent()){
- if(relationships.get().getRelatedAAIUris(AAIObjectType.VF_MODULE).isEmpty()){
+ if(!relationships.get().getRelatedAAIUris(AAIObjectType.VF_MODULE).isEmpty()){
execution.setVariable(Prefix + "isVfRelationshipExist", true)
isVfRelationshipExist = true
String relationshipMessage = "AAI Query Success Response but 'vf-module' relationship exist, not allowed to delete: network Id: " + networkId
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
index 2dcfcaa4f4..53c1e311e2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
@@ -271,6 +271,7 @@ public class DoDeleteResourcesV1 extends AbstractServiceTaskProcessor {
execution.setVariable("sequencedResourceList", sequencedResourceList)
execution.setVariable("parentVNF", parentVNF)
logger.debug("resourceSequence: " + resourceSequence)
+ logger.debug("delete resource sequence list : " + sequencedResourceList)
logger.debug(" ======== END sequenceResource Process ======== ")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
index ad388feffc..c7c12bf4e7 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/vfcmodel/NsParameters.java
@@ -37,7 +37,7 @@ public class NsParameters {
private List<LocationConstraint> locationConstraints;
- private Map<String, Object> additionalParamForNs = new HashMap<String, Object>();
+ private Map<String, Object> additionalParamForNs = new HashMap<>();
/**
* @return Returns the locationConstraints.
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
index 22c4f95a6f..95be6ba7fc 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java
@@ -26,14 +26,17 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import java.io.IOException;
+import java.io.InputStream;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
+import java.util.Properties;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
@@ -54,6 +57,8 @@ import org.camunda.bpm.engine.runtime.Execution;
import org.onap.aai.domain.yang.LogicalLink;
import org.onap.aai.domain.yang.LogicalLinks;
import org.onap.aai.domain.yang.PInterface;
+import org.onap.aai.domain.yang.Pnf;
+import org.onap.aai.domain.yang.Relationship;
import org.onap.so.bpmn.core.UrnPropertiesReader;
import org.onap.so.bpmn.core.domain.Resource;
import org.onap.so.bpmn.core.domain.ServiceDecomposition;
@@ -73,13 +78,9 @@ import org.springframework.web.util.UriUtils;
public class ServicePluginFactory {
- // SOTN calculate route
- public static final String OOF_DEFAULT_ENDPOINT = "http://192.168.1.223:8443/oof/sotncalc";
-
- public static final String THIRD_SP_DEFAULT_ENDPOINT = "http://192.168.1.223:8443/sp/resourcemgr/querytps";
-
- public static final String INVENTORY_OSS_DEFAULT_ENDPOINT = "http://192.168.1.199:8443/oss/inventory";
-
+ private static String OOF_DEFAULT_ENDPOINT;
+ private static String THIRD_SP_DEFAULT_ENDPOINT;
+ private static String INVENTORY_OSS_DEFAULT_ENDPOINT;
private static final int DEFAULT_TIME_OUT = 60000;
static JsonUtils jsonUtil = new JsonUtils();
@@ -88,6 +89,17 @@ public class ServicePluginFactory {
private static ServicePluginFactory instance;
+ static {
+ try (InputStream is = ClassLoader.class.getResourceAsStream("/application.properties")) {
+ Properties prop = new Properties();
+ prop.load(is);
+ OOF_DEFAULT_ENDPOINT = prop.getProperty("oof.default.endpoint");
+ THIRD_SP_DEFAULT_ENDPOINT = prop.getProperty("third.sp.default.endpoint");
+ INVENTORY_OSS_DEFAULT_ENDPOINT = prop.getProperty("inventory.oss.default.endpoint");
+ } catch (IOException e) {
+ logger.error("Failed to load property file!");
+ }
+ }
public static synchronized ServicePluginFactory getInstance() {
if (null == instance) {
@@ -157,8 +169,7 @@ public class ServicePluginFactory {
}
private boolean isNeedProcessSite(String uuiRequest) {
- return uuiRequest.toLowerCase().contains("site_address")
- && uuiRequest.toLowerCase().contains("sotncondition_clientsignal");
+ return uuiRequest.toLowerCase().contains("address") && uuiRequest.toLowerCase().contains("clientsignal");
}
@SuppressWarnings("unchecked")
@@ -169,6 +180,7 @@ public class ServicePluginFactory {
return true;
}
String host = (String) tpInfoMap.get("host");
+ logger.info("host string from tpinfo:" + host);
// host is empty means TP is in local, not empty means TP is in remote ONAP
if (!host.isEmpty()) {
return false;
@@ -182,17 +194,33 @@ public class ServicePluginFactory {
accessTPInfo.put("access-ltp-id", tpInfoMap.get("access-ltp-id"));
// change resources
+ boolean flgResourceFound = false;
String resourceName = (String) tpInfoMap.get("resourceName");
for (Object curResource : resources) {
Map<String, Object> resource = (Map<String, Object>) curResource;
String curResourceName = (String) resource.get("resourceName");
curResourceName = curResourceName.replaceAll(" ", "");
if (resourceName.equalsIgnoreCase(curResourceName)) {
+ flgResourceFound = true;
+ logger.info("found match to add site tp info using uui template resource name");
putResourceRequestInputs(resource, accessTPInfo);
break;
}
}
+ if (!flgResourceFound) {
+ String attacmentResName = UrnPropertiesReader.getVariable("sp-partner.attachment-resource-name");
+ for (Object curResource : resources) {
+ Map<String, Object> resource = (Map<String, Object>) curResource;
+ String curResourceName = (String) resource.get("resourceName");
+
+ if (attacmentResName.equals(curResourceName)) {
+ logger.info("found match to add site tp info using customized resource name");
+ putResourceRequestInputs(resource, accessTPInfo);
+ }
+ }
+ }
+
return true;
}
@@ -206,10 +234,10 @@ public class ServicePluginFactory {
// logic for R2 uuiRequest params in service level
for (Entry<String, Object> entry : serviceRequestInputs.entrySet()) {
String key = entry.getKey();
- if (key.toLowerCase().contains("site_address")) {
+ if (key.toLowerCase().contains("address")) {
location = entry.getValue();
}
- if (key.toLowerCase().contains("sotncondition_clientsignal")) {
+ if (key.toLowerCase().contains("clientsignal")) {
clientSignal = entry.getValue();
vpnAttachmentResourceName = key.substring(0, key.indexOf("_"));
}
@@ -233,10 +261,12 @@ public class ServicePluginFactory {
tpInfoMap = tpJson;
// add resourceName
tpInfoMap.put("resourceName", vpnAttachmentResourceName);
+ logger.info("*** we will try to find resourcename(" + vpnAttachmentResourceName
+ + ") to add resource input ***");
break;
}
}
- logger.debug("Get Terminal TP from InventoryOSS");
+ logger.info("Get Terminal TP from InventoryOSS: " + tpInfoMap);
return tpInfoMap;
}
@@ -321,10 +351,40 @@ public class ServicePluginFactory {
return false;
}
+ public static String CUSTOM_RESOURCE_TP = "custom-resource-tp";
+ public static String VS_MONITORED = "VS_assured";
+ public static String VS_UNMONITORED = "VS_besteffort";
+ public static String TS_MONITORED = "TS1";
+ public static String TS_UNMONITORED = "TS2";
+ public static String CUSTOM_TP_LIST[] = new String[] {VS_MONITORED, VS_UNMONITORED, TS_MONITORED, TS_UNMONITORED};
+
+ private void customizeTP(Map<String, Object> crossTps, String svcName, DelegateExecution execution) {
+ Optional<String> customType = Arrays.stream(CUSTOM_TP_LIST).filter(svcName::contains).findFirst();
+ if (customType.isPresent()) {
+ logger.info("customizing TP");
+ String localTPs = UrnPropertiesReader.getVariable(CUSTOM_RESOURCE_TP + "." + customType.get() + ".local");
+ String remoteTPs = UrnPropertiesReader.getVariable(CUSTOM_RESOURCE_TP + "." + customType.get() + ".remote");
+
+ String localTP = (String) crossTps.get("local-access-ltp-id");
+ String remoteTP = (String) crossTps.get("remote-access-ltp-id");
+
+ if (localTPs.contains(localTP) && remoteTPs.contains(remoteTP)) {
+ logger.info("using same tp returned from AAI");
+ return;
+ }
+
+ crossTps.put("local-access-ltp-id", localTPs.split(",")[0]);
+ crossTps.put("remote-access-ltp-id", remoteTPs.split(",")[0]);
+ }
+ logger.info("cross TP info:" + crossTps);
+ }
+
@SuppressWarnings("unchecked")
private void allocateCrossTPResources(DelegateExecution execution, Map<String, Object> serviceRequestInputs) {
- Map<String, Object> crossTPs = this.getTPsfromAAI();
+ String serviceName = (String) execution.getVariable("serviceInstanceName");
+ Map<String, Object> crossTPs = this.getTPsfromAAI(serviceName);
+ // customizeTP(crossTPs, serviceName, execution);
if (crossTPs == null || crossTPs.isEmpty()) {
serviceRequestInputs.put("local-access-provider-id", "");
@@ -344,17 +404,45 @@ public class ServicePluginFactory {
serviceRequestInputs.put("local-access-node-id", crossTPs.get("local-access-node-id"));
serviceRequestInputs.put("local-access-ltp-id", crossTPs.get("local-access-ltp-id"));
serviceRequestInputs.put("remote-access-provider-id", crossTPs.get("remote-access-provider-id"));
- serviceRequestInputs.put("remote-access-client-id", crossTPs.get("remote-client-id"));
- serviceRequestInputs.put("remote-access-topology-id", crossTPs.get("remote-topology-id"));
- serviceRequestInputs.put("remote-access-node-id", crossTPs.get("remote-node-id"));
- serviceRequestInputs.put("remote-access-ltp-id", crossTPs.get("remote-ltp-id"));
+ serviceRequestInputs.put("remote-access-client-id", crossTPs.get("remote-access-client-id"));
+ serviceRequestInputs.put("remote-access-topology-id", crossTPs.get("remote-access-topology-id"));
+ serviceRequestInputs.put("remote-access-node-id", crossTPs.get("remote-access-node-id"));
+ serviceRequestInputs.put("remote-access-ltp-id", crossTPs.get("remote-access-ltp-id"));
}
return;
}
+ private LogicalLink selectLogicalLink(List<LogicalLink> logicalLinks, String svcName) {
+ Optional<String> customType = Arrays.stream(CUSTOM_TP_LIST).filter(svcName::contains).findFirst();
+ if (customType.isPresent()) {
+
+ String[] allowedList =
+ UrnPropertiesReader.getVariable(CUSTOM_RESOURCE_TP + "." + customType.get() + ".local").split(",");
+
+ for (String localTp : allowedList) {
+ for (LogicalLink link : logicalLinks) {
+ for (Relationship relationship : link.getRelationshipList().getRelationship()) {
+ if (relationship.getRelatedTo().equals("p-interface")
+ && relationship.getRelatedLink().contains("-ltpId-" + localTp)
+ && link.getOperationalStatus().equalsIgnoreCase("up")) {
+ logger.info("linkname:" + link.getLinkName() + " is matching with allowed list");
+ return link;
+ }
+ }
+ }
+ }
+
+ logger.error("There is no matching logical link for allowed list :" + allowedList.toString());
+ return null;
+ } else {
+ logger.info("link customization is not required");
+ return logicalLinks.get(0);
+ }
+ }
+
// This method returns Local and remote TPs information from AAI
- public Map getTPsfromAAI() {
+ public Map getTPsfromAAI(String serviceName) {
Map<String, Object> tpInfo = new HashMap<>();
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.LOGICAL_LINK);
@@ -363,11 +451,11 @@ public class ServicePluginFactory {
if (result.isPresent()) {
LogicalLinks links = result.get();
- boolean isRemoteLink = false;
+ LogicalLink link = selectLogicalLink(links.getLogicalLink(), serviceName);
- links.getLogicalLink();
-
- for (LogicalLink link : links.getLogicalLink()) {
+ if (link != null) {
+ boolean isRemoteLink = false;
+ logger.info("processing link :" + link.getLinkName());
AAIResultWrapper wrapper = new AAIResultWrapper(link);
Optional<Relationships> optRelationships = wrapper.getRelationships();
List<AAIResourceUri> pInterfaces = new ArrayList<>();
@@ -377,57 +465,85 @@ public class ServicePluginFactory {
isRemoteLink = true;
}
pInterfaces.addAll(relationships.getRelatedAAIUris(AAIObjectType.P_INTERFACE));
- }
-
- if (isRemoteLink) {
- // find remote p interface
- AAIResourceUri localTP = null;
- AAIResourceUri remoteTP = null;
-
- AAIResourceUri pInterface0 = pInterfaces.get(0);
-
- if (isRemotePInterface(client, pInterface0)) {
- remoteTP = pInterfaces.get(0);
- localTP = pInterfaces.get(1);
- } else {
- localTP = pInterfaces.get(0);
- remoteTP = pInterfaces.get(1);
- }
-
- if (localTP != null && remoteTP != null) {
- // give local tp
- String tpUrl = localTP.build().toString();
- PInterface intfLocal = client.get(PInterface.class, localTP).get();
- tpInfo.put("local-access-node-id", tpUrl.split("/")[6]);
-
- String[] networkRef = intfLocal.getNetworkRef().split("/");
- if (networkRef.length == 6) {
- tpInfo.put("local-access-provider-id", networkRef[1]);
- tpInfo.put("local-access-client-id", networkRef[3]);
- tpInfo.put("local-access-topology-id", networkRef[5]);
+ if (isRemoteLink) {
+ // find remote p interface
+ AAIResourceUri localTP = null;
+ AAIResourceUri remoteTP = null;
+
+ AAIResourceUri pInterface0 = pInterfaces.get(0);
+
+ if (isRemotePInterface(client, pInterface0)) {
+ remoteTP = pInterfaces.get(0);
+ localTP = pInterfaces.get(1);
+ } else {
+ localTP = pInterfaces.get(0);
+ remoteTP = pInterfaces.get(1);
}
- String ltpIdStr = tpUrl.substring(tpUrl.lastIndexOf("/") + 1);
- if (ltpIdStr.contains("-")) {
- tpInfo.put("local-access-ltp-id", ltpIdStr.substring(ltpIdStr.lastIndexOf("-") + 1));
- }
-
- // give remote tp
- tpUrl = remoteTP.build().toString();
- PInterface intfRemote = client.get(PInterface.class, remoteTP).get();
- tpInfo.put("remote-access-node-id", tpUrl.split("/")[6]);
- String[] networkRefRemote = intfRemote.getNetworkRef().split("/");
-
- if (networkRefRemote.length == 6) {
- tpInfo.put("remote-access-provider-id", networkRefRemote[1]);
- tpInfo.put("remote-access-client-id", networkRefRemote[3]);
- tpInfo.put("remote-access-topology-id", networkRefRemote[5]);
- }
- String ltpIdStrR = tpUrl.substring(tpUrl.lastIndexOf("/") + 1);
- if (ltpIdStrR.contains("-")) {
- tpInfo.put("remote-access-ltp-id", ltpIdStrR.substring(ltpIdStr.lastIndexOf("-") + 1));
+ if (localTP != null && remoteTP != null) {
+ // give local tp
+ String tpUrl = localTP.build().toString();
+ String localNodeId = tpUrl.split("/")[4];
+ tpInfo.put("local-access-node-id", localNodeId);
+
+ logger.info("Get info for local TP :" + localNodeId);
+ Optional<Pnf> optLocalPnf = client.get(Pnf.class,
+ AAIUriFactory.createResourceUri(AAIObjectType.PNF, localNodeId));
+
+ if (optLocalPnf.isPresent()) {
+ Pnf localPnf = optLocalPnf.get();
+
+ for (Relationship rel : localPnf.getRelationshipList().getRelationship()) {
+ if (rel.getRelatedTo().equalsIgnoreCase("network-resource")) {
+ String[] networkRef = rel.getRelatedLink()
+ .substring(rel.getRelatedLink().lastIndexOf("/") + 1).split("-");
+ if (networkRef.length == 6) {
+ tpInfo.put("local-access-provider-id", networkRef[1]);
+ tpInfo.put("local-access-client-id", networkRef[3]);
+ tpInfo.put("local-access-topology-id", networkRef[5]);
+ }
+ }
+ }
+ }
+ String ltpIdStr = tpUrl.substring(tpUrl.lastIndexOf("/") + 1);
+ if (ltpIdStr.contains("-")) {
+ tpInfo.put("local-access-ltp-id", ltpIdStr.substring(ltpIdStr.lastIndexOf("-") + 1));
+ }
+
+ // give remote tp
+ tpUrl = remoteTP.build().toString();
+ PInterface intfRemote = client.get(PInterface.class, remoteTP).get();
+
+ String remoteNodeId = tpUrl.split("/")[4];
+ tpInfo.put("remote-access-node-id", remoteNodeId);
+
+ logger.info("Get info for remote TP:" + remoteNodeId);
+
+ String[] networkRefRemote = intfRemote.getNetworkRef().split("-");
+ Optional<Pnf> optRemotePnf = client.get(Pnf.class,
+ AAIUriFactory.createResourceUri(AAIObjectType.PNF, remoteNodeId));
+
+ if (optRemotePnf.isPresent()) {
+ Pnf remotePnf = optRemotePnf.get();
+
+ for (Relationship rel : remotePnf.getRelationshipList().getRelationship()) {
+ if (rel.getRelatedTo().equalsIgnoreCase("network-resource")) {
+ String[] networkRef = rel.getRelatedLink()
+ .substring(rel.getRelatedLink().lastIndexOf("/") + 1).split("-");
+ if (networkRef.length == 6) {
+ tpInfo.put("remote-access-provider-id", networkRefRemote[1]);
+ tpInfo.put("remote-access-client-id", networkRefRemote[3]);
+ tpInfo.put("remote-access-topology-id", networkRefRemote[5]);
+ }
+ }
+ }
+ }
+
+ String ltpIdStrR = tpUrl.substring(tpUrl.lastIndexOf("/") + 1);
+ if (ltpIdStrR.contains("-")) {
+ tpInfo.put("remote-access-ltp-id", ltpIdStrR.substring(ltpIdStr.lastIndexOf("-") + 1));
+ }
}
- return tpInfo;
}
}
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/resources/application.properties b/bpmn/so-bpmn-infrastructure-common/src/main/resources/application.properties
new file mode 100644
index 0000000000..87af45139c
--- /dev/null
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/resources/application.properties
@@ -0,0 +1,3 @@
+oof.default.endpoint=http://192.168.1.223:8443/oof/sotncalc
+third.sp.default.endpoint=http://192.168.1.223:8443/sp/resourcemgr/querytps
+inventory.oss.default.endpoint=http://192.168.1.199:8443/oss/inventory
diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactoryTest.java b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactoryTest.java
index 0b4050beec..6b310773b1 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactoryTest.java
+++ b/bpmn/so-bpmn-infrastructure-common/src/test/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactoryTest.java
@@ -20,6 +20,7 @@
package org.onap.so.bpmn.infrastructure.workflow.service;
import static org.mockito.Mockito.doReturn;
+import org.apache.commons.lang.reflect.FieldUtils;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -109,7 +110,7 @@ public class ServicePluginFactoryTest {
@Test
public void doTPResourcesAllocation_Success() {
- doReturn(null).when(servicePluginFactory).getTPsfromAAI();
+ doReturn(null).when(servicePluginFactory).getTPsfromAAI("test");
String result = servicePluginFactory.doTPResourcesAllocation(null, uuiRequest);
Assert.assertNotEquals(result, uuiRequest);
}
@@ -154,4 +155,21 @@ public class ServicePluginFactoryTest {
String result = servicePluginFactory.doServiceHoming(null, invalidJsonWithOnlyNeededValues);
Assert.assertEquals(result, invalidJsonWithOnlyNeededValues);
}
+
+ @Test
+ public void verifyExternalConfigurationLoading() throws IllegalAccessException {
+
+ ServicePluginFactory servicePluginFactory = ServicePluginFactory.getInstance();
+
+ String oofDefaultEndpoint = (String) FieldUtils.readField(servicePluginFactory, "OOF_DEFAULT_ENDPOINT", true);
+ Assert.assertNotNull(oofDefaultEndpoint);
+
+ String thirdSpDefaultEndpoint =
+ (String) FieldUtils.readField(servicePluginFactory, "THIRD_SP_DEFAULT_ENDPOINT", true);
+ Assert.assertNotNull(thirdSpDefaultEndpoint);
+
+ String inventoryOssDefaultEndpoint =
+ (String) FieldUtils.readField(servicePluginFactory, "INVENTORY_OSS_DEFAULT_ENDPOINT", true);
+ Assert.assertNotNull(inventoryOssDefaultEndpoint);
+ }
}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeActivateSDNCNetworkResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeActivateSDNCNetworkResource.bpmn
index cfcd259d7c..082860dd65 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeActivateSDNCNetworkResource.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeActivateSDNCNetworkResource.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="2.0.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="3.1.0">
<bpmn:process id="DeActivateSDNCNetworkResource" name="DeActivateSDNCNetworkResource" isExecutable="true">
<bpmn:startEvent id="deleteNetworkResource_StartEvent_deactivate" name="deleteNetworkResource_StartEvent">
<bpmn:outgoing>SequenceFlow_1qo2pln</bpmn:outgoing>
@@ -14,9 +14,9 @@ def dcsi = new DeActivateSDNCNetworkResource()
dcsi.prepareSDNCRequest(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:endEvent id="EndEvent_1x6k78c_deactivate" name="delete SDNC call end">
- <bpmn:incoming>SequenceFlow_15wux6a</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_0ow44q0</bpmn:incoming>
</bpmn:endEvent>
- <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred_deactivate" targetRef="ScriptTask_1emjxm2_deactivate" />
+ <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred_deactivate" targetRef="EndEvent_1x6k78c_deactivate" />
<bpmn:scriptTask id="Task_023hred_deactivate" name="post SDNC deactivate call">
<bpmn:incoming>SequenceFlow_13gl3wv</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0ow44q0</bpmn:outgoing>
@@ -39,14 +39,6 @@ dcsi.preProcessRequest(execution)</bpmn:script>
def dcsi = new DeActivateSDNCNetworkResource()
dcsi.prepareUpdateAfterDeActivateSDNCResource(execution)</bpmn:script>
</bpmn:scriptTask>
- <bpmn:scriptTask id="ScriptTask_1emjxm2_deactivate" name="Send Sync Ack Response" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_0ow44q0</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_15wux6a</bpmn:outgoing>
- <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def csi = new DeActivateSDNCNetworkResource()
-csi.sendSyncResponse(execution)</bpmn:script>
- </bpmn:scriptTask>
- <bpmn:sequenceFlow id="SequenceFlow_15wux6a" sourceRef="ScriptTask_1emjxm2_deactivate" targetRef="EndEvent_1x6k78c_deactivate" />
<bpmn:sequenceFlow id="SequenceFlow_1fjtgq7" sourceRef="PreprocessIncomingRequest_deactivate" targetRef="Task_0n0lj30_deactivate" />
<bpmn:callActivity id="Task_0n0lj30_deactivate" name="Call SDNC &#10; Adapter V1" calledElement="SDNCAdapterRestV1">
<bpmn:incoming>SequenceFlow_1fjtgq7</bpmn:incoming>
@@ -98,85 +90,75 @@ csi.sendSyncResponse(execution)</bpmn:script>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeActivateSDNCNetworkResource">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="deleteNetworkResource_StartEvent_deactivate">
- <dc:Bounds x="-111" y="111" width="36" height="36" />
+ <dc:Bounds x="180" y="111" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="-135" y="147" width="88" height="40" />
+ <dc:Bounds x="156" y="147" width="88" height="40" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1qo2pln_di" bpmnElement="SequenceFlow_1qo2pln">
- <di:waypoint x="-75" y="129" />
- <di:waypoint x="5" y="129" />
+ <di:waypoint x="216" y="129" />
+ <di:waypoint x="296" y="129" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-87.5" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_03j6ogo_di" bpmnElement="PreprocessIncomingRequest_deactivate">
- <dc:Bounds x="178" y="89" width="100" height="80" />
+ <dc:Bounds x="469" y="89" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c_deactivate">
- <dc:Bounds x="964" y="327" width="36" height="36" />
+ <dc:Bounds x="1255" y="327" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="928" y="369" width="84" height="27" />
+ <dc:Bounds x="1219" y="369" width="84" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0ow44q0_di" bpmnElement="SequenceFlow_0ow44q0">
- <di:waypoint x="735" y="345" />
- <di:waypoint x="795" y="345" />
+ <di:waypoint x="1026" y="345" />
+ <di:waypoint x="1255" y="345" />
<bpmndi:BPMNLabel>
<dc:Bounds x="719" y="314" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0gyej62_di" bpmnElement="Task_023hred_deactivate">
- <dc:Bounds x="635" y="305" width="100" height="80" />
+ <dc:Bounds x="926" y="305" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_18l3crb_di" bpmnElement="SequenceFlow_18l3crb">
- <di:waypoint x="105" y="129" />
- <di:waypoint x="178" y="129" />
+ <di:waypoint x="396" y="129" />
+ <di:waypoint x="469" y="129" />
<bpmndi:BPMNLabel>
<dc:Bounds x="235.5" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_14l9mlv_di" bpmnElement="Task_13sx2bp_deactivate">
- <dc:Bounds x="5" y="89" width="100" height="80" />
+ <dc:Bounds x="296" y="89" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1kqf4ge_di" bpmnElement="Task_0tezqd4_deactivate">
- <dc:Bounds x="333" y="305" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_1emjxm2_di" bpmnElement="ScriptTask_1emjxm2_deactivate">
- <dc:Bounds x="795" y="305" width="100" height="80" />
+ <dc:Bounds x="624" y="305" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_15wux6a_di" bpmnElement="SequenceFlow_15wux6a">
- <di:waypoint x="895" y="345" />
- <di:waypoint x="964" y="345" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="930" y="313" width="0" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1fjtgq7_di" bpmnElement="SequenceFlow_1fjtgq7">
<di:waypoint x="278" y="129" />
<di:waypoint x="333" y="129" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1pzm7qx_di" bpmnElement="SequenceFlow_1pzm7qx">
- <di:waypoint x="433" y="345" />
- <di:waypoint x="487" y="345" />
+ <di:waypoint x="724" y="345" />
+ <di:waypoint x="778" y="345" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ServiceTask_0k4fp1d_di" bpmnElement="Task_1a6f0p9_deactivate">
- <dc:Bounds x="487" y="305" width="100" height="80" />
+ <dc:Bounds x="778" y="305" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_13gl3wv_di" bpmnElement="SequenceFlow_13gl3wv">
- <di:waypoint x="587" y="345" />
- <di:waypoint x="635" y="345" />
+ <di:waypoint x="878" y="345" />
+ <di:waypoint x="926" y="345" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_0a0txik_di" bpmnElement="CallActivity_0a0txik_DeActivate">
- <dc:Bounds x="333" y="89" width="100" height="80" />
+ <dc:Bounds x="624" y="89" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0rn8vky_di" bpmnElement="SequenceFlow_0rn8vky">
- <di:waypoint x="383" y="169" />
- <di:waypoint x="383" y="305" />
+ <di:waypoint x="674" y="169" />
+ <di:waypoint x="674" y="305" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0nmt8ph_di" bpmnElement="SequenceFlow_0nmt8ph">
- <di:waypoint x="278" y="129" />
- <di:waypoint x="333" y="129" />
+ <di:waypoint x="569" y="129" />
+ <di:waypoint x="624" y="129" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteSDNCNetworkResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteSDNCNetworkResource.bpmn
index c2d4de3973..4cd4ab527f 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteSDNCNetworkResource.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteSDNCNetworkResource.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="2.0.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="3.1.0">
<bpmn:process id="DeleteSDNCNetworkResource" name="DeleteSDNCNetworkResource" isExecutable="true">
<bpmn:startEvent id="deleteNetworkResource_StartEvent_delete" name="deleteNetworkResource_StartEvent">
<bpmn:outgoing>SequenceFlow_1qo2pln_delete</bpmn:outgoing>
@@ -123,6 +123,7 @@ csi.sendSyncResponse(execution)</bpmn:script>
<camunda:in source="recipeParamXsd" target="recipeParamXsd" />
<camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
<camunda:in source="resourceInput" target="resourceInput" />
+ <camunda:in source="allotedParentServiceInstanceId" target="allotedParentServiceInstanceId" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_0h3klf0_delete</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_00vqgvt_delete</bpmn:outgoing>
@@ -154,145 +155,145 @@ dcsi.prepareUpdateAfterDeleteSDNCResource(execution)</bpmn:script>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteSDNCNetworkResource">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="deleteNetworkResource_StartEvent_delete">
- <dc:Bounds x="-111" y="111" width="36" height="36" />
+ <dc:Bounds x="180" y="244" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="-135" y="147" width="88" height="40" />
+ <dc:Bounds x="156" y="280" width="88" height="40" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1qo2pln_di" bpmnElement="SequenceFlow_1qo2pln_delete">
- <di:waypoint x="-75" y="129" />
- <di:waypoint x="-10" y="129" />
+ <di:waypoint x="216" y="262" />
+ <di:waypoint x="281" y="262" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-87.5" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0khtova_di" bpmnElement="SequenceFlow_0khtova_delete">
- <di:waypoint x="593" y="129" />
- <di:waypoint x="684" y="129" />
+ <di:waypoint x="884" y="262" />
+ <di:waypoint x="975" y="262" />
<bpmndi:BPMNLabel>
<dc:Bounds x="391.5" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_03j6ogo_di" bpmnElement="PreprocessIncomingRequest_task_delete">
- <dc:Bounds x="493" y="89" width="100" height="80" />
+ <dc:Bounds x="784" y="222" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c_delete">
- <dc:Bounds x="898" y="317" width="36" height="36" />
+ <dc:Bounds x="1189" y="450" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="862" y="359" width="84" height="27" />
+ <dc:Bounds x="1153" y="492" width="84" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0ow44q0_di" bpmnElement="SequenceFlow_0ow44q0_delete">
- <di:waypoint x="624" y="335" />
- <di:waypoint x="709" y="335" />
+ <di:waypoint x="915" y="468" />
+ <di:waypoint x="1000" y="468" />
<bpmndi:BPMNLabel>
<dc:Bounds x="719" y="314" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0gyej62_di" bpmnElement="Task_023hred_delete">
- <dc:Bounds x="524" y="295" width="100" height="80" />
+ <dc:Bounds x="815" y="428" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0w2es8j_di" bpmnElement="SequenceFlow_0w2es8j_delete">
- <di:waypoint x="90" y="129" />
- <di:waypoint x="148" y="129" />
+ <di:waypoint x="381" y="262" />
+ <di:waypoint x="439" y="262" />
<bpmndi:BPMNLabel>
<dc:Bounds x="74" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_18l3crb_di" bpmnElement="SequenceFlow_18l3crb_delete">
- <di:waypoint x="248" y="129" />
- <di:waypoint x="325" y="129" />
+ <di:waypoint x="539" y="262" />
+ <di:waypoint x="616" y="262" />
<bpmndi:BPMNLabel>
<dc:Bounds x="235.5" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0lc6l7a_di" bpmnElement="Task_1dlrfiw_delete">
- <dc:Bounds x="-10" y="89" width="100" height="80" />
+ <dc:Bounds x="281" y="222" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_14l9mlv_di" bpmnElement="Task_13sx2bp_delete">
- <dc:Bounds x="148" y="89" width="100" height="80" />
+ <dc:Bounds x="439" y="222" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1mz0vdx_di" bpmnElement="SequenceFlow_1mz0vdx_delete">
- <di:waypoint x="784" y="129" />
- <di:waypoint x="900" y="129" />
+ <di:waypoint x="1075" y="262" />
+ <di:waypoint x="1191" y="262" />
<bpmndi:BPMNLabel>
<dc:Bounds x="608" y="123" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_15mvedq_di" bpmnElement="SequenceFlow_15mvedq_delete">
- <di:waypoint x="950" y="169" />
- <di:waypoint x="950" y="246" />
- <di:waypoint x="-106" y="246" />
- <di:waypoint x="-106" y="335" />
- <di:waypoint x="9" y="335" />
+ <di:waypoint x="1241" y="302" />
+ <di:waypoint x="1241" y="379" />
+ <di:waypoint x="185" y="379" />
+ <di:waypoint x="185" y="468" />
+ <di:waypoint x="300" y="468" />
<bpmndi:BPMNLabel>
<dc:Bounds x="349" y="197" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1kqf4ge_di" bpmnElement="Task_0tfzqd4_delete">
- <dc:Bounds x="684" y="89" width="100" height="80" />
+ <dc:Bounds x="975" y="222" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1q6ssz7_di" bpmnElement="Task_18tomkl_delete">
- <dc:Bounds x="900" y="89" width="100" height="80" />
+ <dc:Bounds x="1191" y="222" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1cm8iwr_di" bpmnElement="ServiceTask_1cm8iwr_delete">
- <dc:Bounds x="355" y="295" width="100" height="80" />
+ <dc:Bounds x="646" y="428" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1emjxm2_di" bpmnElement="ScriptTask_1emjxm2_delete">
- <dc:Bounds x="709" y="295" width="100" height="80" />
+ <dc:Bounds x="1000" y="428" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_15wux6a_di" bpmnElement="SequenceFlow_15wux6a_delete">
- <di:waypoint x="809" y="335" />
- <di:waypoint x="898" y="335" />
+ <di:waypoint x="1100" y="468" />
+ <di:waypoint x="1189" y="468" />
<bpmndi:BPMNLabel>
<dc:Bounds x="930" y="313" width="0" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0ds04u5_di" bpmnElement="SequenceFlow_0ds04u5_delete">
- <di:waypoint x="455" y="335" />
- <di:waypoint x="524" y="335" />
+ <di:waypoint x="746" y="468" />
+ <di:waypoint x="815" y="468" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_0xrgeq3_di" bpmnElement="ExclusiveGateway_0xrgeq3_delete" isMarkerVisible="true">
- <dc:Bounds x="325" y="104" width="50" height="50" />
+ <dc:Bounds x="616" y="237" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="320" y="161" width="63" height="27" />
+ <dc:Bounds x="611" y="294" width="63" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0jh88qw_di" bpmnElement="SequenceFlow_0jh88qw_delete">
- <di:waypoint x="375" y="129" />
- <di:waypoint x="493" y="129" />
+ <di:waypoint x="666" y="262" />
+ <di:waypoint x="784" y="262" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="427" y="111" width="14" height="14" />
+ <dc:Bounds x="718" y="244" width="14" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0h3klf0_di" bpmnElement="SequenceFlow_0h3klf0_delete">
- <di:waypoint x="350" y="104" />
- <di:waypoint x="350" y="-12" />
- <di:waypoint x="493" y="-12" />
+ <di:waypoint x="641" y="237" />
+ <di:waypoint x="641" y="121" />
+ <di:waypoint x="784" y="121" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="356" y="43" width="19" height="14" />
+ <dc:Bounds x="647" y="176" width="19" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_00vqgvt_di" bpmnElement="SequenceFlow_00vqgvt_delete">
- <di:waypoint x="543" y="28" />
- <di:waypoint x="543" y="89" />
+ <di:waypoint x="834" y="161" />
+ <di:waypoint x="834" y="222" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_1lddjec_di" bpmnElement="Task_1xychp0_delete">
- <dc:Bounds x="493" y="-52" width="100" height="80" />
+ <dc:Bounds x="784" y="81" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1wj862v_di" bpmnElement="Task_1ikbt2h_delete">
- <dc:Bounds x="205" y="295" width="100" height="80" />
+ <dc:Bounds x="496" y="428" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0yooswe_di" bpmnElement="SequenceFlow_0yooswe_delete">
- <di:waypoint x="305" y="335" />
- <di:waypoint x="355" y="335" />
+ <di:waypoint x="596" y="468" />
+ <di:waypoint x="646" y="468" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="CallActivity_0bj0odq_di" bpmnElement="CallActivity_0bj0odq">
- <dc:Bounds x="9" y="295" width="100" height="80" />
+ <dc:Bounds x="300" y="428" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0lplazm_di" bpmnElement="SequenceFlow_0lplazm">
- <di:waypoint x="109" y="335" />
- <di:waypoint x="205" y="335" />
+ <di:waypoint x="400" y="468" />
+ <di:waypoint x="496" y="468" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
index 76dd6facd6..125f08c49e 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="2.2.4" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.1.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="DoCreateE2EServiceInstanceV3" name="DoCreateE2EServiceInstanceV3" isExecutable="true">
<bpmn2:startEvent id="createSI_startEvent" name="Start Flow">
<bpmn2:outgoing>SequenceFlow_1qiiycn</bpmn2:outgoing>
@@ -9,8 +9,7 @@
<bpmn2:outgoing>SequenceFlow_0w9t6tc</bpmn2:outgoing>
<bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi = new DoCreateE2EServiceInstance()
-dcsi.preProcessRequest(execution)
-</bpmn2:script>
+dcsi.preProcessRequest(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:subProcess id="SubProcess_06d8lk8" name="Sub-process for Application Errors" triggeredByEvent="true">
<bpmn2:startEvent id="StartEvent_0yljq9y">
@@ -38,8 +37,7 @@ dcsi.preProcessRequest(execution)
<bpmn2:outgoing>SequenceFlow_1lqktwf</bpmn2:outgoing>
<bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi = new DoCreateE2EServiceInstance()
-dcsi.preProcessRollback(execution)
-</bpmn2:script>
+dcsi.preProcessRollback(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_1lqktwf" sourceRef="ScriptTask_0ocetux" targetRef="CallActivity_1srx6p6" />
<bpmn2:scriptTask id="ScriptTask_1p0vyip" name="Post Process Rollback" scriptFormat="groovy">
@@ -47,8 +45,7 @@ dcsi.preProcessRollback(execution)
<bpmn2:outgoing>SequenceFlow_1xzgv5k</bpmn2:outgoing>
<bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi = new DoCreateE2EServiceInstance()
-dcsi.postProcessRollback(execution)
-</bpmn2:script>
+dcsi.postProcessRollback(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_1xzgv5k" sourceRef="ScriptTask_1p0vyip" targetRef="EndEvent_117lkk3" />
</bpmn2:subProcess>
@@ -98,10 +95,10 @@ dcsi.prepareDecomposeService(execution)</bpmn2:script>
<bpmn2:sequenceFlow id="SequenceFlow_1qiiycn" sourceRef="createSI_startEvent" targetRef="preProcessRequest_ScriptTask" />
<bpmn2:sequenceFlow id="SequenceFlow_166w91p" sourceRef="IntermediateCatchEvent_0tv85pg" targetRef="ScriptTask_1cllqk3" />
<bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_16okck2" name="GoTo StartPrepareResource">
- <bpmn2:incoming>SequenceFlow_1tkgqu3</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_19zefa9</bpmn2:incoming>
<bpmn2:linkEventDefinition name="StartPrepareResource" />
</bpmn2:intermediateThrowEvent>
- <bpmn2:sequenceFlow id="SequenceFlow_1tkgqu3" sourceRef="ScriptTask_0q37vn9" targetRef="IntermediateThrowEvent_16okck2" />
+ <bpmn2:sequenceFlow id="SequenceFlow_1tkgqu3" sourceRef="ScriptTask_0q37vn9" targetRef="Task_0osptcq" />
<bpmn2:sequenceFlow id="SequenceFlow_0w9t6tc" sourceRef="preProcessRequest_ScriptTask" targetRef="IntermediateThrowEvent_0bq4fxs" />
<bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_05dus9b" name="StartPrepareResource">
<bpmn2:outgoing>SequenceFlow_0yuzaen</bpmn2:outgoing>
@@ -156,7 +153,7 @@ ddsi.preInitResourcesOperStatus(execution)</bpmn2:script>
<camunda:in source="msoRequestId" target="msoRequestId" />
<camunda:out source="serviceDecomposition" target="serviceDecomposition" />
</bpmn2:extensionElements>
- <bpmn2:incoming>SequenceFlow_0b1dsaj</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_11zobkq</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0sphcy5</bpmn2:outgoing>
</bpmn2:callActivity>
<bpmn2:scriptTask id="ScriptTask_0ns08tn" name="PreProcess for Add Resources" scriptFormat="groovy">
@@ -168,6 +165,7 @@ csi.preProcessForAddResource(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:scriptTask id="ScriptTask_19t13rd" name="PostProcess for Add Resource" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_0sphcy5</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_1mvvc6c</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_18gnns6</bpmn2:outgoing>
<bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def csi = new DoCreateE2EServiceInstance()
@@ -193,253 +191,289 @@ dcsi.doTPResourcesAllocation(execution)</bpmn2:script>
<bpmn2:sequenceFlow id="SequenceFlow_1y9rkfr" sourceRef="ScriptTask_0jxdler" targetRef="ScriptTask_1rzf8a1" />
<bpmn2:sequenceFlow id="SequenceFlow_0n7nbx3" sourceRef="ScriptTask_1rzf8a1" targetRef="ServiceTask_1asgesv" />
<bpmn2:sequenceFlow id="SequenceFlow_0ckto7v" sourceRef="ServiceTask_1asgesv" targetRef="ScriptTask_0ts3c3b" />
- <bpmn2:sequenceFlow id="SequenceFlow_0b1dsaj" sourceRef="ScriptTask_0ns08tn" targetRef="CallActivity_1gae03e" />
+ <bpmn2:sequenceFlow id="SequenceFlow_0b1dsaj" sourceRef="ScriptTask_0ns08tn" targetRef="ExclusiveGateway_1hmlw0b" />
<bpmn2:sequenceFlow id="SequenceFlow_0sphcy5" sourceRef="CallActivity_1gae03e" targetRef="ScriptTask_19t13rd" />
<bpmn2:sequenceFlow id="SequenceFlow_022onug" sourceRef="ScriptTask_0ts3c3b" targetRef="ScriptTask_0ns08tn" />
<bpmn2:sequenceFlow id="SequenceFlow_18gnns6" sourceRef="ScriptTask_19t13rd" targetRef="EndEvent_1x4kvfh" />
<bpmn2:sequenceFlow id="SequenceFlow_0yuzaen" sourceRef="IntermediateCatchEvent_05dus9b" targetRef="ScriptTask_0jxdler" />
+ <bpmn2:sequenceFlow id="SequenceFlow_19zefa9" sourceRef="Task_0osptcq" targetRef="IntermediateThrowEvent_16okck2" />
+ <bpmn2:scriptTask id="Task_0osptcq" name="AAI&#10;Create Custom &#10;Relationship&#10;" scriptFormat="groovy">
+ <bpmn2:incoming>SequenceFlow_1tkgqu3</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_19zefa9</bpmn2:outgoing>
+ <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
+def ddsi = new DoCreateE2EServiceInstance()
+ddsi.createCustomRelationship(execution)</bpmn2:script>
+ </bpmn2:scriptTask>
+ <bpmn2:exclusiveGateway id="ExclusiveGateway_1hmlw0b" default="SequenceFlow_1mvvc6c">
+ <bpmn2:incoming>SequenceFlow_0b1dsaj</bpmn2:incoming>
+ <bpmn2:outgoing>SequenceFlow_11zobkq</bpmn2:outgoing>
+ <bpmn2:outgoing>SequenceFlow_1mvvc6c</bpmn2:outgoing>
+ </bpmn2:exclusiveGateway>
+ <bpmn2:sequenceFlow id="SequenceFlow_11zobkq" name="yes" sourceRef="ExclusiveGateway_1hmlw0b" targetRef="CallActivity_1gae03e">
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression">#{(execution.getVariable("isCreateResourceListValid" ) == true)}</bpmn2:conditionExpression>
+ </bpmn2:sequenceFlow>
+ <bpmn2:sequenceFlow id="SequenceFlow_1mvvc6c" sourceRef="ExclusiveGateway_1hmlw0b" targetRef="ScriptTask_19t13rd" />
</bpmn2:process>
<bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateE2EServiceInstanceV3">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_47" bpmnElement="createSI_startEvent">
- <dc:Bounds x="9" y="-22" width="36" height="36" />
+ <dc:Bounds x="172" y="103" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="3" y="19" width="50" height="12" />
+ <dc:Bounds x="166" y="144" width="50" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_61" bpmnElement="preProcessRequest_ScriptTask">
- <dc:Bounds x="117" y="-44" width="100" height="80" />
+ <dc:Bounds x="280" y="81" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="SubProcess_06d8lk8_di" bpmnElement="SubProcess_06d8lk8" isExpanded="true">
- <dc:Bounds x="15" y="865" width="783" height="195" />
+ <dc:Bounds x="178" y="990" width="783" height="195" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_0yljq9y_di" bpmnElement="StartEvent_0yljq9y">
- <dc:Bounds x="111" y="942" width="36" height="36" />
+ <dc:Bounds x="274" y="1067" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="84" y="983" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_117lkk3_di" bpmnElement="EndEvent_117lkk3">
- <dc:Bounds x="744" y="942" width="36" height="36" />
+ <dc:Bounds x="907" y="1067" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="717" y="983" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_1srx6p6_di" bpmnElement="CallActivity_1srx6p6">
- <dc:Bounds x="409" y="920" width="100" height="80" />
+ <dc:Bounds x="572" y="1045" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0eumzpf_di" bpmnElement="SequenceFlow_0eumzpf">
- <di:waypoint x="509" y="960" />
- <di:waypoint x="577" y="960" />
+ <di:waypoint x="672" y="1085" />
+ <di:waypoint x="740" y="1085" />
<bpmndi:BPMNLabel>
<dc:Bounds x="498" y="945" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0tgrn11_di" bpmnElement="SequenceFlow_0tgrn11">
- <di:waypoint x="147" y="960" />
- <di:waypoint x="246" y="960" />
+ <di:waypoint x="310" y="1085" />
+ <di:waypoint x="409" y="1085" />
<bpmndi:BPMNLabel>
<dc:Bounds x="152" y="945" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0q37vn9_di" bpmnElement="ScriptTask_0q37vn9">
- <dc:Bounds x="1012" y="106" width="100" height="80" />
+ <dc:Bounds x="1103" y="231" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0ocetux_di" bpmnElement="ScriptTask_0ocetux">
- <dc:Bounds x="246" y="920" width="100" height="80" />
+ <dc:Bounds x="409" y="1045" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1lqktwf_di" bpmnElement="SequenceFlow_1lqktwf">
- <di:waypoint x="346" y="960" />
- <di:waypoint x="409" y="960" />
+ <di:waypoint x="509" y="1085" />
+ <di:waypoint x="572" y="1085" />
<bpmndi:BPMNLabel>
<dc:Bounds x="333" y="945" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1p0vyip_di" bpmnElement="ScriptTask_1p0vyip">
- <dc:Bounds x="577" y="920" width="100" height="80" />
+ <dc:Bounds x="740" y="1045" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1xzgv5k_di" bpmnElement="SequenceFlow_1xzgv5k">
- <di:waypoint x="677" y="960" />
- <di:waypoint x="709" y="960" />
- <di:waypoint x="709" y="960" />
- <di:waypoint x="744" y="960" />
+ <di:waypoint x="840" y="1085" />
+ <di:waypoint x="872" y="1085" />
+ <di:waypoint x="872" y="1085" />
+ <di:waypoint x="907" y="1085" />
<bpmndi:BPMNLabel>
<dc:Bounds x="679" y="960" width="90" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="IntermediateThrowEvent_11saqvj_di" bpmnElement="IntermediateThrowEvent_0bq4fxs">
- <dc:Bounds x="1306" y="-22" width="36" height="36" />
+ <dc:Bounds x="1469" y="103" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1281" y="18" width="88" height="36" />
+ <dc:Bounds x="1444" y="143" width="88" height="40" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1o01d7d_di" bpmnElement="ScriptTask_1o01d7d">
- <dc:Bounds x="704" y="106" width="100" height="80" />
+ <dc:Bounds x="867" y="231" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_0biblpc_di" bpmnElement="CallActivity_0biblpc">
- <dc:Bounds x="469" y="106" width="100" height="80" />
+ <dc:Bounds x="632" y="231" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1cllqk3_di" bpmnElement="ScriptTask_1cllqk3">
- <dc:Bounds x="187" y="106" width="100" height="80" />
+ <dc:Bounds x="350" y="231" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateCatchEvent_0tv85pg_di" bpmnElement="IntermediateCatchEvent_0tv85pg">
- <dc:Bounds x="17" y="128" width="36" height="36" />
+ <dc:Bounds x="180" y="253" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="-7" y="164" width="88" height="24" />
+ <dc:Bounds x="156" y="289" width="88" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0xjwb45_di" bpmnElement="SequenceFlow_0xjwb45">
- <di:waypoint x="569" y="146" />
- <di:waypoint x="704" y="146" />
+ <di:waypoint x="732" y="271" />
+ <di:waypoint x="867" y="271" />
<bpmndi:BPMNLabel>
<dc:Bounds x="592" y="125" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0qxzgvq_di" bpmnElement="SequenceFlow_0qxzgvq">
- <di:waypoint x="287" y="146" />
- <di:waypoint x="469" y="146" />
+ <di:waypoint x="450" y="271" />
+ <di:waypoint x="632" y="271" />
<bpmndi:BPMNLabel>
<dc:Bounds x="333" y="125" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1qiiycn_di" bpmnElement="SequenceFlow_1qiiycn">
- <di:waypoint x="45" y="-4" />
- <di:waypoint x="117" y="-4" />
+ <di:waypoint x="208" y="121" />
+ <di:waypoint x="280" y="121" />
<bpmndi:BPMNLabel>
<dc:Bounds x="36" y="-25" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_166w91p_di" bpmnElement="SequenceFlow_166w91p">
- <di:waypoint x="53" y="146" />
- <di:waypoint x="187" y="146" />
+ <di:waypoint x="216" y="271" />
+ <di:waypoint x="350" y="271" />
<bpmndi:BPMNLabel>
<dc:Bounds x="75" y="125" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="IntermediateThrowEvent_16okck2_di" bpmnElement="IntermediateThrowEvent_16okck2">
- <dc:Bounds x="1306" y="128" width="36" height="36" />
+ <dc:Bounds x="1469" y="253" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1285" y="169" width="82" height="36" />
+ <dc:Bounds x="1448" y="294" width="83" height="40" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1tkgqu3_di" bpmnElement="SequenceFlow_1tkgqu3">
- <di:waypoint x="1112" y="146" />
- <di:waypoint x="1222" y="146" />
- <di:waypoint x="1222" y="146" />
- <di:waypoint x="1306" y="146" />
+ <di:waypoint x="1203" y="271" />
+ <di:waypoint x="1286" y="271" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1192" y="140" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0w9t6tc_di" bpmnElement="SequenceFlow_0w9t6tc">
- <di:waypoint x="217" y="-4" />
- <di:waypoint x="762" y="-4" />
- <di:waypoint x="762" y="-4" />
- <di:waypoint x="1306" y="-4" />
+ <di:waypoint x="380" y="121" />
+ <di:waypoint x="925" y="121" />
+ <di:waypoint x="925" y="121" />
+ <di:waypoint x="1469" y="121" />
<bpmndi:BPMNLabel>
<dc:Bounds x="732" y="-10" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="IntermediateCatchEvent_05dus9b_di" bpmnElement="IntermediateCatchEvent_05dus9b">
- <dc:Bounds x="18" y="282" width="36" height="36" />
+ <dc:Bounds x="181" y="407" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="-3" y="318" width="82" height="24" />
+ <dc:Bounds x="160" y="443" width="83" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_012h7yx_di" bpmnElement="SequenceFlow_012h7yx">
- <di:waypoint x="804" y="146" />
- <di:waypoint x="917" y="146" />
- <di:waypoint x="917" y="146" />
- <di:waypoint x="1012" y="146" />
+ <di:waypoint x="967" y="271" />
+ <di:waypoint x="1103" y="271" />
<bpmndi:BPMNLabel>
<dc:Bounds x="887" y="139" width="90" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1rzf8a1_di" bpmnElement="ScriptTask_1rzf8a1">
- <dc:Bounds x="262" y="260" width="100" height="80" />
+ <dc:Bounds x="425" y="385" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1asgesv_di" bpmnElement="ServiceTask_1asgesv">
- <dc:Bounds x="433" y="260" width="100" height="80" />
+ <dc:Bounds x="576" y="385" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_1gae03e_di" bpmnElement="CallActivity_1gae03e">
- <dc:Bounds x="957" y="260" width="100" height="80" />
+ <dc:Bounds x="1146" y="385" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0ns08tn_di" bpmnElement="ScriptTask_0ns08tn">
- <dc:Bounds x="785" y="260" width="100" height="80" />
+ <dc:Bounds x="894" y="385" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_19t13rd_di" bpmnElement="ScriptTask_19t13rd">
- <dc:Bounds x="1131" y="260" width="100" height="80" />
+ <dc:Bounds x="1294" y="385" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1x4kvfh_di" bpmnElement="EndEvent_1x4kvfh">
- <dc:Bounds x="1301" y="282" width="36" height="36" />
+ <dc:Bounds x="1464" y="407" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1274" y="322" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0jxdler_di" bpmnElement="ScriptTask_0jxdler">
- <dc:Bounds x="88" y="260" width="100" height="80" />
+ <dc:Bounds x="251" y="385" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_0ts3c3b_di" bpmnElement="ScriptTask_0ts3c3b">
- <dc:Bounds x="599" y="260" width="100" height="80" />
+ <dc:Bounds x="733" y="385" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1y9rkfr_di" bpmnElement="SequenceFlow_1y9rkfr">
- <di:waypoint x="188" y="300" />
- <di:waypoint x="262" y="300" />
+ <di:waypoint x="351" y="425" />
+ <di:waypoint x="425" y="425" />
<bpmndi:BPMNLabel>
<dc:Bounds x="180" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0n7nbx3_di" bpmnElement="SequenceFlow_0n7nbx3">
- <di:waypoint x="362" y="300" />
- <di:waypoint x="433" y="300" />
+ <di:waypoint x="525" y="425" />
+ <di:waypoint x="576" y="425" />
<bpmndi:BPMNLabel>
<dc:Bounds x="353.5" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0ckto7v_di" bpmnElement="SequenceFlow_0ckto7v">
- <di:waypoint x="533" y="300" />
- <di:waypoint x="599" y="300" />
+ <di:waypoint x="676" y="425" />
+ <di:waypoint x="733" y="425" />
<bpmndi:BPMNLabel>
<dc:Bounds x="521" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0b1dsaj_di" bpmnElement="SequenceFlow_0b1dsaj">
- <di:waypoint x="885" y="300" />
- <di:waypoint x="957" y="300" />
+ <di:waypoint x="994" y="425" />
+ <di:waypoint x="1044" y="425" />
<bpmndi:BPMNLabel>
<dc:Bounds x="876" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0sphcy5_di" bpmnElement="SequenceFlow_0sphcy5">
- <di:waypoint x="1057" y="300" />
- <di:waypoint x="1131" y="300" />
+ <di:waypoint x="1246" y="425" />
+ <di:waypoint x="1294" y="425" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1049" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_022onug_di" bpmnElement="SequenceFlow_022onug">
- <di:waypoint x="699" y="300" />
- <di:waypoint x="785" y="300" />
+ <di:waypoint x="833" y="425" />
+ <di:waypoint x="894" y="425" />
<bpmndi:BPMNLabel>
<dc:Bounds x="697" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_18gnns6_di" bpmnElement="SequenceFlow_18gnns6">
- <di:waypoint x="1231" y="300" />
- <di:waypoint x="1301" y="300" />
+ <di:waypoint x="1394" y="425" />
+ <di:waypoint x="1464" y="425" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1221" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0yuzaen_di" bpmnElement="SequenceFlow_0yuzaen">
- <di:waypoint x="54" y="300" />
- <di:waypoint x="88" y="300" />
+ <di:waypoint x="217" y="425" />
+ <di:waypoint x="251" y="425" />
<bpmndi:BPMNLabel>
<dc:Bounds x="71" y="279" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_19zefa9_di" bpmnElement="SequenceFlow_19zefa9">
+ <di:waypoint x="1386" y="271" />
+ <di:waypoint x="1469" y="271" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_1495sm9_di" bpmnElement="Task_0osptcq">
+ <dc:Bounds x="1286" y="231" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ExclusiveGateway_1hmlw0b_di" bpmnElement="ExclusiveGateway_1hmlw0b" isMarkerVisible="true">
+ <dc:Bounds x="1044" y="400" width="50" height="50" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_11zobkq_di" bpmnElement="SequenceFlow_11zobkq">
+ <di:waypoint x="1094" y="425" />
+ <di:waypoint x="1146" y="425" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="1112" y="407" width="18" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1mvvc6c_di" bpmnElement="SequenceFlow_1mvvc6c">
+ <di:waypoint x="1069" y="450" />
+ <di:waypoint x="1069" y="607" />
+ <di:waypoint x="1344" y="607" />
+ <di:waypoint x="1344" y="465" />
+ </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn
index 75767929aa..2a2093522f 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateResources.bpmn
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.16.2" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="3.1.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="DoCreateResourcesV3" name="DoCreateResourcesV3" isExecutable="true">
<bpmn2:startEvent id="createSI_startEvent" name="Start Flow">
<bpmn2:outgoing>SequenceFlow_1qiiycn</bpmn2:outgoing>
@@ -9,8 +9,7 @@
<bpmn2:outgoing>SequenceFlow_0w9t6tc</bpmn2:outgoing>
<bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def dcsi = new DoCreateResources()
-dcsi.preProcessRequest(execution)
-</bpmn2:script>
+dcsi.preProcessRequest(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:scriptTask id="ScriptTask_1xdjlzm" name="Post Config Service Instance Creation" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_16nxl6h</bpmn2:incoming>
@@ -48,7 +47,7 @@ ddsi.parseNextResource(execution)</bpmn2:script>
<bpmn2:sequenceFlow id="SequenceFlow_1jenxlp" sourceRef="ScriptTask_0y4u2ty" targetRef="ExclusiveGateway_0n9y4du" />
<bpmn2:scriptTask id="ScriptTask_0l4nkqr" name="Get Current Resource" scriptFormat="groovy">
<bpmn2:incoming>SequenceFlow_0q6uy30</bpmn2:incoming>
- <bpmn2:incoming>SequenceFlow_1obf0cq</bpmn2:incoming>
+ <bpmn2:incoming>SequenceFlow_1qozd66</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0uiygod</bpmn2:outgoing>
<bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
def ddsi = new DoCreateResources()
@@ -103,7 +102,7 @@ ddsi.executeResourceRecipe(execution)</bpmn2:script>
<bpmn2:sequenceFlow id="SequenceFlow_0uiygod" sourceRef="ScriptTask_0l4nkqr" targetRef="Task_0qlkmvt" />
<bpmn2:sequenceFlow id="SequenceFlow_1u9k0dm" sourceRef="Task_0qlkmvt" targetRef="Task_12ghoph" />
<bpmn2:sequenceFlow id="SequenceFlow_13c7bhn" sourceRef="Task_12ghoph" targetRef="ScriptTask_0y4u2ty" />
- <bpmn2:sequenceFlow id="SequenceFlow_1qozd66" sourceRef="IntermediateCatchEvent_02bah5m" targetRef="Task_0g7zo7b" />
+ <bpmn2:sequenceFlow id="SequenceFlow_1qozd66" sourceRef="IntermediateCatchEvent_02bah5m" targetRef="ScriptTask_0l4nkqr" />
<bpmn2:endEvent id="EndEvent_1ddg1di">
<bpmn2:incoming>SequenceFlow_0epxs3b</bpmn2:incoming>
</bpmn2:endEvent>
@@ -134,252 +133,237 @@ def ddsi = new DoCreateResources()
ddsi.prepareServiceTopologyRequest(execution)</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_0k0f7lm" sourceRef="Task_1blaq0f" targetRef="Task_0io5qby" />
- <bpmn2:sequenceFlow id="SequenceFlow_1obf0cq" sourceRef="Task_0g7zo7b" targetRef="ScriptTask_0l4nkqr" />
- <bpmn2:scriptTask id="Task_0g7zo7b" name="Prepare Instnace ResourceList" scriptFormat="groovy">
- <bpmn2:incoming>SequenceFlow_1qozd66</bpmn2:incoming>
- <bpmn2:outgoing>SequenceFlow_1obf0cq</bpmn2:outgoing>
- <bpmn2:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def ddsi = new DoCreateResources()
-ddsi.prepareInstanceResourceList(execution)</bpmn2:script>
- </bpmn2:scriptTask>
</bpmn2:process>
<bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" />
<bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateResourcesV3">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_47" bpmnElement="createSI_startEvent">
- <dc:Bounds x="18" y="-207" width="36" height="36" />
+ <dc:Bounds x="215" y="103" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="12" y="-166" width="50" height="12" />
+ <dc:Bounds x="209" y="144" width="50" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_ScriptTask_61" bpmnElement="preProcessRequest_ScriptTask">
- <dc:Bounds x="126" y="-229" width="100" height="80" />
+ <dc:Bounds x="323" y="81" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1xdjlzm_di" bpmnElement="ScriptTask_1xdjlzm">
- <dc:Bounds x="1119" y="485" width="100" height="80" />
+ <dc:Bounds x="1316" y="795" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_0qi8cgg_di" bpmnElement="Task_0io5qby">
- <dc:Bounds x="1047" y="353" width="100" height="80" />
+ <dc:Bounds x="1244" y="663" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_11f2zuu_di" bpmnElement="SequenceFlow_11f2zuu">
- <di:waypoint x="1147" y="393" />
- <di:waypoint x="1219" y="393" />
- <di:waypoint x="1219" y="300" />
- <di:waypoint x="1315" y="300" />
+ <di:waypoint x="1344" y="703" />
+ <di:waypoint x="1416" y="703" />
+ <di:waypoint x="1416" y="610" />
+ <di:waypoint x="1512" y="610" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1189" y="340.5" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_1y0los4_di" bpmnElement="ScriptTask_1y0los4">
- <dc:Bounds x="444" y="260" width="100" height="80" />
+ <dc:Bounds x="641" y="570" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_13d9g1n_di" bpmnElement="SequenceFlow_13d9g1n">
- <di:waypoint x="544" y="300" />
- <di:waypoint x="753" y="300" />
+ <di:waypoint x="741" y="610" />
+ <di:waypoint x="950" y="610" />
<bpmndi:BPMNLabel>
<dc:Bounds x="603.5" y="279" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_0n9y4du_di" bpmnElement="ExclusiveGateway_0n9y4du" isMarkerVisible="true">
- <dc:Bounds x="929" y="500" width="50" height="50" />
+ <dc:Bounds x="1126" y="810" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="911" y="454" width="85" height="36" />
+ <dc:Bounds x="1109" y="764" width="83" height="40" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0q6uy30_di" bpmnElement="SequenceFlow_0q6uy30">
- <di:waypoint x="954" y="550" />
- <di:waypoint x="954" y="691" />
- <di:waypoint x="246" y="691" />
- <di:waypoint x="246" y="565" />
+ <di:waypoint x="1151" y="860" />
+ <di:waypoint x="1151" y="1001" />
+ <di:waypoint x="443" y="1001" />
+ <di:waypoint x="443" y="875" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="593" y="670" width="15" height="12" />
+ <dc:Bounds x="791" y="980" width="13" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0y4u2ty_di" bpmnElement="ScriptTask_0y4u2ty">
- <dc:Bounds x="728" y="485" width="100" height="80" />
+ <dc:Bounds x="925" y="795" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1jenxlp_di" bpmnElement="SequenceFlow_1jenxlp">
- <di:waypoint x="828" y="525" />
- <di:waypoint x="929" y="525" />
+ <di:waypoint x="1025" y="835" />
+ <di:waypoint x="1126" y="835" />
<bpmndi:BPMNLabel>
<dc:Bounds x="833.5" y="504" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0l4nkqr_di" bpmnElement="ScriptTask_0l4nkqr">
- <dc:Bounds x="196" y="485" width="100" height="80" />
+ <dc:Bounds x="393" y="795" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_07rr3wp_di" bpmnElement="ExclusiveGateway_07rr3wp" isMarkerVisible="true">
- <dc:Bounds x="753" y="275" width="50" height="50" />
+ <dc:Bounds x="950" y="585" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="734" y="243" width="88" height="24" />
+ <dc:Bounds x="931" y="553" width="88" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_18wj44x_di" bpmnElement="SequenceFlow_18wj44x">
- <di:waypoint x="803" y="300" />
- <di:waypoint x="1315" y="300" />
+ <di:waypoint x="1000" y="610" />
+ <di:waypoint x="1512" y="610" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="831" y="294" width="15" height="12" />
+ <dc:Bounds x="1029" y="604" width="13" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0u88n0f_di" bpmnElement="Task_0qlkmvt">
- <dc:Bounds x="357" y="485" width="100" height="80" />
+ <dc:Bounds x="554" y="795" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1y17r20_di" bpmnElement="Task_12ghoph">
- <dc:Bounds x="551" y="485" width="100" height="80" />
+ <dc:Bounds x="748" y="795" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="IntermediateThrowEvent_11saqvj_di" bpmnElement="IntermediateThrowEvent_0bq4fxs">
- <dc:Bounds x="1315" y="-207" width="36" height="36" />
+ <dc:Bounds x="1512" y="103" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1292" y="-167" width="88" height="36" />
+ <dc:Bounds x="1490" y="143" width="86" height="40" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1qiiycn_di" bpmnElement="SequenceFlow_1qiiycn">
- <di:waypoint x="54" y="-189" />
- <di:waypoint x="126" y="-189" />
+ <di:waypoint x="251" y="121" />
+ <di:waypoint x="323" y="121" />
<bpmndi:BPMNLabel>
<dc:Bounds x="90" y="-210" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0w9t6tc_di" bpmnElement="SequenceFlow_0w9t6tc">
- <di:waypoint x="226" y="-189" />
- <di:waypoint x="771" y="-189" />
- <di:waypoint x="771" y="-189" />
- <di:waypoint x="1315" y="-189" />
+ <di:waypoint x="423" y="121" />
+ <di:waypoint x="968" y="121" />
+ <di:waypoint x="968" y="121" />
+ <di:waypoint x="1512" y="121" />
<bpmndi:BPMNLabel>
<dc:Bounds x="786" y="-195" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="IntermediateThrowEvent_0f2w7aj_di" bpmnElement="IntermediateThrowEvent_0f2w7aj">
- <dc:Bounds x="1315" y="282" width="36" height="36" />
+ <dc:Bounds x="1512" y="592" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1299" y="323" width="73" height="24" />
+ <dc:Bounds x="1497" y="633" width="72" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1vprtt9_di" bpmnElement="SequenceFlow_1vprtt9">
- <di:waypoint x="778" y="325" />
- <di:waypoint x="778" y="393" />
- <di:waypoint x="861" y="394" />
+ <di:waypoint x="975" y="635" />
+ <di:waypoint x="975" y="703" />
+ <di:waypoint x="1058" y="704" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="784" y="353" width="20" height="12" />
+ <dc:Bounds x="982" y="663" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="IntermediateCatchEvent_05dus9b_di" bpmnElement="IntermediateCatchEvent_05dus9b">
- <dc:Bounds x="18" y="282" width="36" height="36" />
+ <dc:Bounds x="215" y="592" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="-3" y="318" width="82" height="24" />
+ <dc:Bounds x="194" y="628" width="83" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1hbesp9_di" bpmnElement="SequenceFlow_1hbesp9">
- <di:waypoint x="54" y="300" />
- <di:waypoint x="444" y="300" />
+ <di:waypoint x="251" y="610" />
+ <di:waypoint x="641" y="610" />
<bpmndi:BPMNLabel>
<dc:Bounds x="204" y="279" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="IntermediateCatchEvent_02bah5m_di" bpmnElement="IntermediateCatchEvent_02bah5m">
- <dc:Bounds x="-26" y="507" width="36" height="36" />
+ <dc:Bounds x="171" y="817" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="-41" y="543" width="72" height="14" />
+ <dc:Bounds x="156" y="853" width="72" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_16nxl6h_di" bpmnElement="SequenceFlow_16nxl6h">
- <di:waypoint x="979" y="525" />
- <di:waypoint x="1119" y="525" />
+ <di:waypoint x="1176" y="835" />
+ <di:waypoint x="1316" y="835" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1040" y="504" width="19" height="12" />
+ <dc:Bounds x="1238" y="814" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0uiygod_di" bpmnElement="SequenceFlow_0uiygod">
- <di:waypoint x="296" y="525" />
- <di:waypoint x="357" y="525" />
+ <di:waypoint x="493" y="835" />
+ <di:waypoint x="554" y="835" />
<bpmndi:BPMNLabel>
<dc:Bounds x="326.5" y="504" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1u9k0dm_di" bpmnElement="SequenceFlow_1u9k0dm">
- <di:waypoint x="457" y="525" />
- <di:waypoint x="551" y="525" />
+ <di:waypoint x="654" y="835" />
+ <di:waypoint x="748" y="835" />
<bpmndi:BPMNLabel>
<dc:Bounds x="504" y="504" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_13c7bhn_di" bpmnElement="SequenceFlow_13c7bhn">
- <di:waypoint x="651" y="525" />
- <di:waypoint x="728" y="525" />
+ <di:waypoint x="848" y="835" />
+ <di:waypoint x="925" y="835" />
<bpmndi:BPMNLabel>
<dc:Bounds x="689.5" y="504" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1qozd66_di" bpmnElement="SequenceFlow_1qozd66">
- <di:waypoint x="10" y="525" />
- <di:waypoint x="52" y="525" />
+ <di:waypoint x="207" y="835" />
+ <di:waypoint x="393" y="835" />
<bpmndi:BPMNLabel>
<dc:Bounds x="125" y="504" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_1ddg1di_di" bpmnElement="EndEvent_1ddg1di">
- <dc:Bounds x="1314.8151147098515" y="506.9419703103914" width="36" height="36" />
+ <dc:Bounds x="1512" y="817" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1332.8151147098515" y="546.9419703103914" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0epxs3b_di" bpmnElement="SequenceFlow_0epxs3b">
- <di:waypoint x="1219" y="525" />
- <di:waypoint x="1315" y="525" />
+ <di:waypoint x="1416" y="835" />
+ <di:waypoint x="1512" y="835" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1267" y="504" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="SubProcess_0sfdqc1_di" bpmnElement="SubProcess_0sfdqc1" isExpanded="true">
- <dc:Bounds x="338" y="817" width="467" height="193" />
+ <dc:Bounds x="535" y="1127" width="467" height="193" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_0x7o2ug_di" bpmnElement="StartEvent_0x7o2ug">
- <dc:Bounds x="407" y="885" width="36" height="36" />
+ <dc:Bounds x="604" y="1195" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="335" y="926" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_0lgdyyb_di" bpmnElement="EndEvent_0lgdyyb">
- <dc:Bounds x="700" y="885" width="36" height="36" />
+ <dc:Bounds x="897" y="1195" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="628" y="926" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ScriptTask_1648adp_di" bpmnElement="ScriptTask_1648adp">
- <dc:Bounds x="511" y="863" width="100" height="80" />
+ <dc:Bounds x="708" y="1173" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0gr9xqj_di" bpmnElement="SequenceFlow_0gr9xqj">
- <di:waypoint x="443" y="903" />
- <di:waypoint x="511" y="903" />
+ <di:waypoint x="640" y="1213" />
+ <di:waypoint x="708" y="1213" />
<bpmndi:BPMNLabel>
<dc:Bounds x="387" y="888" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0a6l29p_di" bpmnElement="SequenceFlow_0a6l29p">
- <di:waypoint x="611" y="903" />
- <di:waypoint x="700" y="903" />
+ <di:waypoint x="808" y="1213" />
+ <di:waypoint x="897" y="1213" />
<bpmndi:BPMNLabel>
<dc:Bounds x="567.5" y="888" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0dh2mj1_di" bpmnElement="Task_1blaq0f">
- <dc:Bounds x="861" y="354" width="100" height="80" />
+ <dc:Bounds x="1058" y="664" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0k0f7lm_di" bpmnElement="SequenceFlow_0k0f7lm">
- <di:waypoint x="961" y="394" />
- <di:waypoint x="1047" y="393" />
+ <di:waypoint x="1158" y="704" />
+ <di:waypoint x="1244" y="703" />
<bpmndi:BPMNLabel>
<dc:Bounds x="1004" y="372.5" width="0" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1obf0cq_di" bpmnElement="SequenceFlow_1obf0cq">
- <di:waypoint x="152" y="525" />
- <di:waypoint x="196" y="525" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_0iag9tv_di" bpmnElement="Task_0g7zo7b">
- <dc:Bounds x="52" y="485" width="100" height="80" />
- </bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn
index 4d0324e478..1149cc9ea9 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn
@@ -9,8 +9,7 @@
<bpmn:outgoing>SequenceFlow_11e6bfy</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
def ddsi = new DoDeleteE2EServiceInstance()
-ddsi.preProcessRequest(execution)
-</bpmn:script>
+ddsi.preProcessRequest(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:endEvent id="EndEvent_1uqzt26">
<bpmn:incoming>SequenceFlow_0e7inkl</bpmn:incoming>
@@ -27,7 +26,7 @@ ddsi.postProcessAAIGET(execution)</bpmn:script>
<bpmn:incoming>SequenceFlow_12rr1yy</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0e7inkl</bpmn:outgoing>
<bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
-def ddsi = new DoCustomDeleteE2EServiceInstance()
+def ddsi = new DoDeleteE2EServiceInstance()
ddsi.deleteServiceInstance(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:subProcess id="SubProcess_1u8zt9i" name="Sub-process for UnexpectedErrors" triggeredByEvent="true">
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
index e5df3d3f35..f1fd23fe82 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
@@ -65,6 +65,7 @@ import org.onap.so.client.sniro.beans.ServiceInfo;
import org.onap.so.client.sniro.beans.SniroManagerRequest;
import org.onap.so.client.sniro.beans.SubscriberInfo;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
+import org.onap.so.utils.TargetEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -160,14 +161,15 @@ public class SniroHomingV2 {
logger.trace("Completed Sniro Homing Call Sniro");
} catch (BpmnError e) {
logger.error(EXCEPTION_OCCURRED, e);
- exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage());
+ exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage(),
+ TargetEntity.SNIRO);
} catch (BadResponseException e) {
logger.error(EXCEPTION_OCCURRED, e);
- exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage());
+ exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage(), TargetEntity.SNIRO);
} catch (Exception e) {
logger.error(EXCEPTION_OCCURRED, e);
exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL,
- "Internal Error - occurred while preparing sniro request: " + e.getMessage());
+ "Internal Error - occurred while preparing sniro request: " + e.getMessage(), TargetEntity.SO);
}
}
@@ -211,14 +213,16 @@ public class SniroHomingV2 {
logger.trace("Completed Sniro Homing Process Solution");
} catch (BpmnError e) {
logger.error(EXCEPTION_OCCURRED, e);
- exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage());
+ exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage(),
+ TargetEntity.SNIRO);
} catch (BadResponseException e) {
logger.error(EXCEPTION_OCCURRED, e);
- exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage());
+ exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage(), TargetEntity.SNIRO);
} catch (Exception e) {
logger.error(EXCEPTION_OCCURRED, e);
exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL,
- "Internal Error - occurred while processing sniro asynchronous response: " + e.getMessage());
+ "Internal Error - occurred while processing sniro asynchronous response: " + e.getMessage(),
+ TargetEntity.SO);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
index e3540ecc58..583e3e172a 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java
@@ -77,7 +77,6 @@ public class AAICreateTasks {
private static final Logger logger = LoggerFactory.getLogger(AAICreateTasks.class);
private static final String networkTypeProvider = "PROVIDER";
- private static final String A_LA_CARTE = "aLaCarte";
private static String NETWORK_COLLECTION_NAME = "networkCollectionName";
private static String CONTRAIL_NETWORK_POLICY_FQDN_LIST = "contrailNetworkPolicyFqdnList";
private static String HEAT_STACK_ID = "heatStackId";
@@ -107,12 +106,8 @@ public class AAICreateTasks {
public void createServiceInstance(BuildingBlockExecution execution) {
try {
- Boolean alaCarte = execution.getVariable(A_LA_CARTE);
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
- if (Boolean.TRUE.equals(alaCarte) && aaiSIResources.checkInstanceServiceNameInUse(serviceInstance)) {
- throw new DuplicateNameException("service-instance", serviceInstance.getServiceInstanceName());
- }
Customer customer = execution.getGeneralBuildingBlock().getCustomer();
aaiSIResources.createServiceInstance(serviceInstance, customer);
} catch (Exception ex) {
@@ -199,11 +194,7 @@ public class AAICreateTasks {
public void createVnf(BuildingBlockExecution execution) {
try {
- Boolean alaCarte = execution.getVariable(A_LA_CARTE);
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
- if (Boolean.TRUE.equals(alaCarte) && aaiVnfResources.checkNameInUse(vnf.getVnfName())) {
- throw new DuplicateNameException("generic-vnf", vnf.getVnfName());
- }
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
execution.setVariable("homing", Boolean.TRUE.equals(vnf.isCallHoming()));
@@ -262,10 +253,6 @@ public class AAICreateTasks {
GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
CloudRegion cloudRegion = gBBInput.getCloudRegion();
- Boolean alaCarte = execution.getVariable(A_LA_CARTE);
- if (Boolean.TRUE.equals(alaCarte) && aaiVolumeGroupResources.checkNameInUse(volumeGroup)) {
- throw new DuplicateNameException("volume-group", volumeGroup.getVolumeGroupName());
- }
aaiVolumeGroupResources.createVolumeGroup(volumeGroup, cloudRegion);
aaiVolumeGroupResources.connectVolumeGroupToVnf(genericVnf, volumeGroup, cloudRegion);
aaiVolumeGroupResources.connectVolumeGroupToTenant(volumeGroup, cloudRegion);
@@ -278,10 +265,6 @@ public class AAICreateTasks {
try {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
- Boolean alaCarte = execution.getVariable(A_LA_CARTE);
- if (Boolean.TRUE.equals(alaCarte) && aaiVfModuleResources.checkNameInUse(vfModule)) {
- throw new DuplicateNameException("vf-module", vfModule.getVfModuleName());
- }
int moduleIndex = 0;
if (vfModule.getModelInfoVfModule() != null
&& !Boolean.TRUE.equals(vfModule.getModelInfoVfModule().getIsBaseBoolean())) {
@@ -327,14 +310,9 @@ public class AAICreateTasks {
*/
public void createNetwork(BuildingBlockExecution execution) {
try {
- Boolean alaCarte = execution.getVariable(A_LA_CARTE);
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
- if (Boolean.TRUE.equals(alaCarte)
- && aaiNetworkResources.checkNetworkNameInUse(l3network.getNetworkName())) {
- throw new DuplicateNameException("l3Network", l3network.getNetworkName());
- }
// set default to false. ToBe updated by SDNC
l3network.setIsBoundToVpn(false);
// define is bound to vpn flag as true if NEUTRON_NETWORK_TYPE is PROVIDER
@@ -385,16 +363,11 @@ public class AAICreateTasks {
*/
public void createNetworkCollectionInstanceGroup(BuildingBlockExecution execution) {
try {
- Boolean alaCarte = execution.getVariable(A_LA_CARTE);
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
InstanceGroup instanceGroup = serviceInstance.getCollection().getInstanceGroup();
// set name generated for NetworkCollection/NetworkCollectionInstanceGroup in previous step of the BB flow
instanceGroup.setInstanceGroupName(execution.getVariable(NETWORK_COLLECTION_NAME));
- if (Boolean.TRUE.equals(alaCarte)
- && aaiInstanceGroupResources.checkInstanceGroupNameInUse(instanceGroup.getInstanceGroupName())) {
- throw new DuplicateNameException("instance-group", instanceGroup.getInstanceGroupName());
- }
// put shell in AAI
aaiNetworkResources.createNetworkInstanceGroup(instanceGroup);
} catch (Exception ex) {
@@ -511,12 +484,7 @@ public class AAICreateTasks {
public void createConfiguration(BuildingBlockExecution execution) {
try {
- Boolean alaCarte = execution.getVariable(A_LA_CARTE);
Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID);
- if (Boolean.TRUE.equals(alaCarte)
- && aaiConfigurationResources.checkConfigurationNameInUse(configuration.getConfigurationName())) {
- throw new DuplicateNameException("configuration", configuration.getConfigurationName());
- }
aaiConfigurationResources.createConfiguration(configuration);
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
@@ -525,14 +493,9 @@ public class AAICreateTasks {
public void createInstanceGroupVnf(BuildingBlockExecution execution) {
try {
- Boolean alaCarte = execution.getVariable(A_LA_CARTE);
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
InstanceGroup instanceGroup = extractPojosForBB.extractByKey(execution, ResourceKey.INSTANCE_GROUP_ID);
- if (Boolean.TRUE.equals(alaCarte)
- && aaiInstanceGroupResources.checkInstanceGroupNameInUse(instanceGroup.getInstanceGroupName())) {
- throw new DuplicateNameException("instance-group", instanceGroup.getInstanceGroupName());
- }
aaiInstanceGroupResources.createInstanceGroupandConnectServiceInstance(instanceGroup, serviceInstance);
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java
index 12aade71bc..1add5e6d24 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java
@@ -35,7 +35,6 @@ import org.springframework.stereotype.Component;
@Component
public class AAIFlagTasks {
- private static final Logger logger = LoggerFactory.getLogger(AAIFlagTasks.class);
@Autowired
private AAIVnfResources aaiVnfResources;
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java
index 859db11037..e9d33f46ab 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java
@@ -38,6 +38,7 @@ import org.onap.so.adapters.nwrest.UpdateNetworkRequest;
import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.NetworkAdapterResources;
+import org.onap.so.utils.TargetEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -93,7 +94,7 @@ public class NetworkAdapterRestV1 {
throw new Exception("No Network Request was created. networkAdapterRequest was null.");
}
} catch (Exception ex) {
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
}
}
@@ -138,7 +139,7 @@ public class NetworkAdapterRestV1 {
}
} catch (Exception e) {
logger.error("Error in Openstack Adapter callback", e);
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage());
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), TargetEntity.OPENSTACK);
}
}
@@ -151,7 +152,7 @@ public class NetworkAdapterRestV1 {
public void handleTimeOutException(DelegateExecution execution) {
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,
- "Error timed out waiting on Openstack Async-Response");
+ "Error timed out waiting on Openstack Async-Response", TargetEntity.SO);
}
public void handleSyncError(DelegateExecution execution) {
@@ -159,6 +160,6 @@ public class NetworkAdapterRestV1 {
String responseString = (String) execution.getVariable(NETWORK_SYNC_RESPONSE);
String errorMessage = "Error with Openstack Adapter Sync Request: StatusCode = " + statusCode + " Response = "
+ responseString;
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, errorMessage);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, errorMessage, TargetEntity.OPENSTACK);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java
index 62878fd4f7..922b721098 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/audit/AuditTasks.java
@@ -21,15 +21,21 @@
package org.onap.so.bpmn.infrastructure.audit;
+import java.util.List;
import org.onap.so.audit.beans.AuditInventory;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
+import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.client.exception.ExceptionBuilder;
+import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.so.db.request.beans.RequestProcessingData;
+import org.onap.so.db.request.client.RequestsDbClient;
+import org.onap.so.objects.audit.AAIObjectAuditList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -83,12 +89,17 @@ public class AuditTasks {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
+ GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
CloudRegion cloudRegion = gBBInput.getCloudRegion();
+ auditInventory.setMsoRequestId(gBBInput.getRequestContext().getMsoRequestId());
auditInventory.setCloudOwner(cloudRegion.getCloudOwner());
auditInventory.setCloudRegion(cloudRegion.getLcpCloudRegionId());
auditInventory.setTenantId(cloudRegion.getTenantId());
+ auditInventory.setVfModuleId(vfModule.getVfModuleId());
auditInventory.setHeatStackName(vfModule.getVfModuleName());
+ auditInventory.setGenericVnfId(genericVnf.getVnfId());
return auditInventory;
}
+
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/namingservice/tasks/NamingServiceCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/namingservice/tasks/NamingServiceCreateTasks.java
index 155455e654..ea0b408e41 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/namingservice/tasks/NamingServiceCreateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/namingservice/tasks/NamingServiceCreateTasks.java
@@ -108,7 +108,7 @@ public class NamingServiceCreateTasks {
namingRequestObject.setNamingTypeValue(NamingServiceConstants.NAMING_TYPE_SERVICE);
namingRequestObject.setServiceModelNameValue(serviceInstance.getModelInfoServiceInstance().getModelName());
namingRequestObject.setModelVersionValue(serviceInstance.getModelInfoServiceInstance().getModelVersion());
- namingRequestObject.setNetworkNameValue(execution.getVariable(network.getNetworkName()));
+ namingRequestObject.setNetworkNameValue(network.getNetworkName());
namingRequestObject.setVpnNameValue(vpnBinding.getVpnName());
namingRequestObject.setResourceNameValue(NamingServiceConstants.RESOURCE_NAME_SERVICE_INSTANCE_NAME);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/AbstractSDNCTask.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/AbstractSDNCTask.java
new file mode 100644
index 0000000000..c134f31b42
--- /dev/null
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/AbstractSDNCTask.java
@@ -0,0 +1,22 @@
+package org.onap.so.bpmn.infrastructure.sdnc.tasks;
+
+import java.net.URI;
+import javax.ws.rs.core.UriBuilder;
+import org.onap.so.client.sdnc.beans.SDNCRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AbstractSDNCTask {
+
+ @Autowired
+ Environment env;
+
+
+ public URI buildCallbackURI(SDNCRequest sdncRequest) {
+ UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
+ .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
+ return builder.build();
+ }
+}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
index e4dd35503e..b85e33144f 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java
@@ -22,8 +22,6 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
@@ -52,7 +50,7 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class SDNCActivateTasks {
+public class SDNCActivateTasks extends AbstractSDNCTask {
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
@@ -77,9 +75,9 @@ public class SDNCActivateTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
CloudRegion cloudRegion = gBBInput.getCloudRegion();
Customer customer = gBBInput.getCustomer();
- GenericResourceApiVnfOperationInformation req =
- sdncVnfResources.activateVnf(vnf, serviceInstance, customer, cloudRegion, requestContext);
SDNCRequest sdncRequest = new SDNCRequest();
+ GenericResourceApiVnfOperationInformation req = sdncVnfResources.activateVnf(vnf, serviceInstance, customer,
+ cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
@@ -127,11 +125,8 @@ public class SDNCActivateTasks {
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
SDNCRequest sdncRequest = new SDNCRequest();
- UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
- .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
- URI uri = builder.build();
GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.activateVfModule(vfModule, vnf,
- serviceInstance, customer, cloudRegion, requestContext, uri);
+ serviceInstance, customer, cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
index c100cd6cee..ab2647a68d 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java
@@ -22,8 +22,6 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
@@ -55,7 +53,7 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class SDNCAssignTasks {
+public class SDNCAssignTasks extends AbstractSDNCTask {
private static final Logger logger = LoggerFactory.getLogger(SDNCAssignTasks.class);
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
@@ -100,9 +98,11 @@ public class SDNCAssignTasks {
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
- GenericResourceApiVnfOperationInformation req = sdncVnfResources.assignVnf(vnf, serviceInstance, customer,
- cloudRegion, requestContext, Boolean.TRUE.equals(vnf.isCallHoming()));
SDNCRequest sdncRequest = new SDNCRequest();
+
+ GenericResourceApiVnfOperationInformation req =
+ sdncVnfResources.assignVnf(vnf, serviceInstance, customer, cloudRegion, requestContext,
+ Boolean.TRUE.equals(vnf.isCallHoming()), buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
@@ -128,11 +128,9 @@ public class SDNCAssignTasks {
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
SDNCRequest sdncRequest = new SDNCRequest();
- UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
- .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
- URI uri = builder.build();
- GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.assignVfModule(vfModule,
- volumeGroup, vnf, serviceInstance, customer, cloudRegion, requestContext, uri);
+ GenericResourceApiVfModuleOperationInformation req =
+ sdncVfModuleResources.assignVfModule(vfModule, volumeGroup, vnf, serviceInstance, customer,
+ cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasks.java
index acf48acdda..c5ebc5e447 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasks.java
@@ -20,8 +20,6 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
@@ -49,7 +47,7 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class SDNCChangeAssignTasks {
+public class SDNCChangeAssignTasks extends AbstractSDNCTask {
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
private SDNCNetworkResources sdncNetworkResources;
@@ -88,9 +86,10 @@ public class SDNCChangeAssignTasks {
GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
- GenericResourceApiVnfOperationInformation req = sdncVnfResources.changeModelVnf(genericVnf, serviceInstance,
- gBBInput.getCustomer(), gBBInput.getCloudRegion(), gBBInput.getRequestContext());
SDNCRequest sdncRequest = new SDNCRequest();
+ GenericResourceApiVnfOperationInformation req =
+ sdncVnfResources.changeModelVnf(genericVnf, serviceInstance, gBBInput.getCustomer(),
+ gBBInput.getCloudRegion(), gBBInput.getRequestContext(), buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
@@ -127,11 +126,8 @@ public class SDNCChangeAssignTasks {
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
Customer customer = gBBInput.getCustomer();
SDNCRequest sdncRequest = new SDNCRequest();
- UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
- .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
- URI uri = builder.build();
GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.changeAssignVfModule(vfModule,
- vnf, serviceInstance, customer, cloudRegion, requestContext, uri);
+ vnf, serviceInstance, customer, cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
index 3fc25196e1..3c42f76d73 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java
@@ -22,8 +22,6 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
@@ -53,7 +51,7 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class SDNCDeactivateTasks {
+public class SDNCDeactivateTasks extends AbstractSDNCTask {
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
@@ -82,11 +80,8 @@ public class SDNCDeactivateTasks {
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
SDNCRequest sdncRequest = new SDNCRequest();
- UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
- .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
- URI uri = builder.build();
GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.deactivateVfModule(vfModule, vnf,
- serviceInstance, customer, cloudRegion, requestContext, uri);
+ serviceInstance, customer, cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
@@ -111,9 +106,9 @@ public class SDNCDeactivateTasks {
vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
CloudRegion cloudRegion = gBBInput.getCloudRegion();
Customer customer = gBBInput.getCustomer();
- GenericResourceApiVnfOperationInformation req =
- sdncVnfResources.deactivateVnf(vnf, serviceInstance, customer, cloudRegion, requestContext);
SDNCRequest sdncRequest = new SDNCRequest();
+ GenericResourceApiVnfOperationInformation req = sdncVnfResources.deactivateVnf(vnf, serviceInstance,
+ customer, cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
index fcc67d0ef7..9bbe94a077 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java
@@ -29,8 +29,10 @@ 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.exception.BBObjectNotFoundException;
+import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.orchestration.SDNCVnfResources;
+import org.onap.so.utils.TargetEntity;
import org.onap.so.client.orchestration.SDNCVfModuleResources;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,7 +41,8 @@ import org.springframework.stereotype.Component;
@Component
public class SDNCQueryTasks {
-
+ private static final Logger logger = LoggerFactory.getLogger(SDNCQueryTasks.class);
+ private static final String NO_RESPONSE_FROM_SDNC = "Error did not receive a response from SDNC.";
public static final String SDNCQUERY_RESPONSE = "SDNCQueryResponse_";
@Autowired
private SDNCVnfResources sdncVnfResources;
@@ -63,8 +66,14 @@ public class SDNCQueryTasks {
}
String response = sdncVnfResources.queryVnf(genericVnf);
execution.setVariable(SDNCQUERY_RESPONSE + genericVnf.getVnfId(), response);
+ } catch (BadResponseException ex) {
+ if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC);
+ } else {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
+ }
} catch (Exception ex) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
}
}
@@ -88,6 +97,12 @@ public class SDNCQueryTasks {
throw new Exception("Vf Module " + vfModule.getVfModuleId()
+ " exists in gBuildingBlock but does not have a selflink value");
}
+ } catch (BadResponseException ex) {
+ if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC);
+ } else {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
+ }
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
@@ -109,10 +124,16 @@ public class SDNCQueryTasks {
// If we see a bb object not found exception for something that is not a vf module id, then we should throw
// the error as normal
if (!ResourceKey.VF_MODULE_ID.equals(bbException.getResourceKey())) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, bbException);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, bbException, TargetEntity.SO);
+ }
+ } catch (BadResponseException ex) {
+ if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC);
+ } else {
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
}
} catch (Exception ex) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO);
}
}
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java
index cb761f4110..03714db943 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java
@@ -37,6 +37,7 @@ import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.SDNCClient;
import org.onap.so.client.sdnc.beans.SDNCRequest;
+import org.onap.so.utils.TargetEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -79,17 +80,19 @@ public class SDNCRequestTasks {
} catch (PathNotFoundException e) {
logger.error("Error Parsing SDNC Response. Could not find read final ack indicator from JSON.", e);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,
- "Recieved invalid response from SDNC, unable to read message content.");
+ "Recieved invalid response from SDNC, unable to read message content.", TargetEntity.SO);
} catch (MapperException e) {
logger.error("Failed to map SDNC object to JSON prior to POST.", e);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,
- "Failed to map SDNC object to JSON prior to POST.");
+ "Failed to map SDNC object to JSON prior to POST.", TargetEntity.SO);
} catch (BadResponseException e) {
logger.error("Did not receive a successful response from SDNC.", e);
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getLocalizedMessage());
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getLocalizedMessage(),
+ TargetEntity.SDNC);
} catch (HttpClientErrorException e) {
logger.error("HttpClientErrorException: 404 Not Found, Failed to contact SDNC", e);
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "SDNC cannot be contacted.");
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "SDNC cannot be contacted.",
+ TargetEntity.SO);
}
}
@@ -120,16 +123,17 @@ public class SDNCRequestTasks {
}
} catch (SDNCErrorResponseException e) {
logger.error("SDNC error response - " + e.getMessage());
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage());
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage(), TargetEntity.SDNC);
} catch (Exception e) {
- logger.error("Error procesing SDNC callback", e);
- exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "Error procesing SDNC callback");
+ logger.error("Error processing SDNC callback", e);
+ exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "Error processing SDNC callback",
+ TargetEntity.SO);
}
}
public void handleTimeOutException(DelegateExecution execution) {
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,
- "Error timed out waiting on SDNC Async-Response");
+ "Error timed out waiting on SDNC Async-Response", TargetEntity.SO);
}
protected boolean convertIndicatorToBoolean(String finalMessageIndicator) {
@@ -149,5 +153,4 @@ public class SDNCRequestTasks {
}
return result;
}
-
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
index 7d5591af0f..e3c9785ab2 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java
@@ -22,8 +22,6 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
import org.onap.sdnc.northbound.client.model.GenericResourceApiNetworkOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation;
@@ -53,7 +51,7 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class SDNCUnassignTasks {
+public class SDNCUnassignTasks extends AbstractSDNCTask {
public static final String SDNC_REQUEST = "SDNCRequest";
@Autowired
@@ -91,16 +89,15 @@ public class SDNCUnassignTasks {
public void unassignVfModule(BuildingBlockExecution execution) {
try {
+ GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
ServiceInstance serviceInstance =
extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID);
+ RequestContext requestContext = gBBInput.getRequestContext();
VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID);
SDNCRequest sdncRequest = new SDNCRequest();
- UriBuilder builder = UriBuilder.fromPath(env.getRequiredProperty("mso.workflow.message.endpoint"))
- .path(sdncRequest.getCorrelationName()).path(sdncRequest.getCorrelationValue());
- URI uri = builder.build();
- GenericResourceApiVfModuleOperationInformation req =
- sdncVfModuleResources.unassignVfModule(vfModule, vnf, serviceInstance, uri);
+ GenericResourceApiVfModuleOperationInformation req = sdncVfModuleResources.unassignVfModule(vfModule, vnf,
+ serviceInstance, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VFMODULE);
execution.setVariable(SDNC_REQUEST, sdncRequest);
@@ -118,9 +115,9 @@ public class SDNCUnassignTasks {
RequestContext requestContext = gBBInput.getRequestContext();
Customer customer = gBBInput.getCustomer();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
- GenericResourceApiVnfOperationInformation req =
- sdncVnfResources.unassignVnf(vnf, serviceInstance, customer, cloudRegion, requestContext);
SDNCRequest sdncRequest = new SDNCRequest();
+ GenericResourceApiVnfOperationInformation req = sdncVnfResources.unassignVnf(vnf, serviceInstance, customer,
+ cloudRegion, requestContext, buildCallbackURI(sdncRequest));
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.VNF);
execution.setVariable(SDNC_REQUEST, sdncRequest);
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 e3a943214d..89030d52dc 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
@@ -319,8 +319,7 @@ public class WorkflowAction {
cloudOwner, serviceType);
}
flowsToExecute = buildExecuteBuildingBlockList(orchFlows, resourceCounter, requestId, apiVersion,
- resourceId, resourceType, requestAction, aLaCarte, vnfType, workflowResourceIds,
- requestDetails);
+ resourceId, requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails);
if (!resourceCounter.stream().filter(x -> WorkflowType.NETWORKCOLLECTION == x.getResourceType())
.collect(Collectors.toList()).isEmpty()) {
logger.info("Sorting for Vlan Tagging");
@@ -445,9 +444,8 @@ public class WorkflowAction {
protected List<ExecuteBuildingBlock> getConfigBuildingBlocks(ConfigBuildingBlocksDataObject dataObj) {
List<ExecuteBuildingBlock> flowsToExecuteConfigs = new ArrayList<>();
- List<OrchestrationFlow> result = new ArrayList<>(dataObj.getOrchFlows());
- result = dataObj.getOrchFlows().stream().filter(item -> item.getFlowName().contains(FABRIC_CONFIGURATION))
- .collect(Collectors.toList());
+ List<OrchestrationFlow> result = dataObj.getOrchFlows().stream()
+ .filter(item -> item.getFlowName().contains(FABRIC_CONFIGURATION)).collect(Collectors.toList());
String vnfId = dataObj.getWorkflowResourceIds().getVnfId();
String vfModuleId = dataObj.getWorkflowResourceIds().getVfModuleId();
@@ -647,7 +645,7 @@ public class WorkflowAction {
RelatedInstance relatedLocalNetwork =
bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.network);
if (relatedVpnBinding != null && relatedLocalNetwork != null) {
- traverseVrfConfiguration(execution, aaiResourceIds, resourceCounter, service, relatedVpnBinding,
+ traverseVrfConfiguration(aaiResourceIds, resourceCounter, service, relatedVpnBinding,
relatedLocalNetwork);
} else {
traverseNetworkCollection(execution, resourceCounter, service);
@@ -655,10 +653,10 @@ public class WorkflowAction {
}
}
- protected void traverseVrfConfiguration(DelegateExecution execution,
- List<Pair<WorkflowType, String>> aaiResourceIds, List<Resource> resourceCounter,
- org.onap.so.db.catalog.beans.Service service, RelatedInstance relatedVpnBinding,
- RelatedInstance relatedLocalNetwork) throws VrfBondingServiceException, JsonProcessingException {
+ protected void traverseVrfConfiguration(List<Pair<WorkflowType, String>> aaiResourceIds,
+ List<Resource> resourceCounter, org.onap.so.db.catalog.beans.Service service,
+ RelatedInstance relatedVpnBinding, RelatedInstance relatedLocalNetwork)
+ throws VrfBondingServiceException, JsonProcessingException {
org.onap.aai.domain.yang.L3Network aaiLocalNetwork =
bbInputSetupUtils.getAAIL3Network(relatedLocalNetwork.getInstanceId());
vrfValidation.vrfServiceValidation(service);
@@ -1277,8 +1275,8 @@ public class WorkflowAction {
protected List<ExecuteBuildingBlock> buildExecuteBuildingBlockList(List<OrchestrationFlow> orchFlows,
List<Resource> resourceCounter, String requestId, String apiVersion, String resourceId,
- WorkflowType resourceType, String requestAction, boolean aLaCarte, String vnfType,
- WorkflowResourceIds workflowResourceIds, RequestDetails requestDetails) {
+ String requestAction, boolean aLaCarte, String vnfType, WorkflowResourceIds workflowResourceIds,
+ RequestDetails requestDetails) {
List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
for (OrchestrationFlow orchFlow : orchFlows) {
if (orchFlow.getFlowName().contains(SERVICE)) {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java
index 67dc9fec26..be3e06c9ea 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2019 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
@@ -26,6 +28,7 @@ import org.camunda.bpm.engine.delegate.BpmnError;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
+import org.onap.so.constants.Status;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.client.RequestsDbClient;
import org.slf4j.Logger;
@@ -37,6 +40,7 @@ import org.springframework.stereotype.Component;
public class WorkflowActionBBFailure {
private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBFailure.class);
+ public static final String ROLLBACK_TARGET_STATE = "rollbackTargetState";
@Autowired
private RequestsDbClient requestDbclient;
@Autowired
@@ -89,6 +93,8 @@ public class WorkflowActionBBFailure {
rollbackErrorMsg = "Rollback has been completed successfully.";
request.setRollbackStatusMessage(rollbackErrorMsg);
execution.setVariable("RollbackErrorMessage", rollbackErrorMsg);
+ String rollbackTargetState = (String) execution.getVariable(ROLLBACK_TARGET_STATE);
+ request.setRequestStatus(rollbackTargetState);
} else if (isRollbackFailure) {
Optional<String> rollbackErrorMsgOp = retrieveErrorMessage(execution);
if (rollbackErrorMsgOp.isPresent()) {
@@ -98,6 +104,7 @@ public class WorkflowActionBBFailure {
}
request.setRollbackStatusMessage(rollbackErrorMsg);
execution.setVariable("RollbackErrorMessage", rollbackErrorMsg);
+ request.setRequestStatus(Status.FAILED.toString());
} else {
Optional<String> errorMsgOp = retrieveErrorMessage(execution);
if (errorMsgOp.isPresent()) {
@@ -107,6 +114,12 @@ public class WorkflowActionBBFailure {
}
request.setStatusMessage(errorMsg);
execution.setVariable("ErrorMessage", errorMsg);
+ String handlingCode = (String) execution.getVariable("handlingCode");
+ if ("Abort".equalsIgnoreCase(handlingCode)) {
+ request.setRequestStatus(Status.ABORTED.toString());
+ } else {
+ request.setRequestStatus(Status.FAILED.toString());
+ }
}
if (ebb != null && ebb.getBuildingBlock() != null) {
String flowStatus = "";
@@ -120,7 +133,6 @@ public class WorkflowActionBBFailure {
}
request.setProgress(Long.valueOf(100));
- request.setRequestStatus("FAILED");
request.setLastModifiedBy("CamundaBPMN");
request.setEndTime(new Timestamp(System.currentTimeMillis()));
requestDbclient.updateInfraActiveRequests(request);
@@ -133,10 +145,10 @@ public class WorkflowActionBBFailure {
String errorMsg = null;
try {
WorkflowException exception = (WorkflowException) execution.getVariable("WorkflowException");
- if (exception != null && (exception.getErrorMessage() != null || !exception.getErrorMessage().equals(""))) {
+ if (exception != null && (exception.getErrorMessage() != null || !"".equals(exception.getErrorMessage()))) {
errorMsg = exception.getErrorMessage();
}
- if (errorMsg == null || errorMsg.equals("")) {
+ if (errorMsg == null || "".equals(errorMsg)) {
errorMsg = (String) execution.getVariable("WorkflowExceptionErrorMessage");
}
if (errorMsg == null) {
@@ -155,7 +167,7 @@ public class WorkflowActionBBFailure {
updateRequestStatusToFailed(execution);
}
- public void abortCallErrorHandling(DelegateExecution execution) {
+ public void abortCallErrorHandling() {
String msg = "Flow has failed. Rainy day handler has decided to abort the process.";
logger.error(msg);
throw new BpmnError(msg);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
index 44152fcaf4..073dead8b3 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
@@ -28,6 +28,7 @@ import javax.persistence.EntityNotFoundException;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.onap.aai.domain.yang.Vnfc;
import org.onap.so.bpmn.common.DelegateExecutionImpl;
+import org.onap.so.bpmn.common.listener.db.RequestsDbListenerRunner;
import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulatorListenerRunner;
import org.onap.so.bpmn.common.workflow.context.WorkflowCallbackResponse;
import org.onap.so.bpmn.common.workflow.context.WorkflowContextHolder;
@@ -81,6 +82,8 @@ public class WorkflowActionBBTasks {
private CatalogDbClient catalogDbClient;
@Autowired
private FlowManipulatorListenerRunner flowManipulatorListenerRunner;
+ @Autowired
+ private RequestsDbListenerRunner requestsDbListener;
public void selectBB(DelegateExecution execution) {
List<ExecuteBuildingBlock> flowsToExecute =
@@ -225,6 +228,7 @@ public class WorkflowActionBBTasks {
request.setProgress(Long.valueOf(100));
request.setRequestStatus("COMPLETE");
request.setLastModifiedBy("CamundaBPMN");
+ requestsDbListener.post(request, new DelegateExecutionImpl(execution));
requestDbclient.updateInfraActiveRequests(request);
} catch (Exception ex) {
workflowAction.buildAndThrowException(execution, "Error Updating Request Database", ex);
@@ -312,7 +316,6 @@ public class WorkflowActionBBTasks {
}
workflowActionBBFailure.updateRequestErrorStatusMessage(execution);
-
if (rollbackFlows.isEmpty())
execution.setVariable("isRollbackNeeded", false);
else
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java
index fd0de086ad..376a27e830 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListener.java
@@ -24,16 +24,18 @@ import java.util.Collections;
import java.util.List;
import org.onap.so.bpmn.common.BBConstants;
import org.onap.so.bpmn.common.BuildingBlockExecution;
+import org.onap.so.bpmn.common.listener.db.PostCompletionRequestsDbListener;
import org.onap.so.bpmn.common.listener.flowmanipulator.FlowManipulator;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.db.request.beans.InfraActiveRequests;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
-public class MultiStageSkipListener implements FlowManipulator {
+public class MultiStageSkipListener implements FlowManipulator, PostCompletionRequestsDbListener {
@Autowired
protected BBInputSetupUtils bbInputSetupUtils;
@@ -41,12 +43,21 @@ public class MultiStageSkipListener implements FlowManipulator {
@Autowired
private CatalogDbClient catalogDbClient;
+ private static final String G_MULTI_STAGE_DESIGN = "multiStageDesign";
+
@Override
public boolean shouldRunFor(String currentBBName, boolean isFirst, BuildingBlockExecution execution) {
return ((boolean) execution.getVariable(BBConstants.G_ALACARTE)) && "AssignVfModuleBB".equals(currentBBName)
&& isFirst;
}
+
+ @Override
+ public boolean shouldRunFor(BuildingBlockExecution execution) {
+
+ return (boolean) execution.getVariable(G_MULTI_STAGE_DESIGN);
+ }
+
@Override
public void run(List<ExecuteBuildingBlock> flowsToExecute, ExecuteBuildingBlock currentBB,
BuildingBlockExecution execution) {
@@ -61,10 +72,15 @@ public class MultiStageSkipListener implements FlowManipulator {
if (vnfCust != null && vnfCust.getMultiStageDesign() != null
&& vnfCust.getMultiStageDesign().equalsIgnoreCase("true")) {
flowsToExecute.retainAll(Collections.singletonList(currentBB));
+ execution.setVariable(G_MULTI_STAGE_DESIGN, Boolean.valueOf(vnfCust.getMultiStageDesign()));
}
}
}
}
+ @Override
+ public void run(InfraActiveRequests request, BuildingBlockExecution execution) {
+ request.setFlowStatus("Successfully completed Assign Building Block only due to multi-stage-design VNF");
+ }
}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java
index b83a4d5628..b3ea18df58 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java
@@ -60,9 +60,9 @@ public class SDNCVfModuleResources {
}
public GenericResourceApiVfModuleOperationInformation unassignVfModule(VfModule vfModule, GenericVnf vnf,
- ServiceInstance serviceInstance, URI callbackURI) throws MapperException {
+ ServiceInstance serviceInstance, RequestContext requestContext, URI callbackURI) throws MapperException {
return sdncRM.reqMapper(SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN, vfModule, null,
- vnf, serviceInstance, null, null, null, null, callbackURI);
+ vnf, serviceInstance, null, null, requestContext, null, callbackURI);
}
public GenericResourceApiVfModuleOperationInformation deactivateVfModule(VfModule vfModule, GenericVnf vnf,
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
index 0e32955eed..12aae1e6a6 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java
@@ -22,6 +22,7 @@
package org.onap.so.client.orchestration;
+import java.net.URI;
import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
@@ -50,47 +51,48 @@ public class SDNCVnfResources {
private SDNCClient sdncClient;
public GenericResourceApiVnfOperationInformation assignVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing,
+ URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, homing);
+ cloudRegion, requestContext, homing, callbackURI);
}
public GenericResourceApiVnfOperationInformation activateVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ACTIVATE,
GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ cloudRegion, requestContext, false, callbackURI);
}
public GenericResourceApiVnfOperationInformation deactivateVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.DEACTIVATE,
GenericResourceApiRequestActionEnumeration.DELETEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ cloudRegion, requestContext, false, callbackURI);
}
public GenericResourceApiVnfOperationInformation unassignVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN,
GenericResourceApiRequestActionEnumeration.DELETEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ cloudRegion, requestContext, false, callbackURI);
}
public GenericResourceApiVnfOperationInformation deleteVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.DEACTIVATE,
GenericResourceApiRequestActionEnumeration.DELETEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ cloudRegion, requestContext, false, callbackURI);
}
public GenericResourceApiVnfOperationInformation changeModelVnf(GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) {
return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.CHANGE_ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ cloudRegion, requestContext, false, callbackURI);
}
public String queryVnf(GenericVnf vnf) throws MapperException, BadResponseException {
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java
index 0a825b8424..62d6a110f6 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java
@@ -39,12 +39,33 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+/**
+ * This class is used for creating and deleting the request for VfModule.
+ *
+ */
@Component
public class VnfAdapterVfModuleResources {
@Autowired
private VnfAdapterVfModuleObjectMapper vnfAdapterVfModuleObjectMapper;
+ /**
+ * This method is used for creating the request for the VfModule.
+ *
+ * This method take these parameter and call the VnfAdapterVfModuleObjectMapper to create the request.
+ *
+ * @param requestContext
+ * @param cloudRegion
+ * @param orchestrationContext
+ * @param serviceInstance
+ * @param genericVnf
+ * @param vfModule
+ * @param volumeGroup
+ * @param sdncVnfQueryResponse
+ * @param sdncVfModuleQueryResponse
+ * @throws IOException & MissingValueTagException
+ * @return
+ */
public CreateVfModuleRequest createVfModuleRequest(RequestContext requestContext, CloudRegion cloudRegion,
OrchestrationContext orchestrationContext, ServiceInstance serviceInstance, GenericVnf genericVnf,
VfModule vfModule, VolumeGroup volumeGroup, String sdncVnfQueryResponse, String sdncVfModuleQueryResponse)
@@ -54,6 +75,19 @@ public class VnfAdapterVfModuleResources {
sdncVfModuleQueryResponse);
}
+ /**
+ * This method is used for delete the request for the VfModule.
+ *
+ * This method take these parameter and call the VnfAdapterVfModuleObjectMapper to delete the request.
+ *
+ * @param requestContext
+ * @param cloudRegion
+ * @param serviceInstance
+ * @param genericVnf
+ * @param vfModule
+ * @throws IOException
+ * @return
+ */
public DeleteVfModuleRequest deleteVfModuleRequest(RequestContext requestContext, CloudRegion cloudRegion,
ServiceInstance serviceInstance, GenericVnf genericVnf, VfModule vfModule) throws IOException {
return vnfAdapterVfModuleObjectMapper.deleteVfModuleRequestMapper(requestContext, cloudRegion, serviceInstance,
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
index e39e202aa3..fd0af3a4dd 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapper.java
@@ -20,6 +20,7 @@
package org.onap.so.client.sdnc.mapper;
+import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -54,9 +55,26 @@ public class VnfTopologyOperationRequestMapper {
@Autowired
private GeneralTopologyObjectMapper generalTopologyObjectMapper;
+ /**
+ * This method is used for creating the vnf request.
+ *
+ * By these parameter it will get he detailas and prepare the request.
+ *
+ * @param svcOperation
+ * @param svcAction
+ * @param requestAction
+ * @param vnf
+ * @param serviceInstance
+ * @param customer
+ * @param cloudRegion
+ * @param requestContext
+ * @param homing
+ * @return request
+ */
public GenericResourceApiVnfOperationInformation reqMapper(SDNCSvcOperation svcOperation, SDNCSvcAction svcAction,
GenericResourceApiRequestActionEnumeration requestAction, GenericVnf vnf, ServiceInstance serviceInstance,
- Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing) {
+ Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing,
+ URI callbackUrl) {
String sdncReqId = UUID.randomUUID().toString();
String msoRequestId = UUID.randomUUID().toString();
if (requestContext != null && requestContext.getMsoRequestId() != null) {
@@ -64,7 +82,7 @@ public class VnfTopologyOperationRequestMapper {
}
GenericResourceApiVnfOperationInformation req = new GenericResourceApiVnfOperationInformation();
GenericResourceApiSdncrequestheaderSdncRequestHeader sdncRequestHeader =
- generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId);
+ generalTopologyObjectMapper.buildSdncRequestHeader(svcAction, sdncReqId, callbackUrl.toString());
GenericResourceApiRequestinformationRequestInformation requestInformation = generalTopologyObjectMapper
.buildGenericResourceApiRequestinformationRequestInformation(msoRequestId, requestAction);
GenericResourceApiServiceinformationServiceInformation serviceInformation =
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
index 825c703b74..4f1ad996dc 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/common/data/TestDataSetup.java
@@ -159,7 +159,7 @@ public class TestDataSetup {
public RequestContext buildRequestContext() {
RequestContext requestContext = new RequestContext();
- requestContext.setMsoRequestId(UUID.randomUUID().toString());
+ requestContext.setMsoRequestId("fb06f44c-c797-4f38-9b17-b4b975344600");
requestContext.setProductFamilyId("testProductFamilyId");
requestContext.setRequestorId("testRequestorId");
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
index b889493d2e..ed3ec759c3 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasksTest.java
@@ -60,7 +60,6 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule;
-import org.onap.so.bpmn.servicedecomposition.tasks.exceptions.DuplicateNameException;
import org.onap.so.client.exception.BBObjectNotFoundException;
import org.onap.so.db.catalog.beans.OrchestrationStatus;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
@@ -130,14 +129,6 @@ public class AAICreateTasksTest extends BaseTaskTest {
}
@Test
- public void createServiceInstanceNameInUseExceptionTest() throws Exception {
- expectedException.expect(BpmnError.class);
- doReturn(true).when(aaiServiceInstanceResources).checkInstanceServiceNameInUse(serviceInstance);
- execution.setVariable("aLaCarte", Boolean.TRUE);
- aaiCreateTasks.createServiceInstance(execution);
- }
-
- @Test
public void createServiceInstanceExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
@@ -162,14 +153,6 @@ public class AAICreateTasksTest extends BaseTaskTest {
}
@Test
- public void createVolumeGroupDuplicateNameTest() throws Exception {
- expectedException.expect(BpmnError.class);
- execution.setVariable("aLaCarte", Boolean.TRUE);
- doReturn(true).when(aaiVolumeGroupResources).checkNameInUse(volumeGroup);
- aaiCreateTasks.createVolumeGroup(execution);
- }
-
- @Test
public void createVolumeGroupExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
@@ -349,14 +332,6 @@ public class AAICreateTasksTest extends BaseTaskTest {
}
@Test
- public void createVnfDuplicateNameTest() throws Exception {
- expectedException.expect(BpmnError.class);
- doReturn(true).when(aaiVnfResources).checkNameInUse(genericVnf.getVnfName());
- execution.setVariable("aLaCarte", Boolean.TRUE);
- aaiCreateTasks.createVnf(execution);
- }
-
- @Test
public void createVnfExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, "notfound");
@@ -386,14 +361,6 @@ public class AAICreateTasksTest extends BaseTaskTest {
}
@Test
- public void createVfModuleDuplicateNameTest() throws Exception {
- expectedException.expect(BpmnError.class);
- execution.setVariable("aLaCarte", Boolean.TRUE);
- doReturn(true).when(aaiVfModuleResources).checkNameInUse(vfModule);
- aaiCreateTasks.createVfModule(execution);
- }
-
- @Test
public void createServiceSubscriptionTest() {
doNothing().when(aaiServiceInstanceResources).createServiceSubscription(customer);
aaiCreateTasks.createServiceSubscription(execution);
@@ -441,14 +408,6 @@ public class AAICreateTasksTest extends BaseTaskTest {
}
@Test
- public void createNetworkNameInUseExceptionTest() throws Exception {
- expectedException.expect(BpmnError.class);
- execution.setVariable("aLaCarte", Boolean.TRUE);
- doReturn(true).when(aaiNetworkResources).checkNetworkNameInUse(network.getNetworkName());
- aaiCreateTasks.createNetwork(execution);
- }
-
- @Test
public void createNetworkExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
@@ -560,15 +519,6 @@ public class AAICreateTasksTest extends BaseTaskTest {
}
@Test
- public void createConfigurationNameInUseExceptionTest() throws Exception {
- expectedException.expect(BpmnError.class);
- doReturn(true).when(aaiConfigurationResources)
- .checkConfigurationNameInUse(configuration.getConfigurationName());
- execution.setVariable("aLaCarte", Boolean.TRUE);
- aaiCreateTasks.createConfiguration(execution);
- }
-
- @Test
public void connectVnfToCloudRegionTest() throws Exception {
gBBInput = execution.getGeneralBuildingBlock();
doNothing().when(aaiVnfResources).connectVnfToCloudRegion(genericVnf, gBBInput.getCloudRegion());
@@ -609,15 +559,6 @@ public class AAICreateTasksTest extends BaseTaskTest {
}
@Test
- public void createInstanceGroupVnfNameInUseExceptionTest() throws Exception {
- expectedException.expect(BpmnError.class);
- doReturn(true).when(aaiInstanceGroupResources)
- .checkInstanceGroupNameInUse(instanceGroup.getInstanceGroupName());
- execution.setVariable("aLaCarte", Boolean.TRUE);
- aaiCreateTasks.createInstanceGroupVnf(execution);
- }
-
- @Test
public void createInstanceGroupVnfExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
doThrow(RuntimeException.class).when(aaiInstanceGroupResources)
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java
index d0cee42178..8aea2d2650 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java
@@ -39,12 +39,14 @@ import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.client.exception.BadResponseException;
import org.onap.so.client.exception.ExceptionBuilder;
import org.onap.so.client.exception.MapperException;
+import org.onap.so.utils.TargetEntity;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -110,8 +112,9 @@ public class NetworkAdapterRestV1Test extends BaseTaskTest {
delegateExecution.setVariable("networkAdapterRequest", updateNetworkRequest);
delegateExecution.setVariable("NetworkAResponse_MESSAGE", updateNetworkResponse.toXmlString());
- doThrow(new BpmnError("MSOWorkflowException")).when(exceptionBuilder)
- .buildAndThrowWorkflowException(any(DelegateExecution.class), anyInt(), any(String.class));
+ doThrow(new BpmnError("MSOWorkflowException")).when(exceptionBuilder).buildAndThrowWorkflowException(
+ any(DelegateExecution.class), anyInt(), any(String.class), any(TargetEntity.class));
+
try {
networkAdapterRestV1Tasks.processCallback(delegateExecution);
} catch (BpmnError be) {
@@ -119,6 +122,6 @@ public class NetworkAdapterRestV1Test extends BaseTaskTest {
}
assertNull(delegateExecution.getVariable("updateNetworkResponse"));
verify(exceptionBuilder, times(1)).buildAndThrowWorkflowException(any(DelegateExecution.class), eq(7000),
- eq("test error message"));
+ eq("test error message"), eq(TargetEntity.OPENSTACK));
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/audit/AuditTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/audit/AuditTasksTest.java
index 3bf24291ea..cee06caa75 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/audit/AuditTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/audit/AuditTasksTest.java
@@ -7,9 +7,9 @@
* 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.
@@ -21,14 +21,20 @@ package org.onap.so.bpmn.infrastructure.audit;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
+import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.ArgumentMatchers;
import org.mockito.InjectMocks;
+import org.mockito.Mockito;
+import org.onap.aai.domain.yang.Vserver;
import org.onap.so.audit.beans.AuditInventory;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -36,6 +42,11 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.onap.so.db.request.beans.RequestProcessingData;
+import org.onap.so.objects.audit.AAIObjectAudit;
+import org.onap.so.objects.audit.AAIObjectAuditList;
+import com.fasterxml.jackson.core.JsonProcessingException;
public class AuditTasksTest extends BaseTaskTest {
@@ -50,16 +61,29 @@ public class AuditTasksTest extends BaseTaskTest {
public final ExpectedException exception = ExpectedException.none();
@Before
- public void before() throws BBObjectNotFoundException {
+ public void before() throws BBObjectNotFoundException, JsonProcessingException {
serviceInstance = setServiceInstance();
genericVnf = setGenericVnf();
vfModule = setVfModule();
+ buildRequestContext();
setCloudRegion();
+ setRequestContext();
when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.GENERIC_VNF_ID)))
.thenReturn(genericVnf);
when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VF_MODULE_ID))).thenReturn(vfModule);
when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID)))
.thenReturn(serviceInstance);
+ execution.setVariable("auditQuerySuccess", true);
+ AAIObjectAuditList auditList = new AAIObjectAuditList();
+ auditList.setHeatStackName("testHeatStackName");
+ AAIObjectAudit audit = new AAIObjectAudit();
+ Vserver vserver = new Vserver();
+ vserver.setVserverId("testVserverId");
+ audit.setAaiObject(vserver);
+ auditList.getAuditList().add(audit);
+ GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
+ String auditListString = objectMapper.getMapper().writeValueAsString(audit);
+ execution.setVariable("auditList", auditListString);
}
@Test
@@ -68,8 +92,12 @@ public class AuditTasksTest extends BaseTaskTest {
expectedAuditInventory.setCloudOwner("testCloudOwner");
expectedAuditInventory.setCloudRegion("testLcpCloudRegionId");
expectedAuditInventory.setHeatStackName("testVfModuleName1");
+ expectedAuditInventory.setVfModuleId("testVfModuleId1");
expectedAuditInventory.setTenantId("testTenantId");
+ expectedAuditInventory.setGenericVnfId("testVnfId1");
+ expectedAuditInventory.setMsoRequestId("fb06f44c-c797-4f38-9b17-b4b975344600");
auditTasks.setupAuditVariable(execution);
assertThat((AuditInventory) execution.getVariable("auditInventory"), sameBeanAs(expectedAuditInventory));
}
+
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/namingservice/tasks/NamingServiceCreateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/namingservice/tasks/NamingServiceCreateTasksTest.java
index 44e5e0e707..609d2dabd8 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/namingservice/tasks/NamingServiceCreateTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/namingservice/tasks/NamingServiceCreateTasksTest.java
@@ -21,6 +21,7 @@
package org.onap.so.bpmn.infrastructure.namingservice.tasks;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.doReturn;
@@ -31,6 +32,7 @@ import static org.mockito.Mockito.when;
import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.ArgumentCaptor;
import org.mockito.ArgumentMatchers;
import org.mockito.InjectMocks;
import org.mockito.Mock;
@@ -47,6 +49,8 @@ import org.onap.so.client.aai.AAICommonObjectMapperProvider;
import org.onap.so.client.aai.entities.AAIResultWrapper;
import org.onap.so.client.aai.entities.Relationships;
import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.onap.so.client.namingservice.NamingRequestObject;
+import org.onap.so.client.namingservice.NamingServiceConstants;
public class NamingServiceCreateTasksTest extends BaseTaskTest {
@InjectMocks
@@ -106,9 +110,17 @@ public class NamingServiceCreateTasksTest extends BaseTaskTest {
String generatedName = "generatedWanTransportServiceName";
doReturn(generatedName).when(namingServiceResources).generateServiceInstanceName(any());
NamingServiceCreateTasks spy = Mockito.spy(namingServiceCreateTasks);
+ ArgumentCaptor<NamingRequestObject> captor = ArgumentCaptor.forClass(NamingRequestObject.class);
spy.createWanTransportServiceName(execution);
- verify(namingServiceResources, times(1)).generateServiceInstanceName(any());
+ verify(namingServiceResources, times(1)).generateServiceInstanceName(captor.capture());
+ assertTrue(captor.getAllValues().get(0).getExternalKeyValue().startsWith("testServiceInstanceId"));
+ assertEquals(captor.getAllValues().get(0).getNamingTypeValue(), NamingServiceConstants.NAMING_TYPE_SERVICE);
+ assertEquals(captor.getAllValues().get(0).getResourceNameValue(),
+ NamingServiceConstants.RESOURCE_NAME_SERVICE_INSTANCE_NAME);
+ assertEquals(captor.getAllValues().get(0).getPolicyInstanceNameValue(), null);
+ assertTrue(captor.getAllValues().get(0).getServiceModelNameValue().startsWith("testModelName"));
+ assertTrue(captor.getAllValues().get(0).getModelVersionValue().startsWith("testModelVersion"));
assertEquals(generatedName, serviceInstance.getServiceInstanceName());
}
@@ -118,10 +130,20 @@ public class NamingServiceCreateTasksTest extends BaseTaskTest {
.thenReturn(buildL3Network());
when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.VPN_ID)))
.thenReturn(buildVpnBinding());
+ ArgumentCaptor<NamingRequestObject> captor = ArgumentCaptor.forClass(NamingRequestObject.class);
String generatedName = "generatedWanTransportServiceName";
doReturn(generatedName).when(namingServiceResources).generateServiceInstanceName(any());
namingServiceCreateTasks.createVpnBondingServiceName(execution);
- verify(namingServiceResources, times(1)).generateServiceInstanceName(any());
+ verify(namingServiceResources, times(1)).generateServiceInstanceName(captor.capture());
+ assertTrue(captor.getAllValues().get(0).getExternalKeyValue().startsWith("testServiceInstanceId"));
+ assertEquals(captor.getAllValues().get(0).getPolicyInstanceNameValue(), null);
+ assertEquals(captor.getAllValues().get(0).getNamingTypeValue(), NamingServiceConstants.NAMING_TYPE_SERVICE);
+ assertTrue(captor.getAllValues().get(0).getServiceModelNameValue().startsWith("testModelName"));
+ assertTrue(captor.getAllValues().get(0).getModelVersionValue().startsWith("testModelVersion"));
+ assertTrue(captor.getAllValues().get(0).getNetworkNameValue().startsWith("testNetworkName"));
+ assertTrue(captor.getAllValues().get(0).getVpnNameValue().startsWith("testVpnName"));
+ assertEquals(captor.getAllValues().get(0).getResourceNameValue(),
+ NamingServiceConstants.RESOURCE_NAME_SERVICE_INSTANCE_NAME);
assertEquals(generatedName, serviceInstance.getServiceInstanceName());
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTaskTest.java
index ffd4f74b63..510dc47649 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTaskTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTaskTest.java
@@ -94,11 +94,11 @@ public class SDNCActivateTaskTest extends BaseTaskTest {
@Test
public void activateVnfTest() throws Exception {
- doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).activateVnf(genericVnf,
- serviceInstance, customer, cloudRegion, requestContext);
+ doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).activateVnf(eq(genericVnf),
+ eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncActivateTasks.activateVnf(execution);
- verify(sdncVnfResources, times(1)).activateVnf(genericVnf, serviceInstance, customer, cloudRegion,
- requestContext);
+ verify(sdncVnfResources, times(1)).activateVnf(eq(genericVnf), eq(serviceInstance), eq(customer),
+ eq(cloudRegion), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
@@ -106,8 +106,8 @@ public class SDNCActivateTaskTest extends BaseTaskTest {
@Test
public void activateVnfTestException() throws Exception {
expectedException.expect(BpmnError.class);
- doThrow(RuntimeException.class).when(sdncVnfResources).activateVnf(genericVnf, serviceInstance, customer,
- cloudRegion, requestContext);
+ doThrow(RuntimeException.class).when(sdncVnfResources).activateVnf(eq(genericVnf), eq(serviceInstance),
+ eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncActivateTasks.activateVnf(execution);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasksTest.java
index 982868dcbc..b72766c386 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasksTest.java
@@ -113,12 +113,12 @@ public class SDNCAssignTasksTest extends BaseTaskTest {
@Test
public void assignVnfTest() throws Exception {
- doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).assignVnf(genericVnf,
- serviceInstance, customer, cloudRegion, requestContext, false);
+ doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).assignVnf(eq(genericVnf),
+ eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), eq(false), any(URI.class));
execution.setVariable("generalBuildingBlock", gBBInput);
sdncAssignTasks.assignVnf(execution);
- verify(sdncVnfResources, times(1)).assignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext,
- false);
+ verify(sdncVnfResources, times(1)).assignVnf(eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion),
+ eq(requestContext), eq(false), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
@@ -126,8 +126,8 @@ public class SDNCAssignTasksTest extends BaseTaskTest {
@Test
public void assignVnfExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
- doThrow(RuntimeException.class).when(sdncVnfResources).assignVnf(genericVnf, serviceInstance, customer,
- cloudRegion, requestContext, false);
+ doThrow(RuntimeException.class).when(sdncVnfResources).assignVnf(eq(genericVnf), eq(serviceInstance),
+ eq(customer), eq(cloudRegion), eq(requestContext), eq(false), any(URI.class));
sdncAssignTasks.assignVnf(execution);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasksTest.java
index 8c25bea801..96ff01f78b 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCChangeAssignTasksTest.java
@@ -80,11 +80,11 @@ public class SDNCChangeAssignTasksTest extends BaseTaskTest {
@Test
public void changeModelVnfTest() throws Exception {
- doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).changeModelVnf(genericVnf,
- serviceInstance, customer, cloudRegion, requestContext);
+ doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).changeModelVnf(eq(genericVnf),
+ eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncChangeAssignTasks.changeModelVnf(execution);
- verify(sdncVnfResources, times(1)).changeModelVnf(genericVnf, serviceInstance, customer, cloudRegion,
- requestContext);
+ verify(sdncVnfResources, times(1)).changeModelVnf(eq(genericVnf), eq(serviceInstance), eq(customer),
+ eq(cloudRegion), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
@@ -92,8 +92,8 @@ public class SDNCChangeAssignTasksTest extends BaseTaskTest {
@Test
public void changeModelVnfExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
- doThrow(RuntimeException.class).when(sdncVnfResources).changeModelVnf(genericVnf, serviceInstance, customer,
- cloudRegion, requestContext);
+ doThrow(RuntimeException.class).when(sdncVnfResources).changeModelVnf(eq(genericVnf), eq(serviceInstance),
+ eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncChangeAssignTasks.changeModelVnf(execution);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTaskTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTaskTest.java
index d8a1b0182e..3714f9d9a9 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTaskTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTaskTest.java
@@ -107,19 +107,19 @@ public class SDNCDeactivateTaskTest extends BaseTaskTest {
@Test
public void deactivateVnfTest() throws Exception {
- doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).deactivateVnf(genericVnf,
- serviceInstance, customer, cloudRegion, requestContext);
+ doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).deactivateVnf(eq(genericVnf),
+ eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncDeactivateTasks.deactivateVnf(execution);
- verify(sdncVnfResources, times(1)).deactivateVnf(genericVnf, serviceInstance, customer, cloudRegion,
- requestContext);
+ verify(sdncVnfResources, times(1)).deactivateVnf(eq(genericVnf), eq(serviceInstance), eq(customer),
+ eq(cloudRegion), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
@Test
public void deactivateVnfExceptionTest() throws Exception {
- doThrow(RuntimeException.class).when(sdncVnfResources).deactivateVnf(genericVnf, serviceInstance, customer,
- cloudRegion, requestContext);
+ doThrow(RuntimeException.class).when(sdncVnfResources).deactivateVnf(eq(genericVnf), eq(serviceInstance),
+ eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
expectedException.expect(BpmnError.class);
sdncDeactivateTasks.deactivateVnf(execution);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java
index 3ea8474b24..0ba9237aaf 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasksTest.java
@@ -43,6 +43,9 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance;
import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
import org.onap.so.client.exception.BBObjectNotFoundException;
+import org.onap.so.client.exception.BadResponseException;
+import org.onap.so.utils.TargetEntities;
+import org.onap.so.utils.TargetEntity;
public class SDNCQueryTasksTest extends BaseTaskTest {
@InjectMocks
@@ -61,8 +64,8 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
genericVnf = setGenericVnf();
vfModule = setVfModule();
- doThrow(new BpmnError("BPMN Error")).when(exceptionUtil)
- .buildAndThrowWorkflowException(any(BuildingBlockExecution.class), eq(7000), any(Exception.class));
+ doThrow(new BpmnError("BPMN Error")).when(exceptionUtil).buildAndThrowWorkflowException(
+ any(BuildingBlockExecution.class), eq(7000), any(Exception.class), any(TargetEntities.class));
when(extractPojosForBB.extractByKey(any(), ArgumentMatchers.eq(ResourceKey.SERVICE_INSTANCE_ID)))
.thenReturn(serviceInstance);
@@ -88,6 +91,28 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
}
@Test
+ public void queryVfModuleBadResponseExceptionTest() throws Exception {
+ BadResponseException exception = new BadResponseException("Error received from SDNC");
+ doThrow(exception).when(sdncVfModuleResources).queryVfModule(vfModule);
+
+ expectedException.expect(BpmnError.class);
+ sdncQueryTasks.queryVfModule(execution);
+
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SDNC);
+ }
+
+ @Test
+ public void queryVfModuleResponseExceptionNoResponseTest() throws Exception {
+ BadResponseException exception = new BadResponseException("Error did not receive a response from SDNC.");
+ doThrow(exception).when(sdncVfModuleResources).queryVfModule(vfModule);
+
+ expectedException.expect(BpmnError.class);
+ sdncQueryTasks.queryVfModule(execution);
+
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SO);
+ }
+
+ @Test
public void queryVnfTest() throws Exception {
String sdncQueryResponse = "response";
@@ -101,6 +126,28 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
}
@Test
+ public void queryVnfBadResponseExceptionTest() throws Exception {
+ BadResponseException exception = new BadResponseException("Error received from SDNC");
+ doThrow(exception).when(sdncVnfResources).queryVnf(genericVnf);
+
+ expectedException.expect(BpmnError.class);
+ sdncQueryTasks.queryVnf(execution);
+
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SDNC);
+ }
+
+ @Test
+ public void queryVnfBadResponseExceptionNoResponseTest() throws Exception {
+ BadResponseException exception = new BadResponseException("Error did not receive a response from SDNC.");
+ doThrow(exception).when(sdncVnfResources).queryVnf(genericVnf);
+
+ expectedException.expect(BpmnError.class);
+ sdncQueryTasks.queryVnf(execution);
+
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SO);
+ }
+
+ @Test
public void queryVfModuleForVolumeGroupTest() throws Exception {
String sdncQueryResponse = "response";
vfModule.setSelflink("vfModuleSelfLink");
@@ -115,6 +162,28 @@ public class SDNCQueryTasksTest extends BaseTaskTest {
}
@Test
+ public void queryVfModuleForVolumeGroupBadResponseExceptionTest() throws Exception {
+ BadResponseException exception = new BadResponseException("Error received from SDNC");
+ doThrow(exception).when(sdncVfModuleResources).queryVfModule(vfModule);
+
+ expectedException.expect(BpmnError.class);
+ sdncQueryTasks.queryVfModuleForVolumeGroup(execution);
+
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SDNC);
+ }
+
+ @Test
+ public void queryVfModuleForVolumeGroupBadResponseExceptionNoResponseTest() throws Exception {
+ BadResponseException exception = new BadResponseException("Error did not receive a response from SDNC.");
+ doThrow(exception).when(sdncVfModuleResources).queryVfModule(vfModule);
+
+ expectedException.expect(BpmnError.class);
+ sdncQueryTasks.queryVfModuleForVolumeGroup(execution);
+
+ verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(execution, 700, exception, TargetEntity.SO);
+ }
+
+ @Test
public void queryVfModuleForVolumeGroupNoSelfLinkExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java
index 6a94b357e0..0fc33fe5ce 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasksTest.java
@@ -21,6 +21,7 @@
package org.onap.so.bpmn.infrastructure.sdnc.tasks;
import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import java.io.IOException;
@@ -48,6 +49,7 @@ import org.onap.so.client.exception.MapperException;
import org.onap.so.client.sdnc.SDNCClient;
import org.onap.so.client.sdnc.beans.SDNCRequest;
import org.onap.so.client.sdnc.endpoint.SDNCTopology;
+import org.onap.so.utils.TargetEntity;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import com.fasterxml.jackson.core.JsonParseException;
@@ -66,7 +68,6 @@ public class SDNCRequestTasksTest extends SDNCRequestTasks {
@Mock
SDNCClient sdncClient;
-
@Spy
private ExceptionBuilder exceptionBuilder;
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java
index 10c034dc36..98f6bfab9c 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasksTest.java
@@ -106,11 +106,11 @@ public class SDNCUnassignTasksTest extends BaseTaskTest {
@Test
public void unassignVfModuleTest() throws Exception {
- doReturn(new GenericResourceApiVfModuleOperationInformation()).when(sdncVfModuleResources)
- .unassignVfModule(eq(vfModule), eq(genericVnf), eq(serviceInstance), any(URI.class));
+ doReturn(new GenericResourceApiVfModuleOperationInformation()).when(sdncVfModuleResources).unassignVfModule(
+ eq(vfModule), eq(genericVnf), eq(serviceInstance), eq(requestContext), any(URI.class));
sdncUnassignTasks.unassignVfModule(execution);
verify(sdncVfModuleResources, times(1)).unassignVfModule(eq(vfModule), eq(genericVnf), eq(serviceInstance),
- any(URI.class));
+ eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VFMODULE, sdncRequest.getTopology());
}
@@ -119,17 +119,17 @@ public class SDNCUnassignTasksTest extends BaseTaskTest {
public void unassignVfModuleExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
doThrow(RuntimeException.class).when(sdncVfModuleResources).unassignVfModule(eq(vfModule), eq(genericVnf),
- eq(serviceInstance), any(URI.class));
+ eq(serviceInstance), eq(requestContext), any(URI.class));
sdncUnassignTasks.unassignVfModule(execution);
}
@Test
public void unassignVnfTest() throws Exception {
- doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).unassignVnf(genericVnf,
- serviceInstance, customer, cloudRegion, requestContext);
+ doReturn(new GenericResourceApiVnfOperationInformation()).when(sdncVnfResources).unassignVnf(eq(genericVnf),
+ eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncUnassignTasks.unassignVnf(execution);
- verify(sdncVnfResources, times(1)).unassignVnf(genericVnf, serviceInstance, customer, cloudRegion,
- requestContext);
+ verify(sdncVnfResources, times(1)).unassignVnf(eq(genericVnf), eq(serviceInstance), eq(customer),
+ eq(cloudRegion), eq(requestContext), any(URI.class));
SDNCRequest sdncRequest = execution.getVariable("SDNCRequest");
assertEquals(SDNCTopology.VNF, sdncRequest.getTopology());
}
@@ -137,8 +137,8 @@ public class SDNCUnassignTasksTest extends BaseTaskTest {
@Test
public void unassignVnfExceptionTest() throws Exception {
expectedException.expect(BpmnError.class);
- doThrow(RuntimeException.class).when(sdncVnfResources).unassignVnf(genericVnf, serviceInstance, customer,
- cloudRegion, requestContext);
+ doThrow(RuntimeException.class).when(sdncVnfResources).unassignVnf(eq(genericVnf), eq(serviceInstance),
+ eq(customer), eq(cloudRegion), eq(requestContext), any(URI.class));
sdncUnassignTasks.unassignVnf(execution);
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java
index 12f34eaddf..2d48d02774 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java
@@ -41,6 +41,7 @@ import org.mockito.Spy;
import org.onap.so.bpmn.BaseTaskTest;
import org.onap.so.bpmn.core.WorkflowException;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
+import org.onap.so.constants.Status;
import org.onap.so.db.request.beans.InfraActiveRequests;
public class WorkflowActionBBFailureTest extends BaseTaskTest {
@@ -102,6 +103,24 @@ public class WorkflowActionBBFailureTest extends BaseTaskTest {
workflowActionBBFailure.updateRequestStatusToFailed(execution);
String errorMsg = (String) execution.getVariable("ErrorMessage");
assertEquals("error in test case", errorMsg);
+ assertEquals(Status.FAILED.toString(), req.getRequestStatus());
+ }
+
+ @Test
+ public void updateRequestStatusToAborted() {
+ execution.setVariable("mso-request-id", "123");
+ execution.setVariable("isRollbackComplete", false);
+ execution.setVariable("isRollback", false);
+ execution.setVariable("handlingCode", "Abort");
+ InfraActiveRequests req = new InfraActiveRequests();
+ WorkflowException wfe = new WorkflowException("processKey123", 1, "error in test case");
+ execution.setVariable("WorkflowException", wfe);
+ doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId("123");
+ doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class));
+ workflowActionBBFailure.updateRequestStatusToFailed(execution);
+ String errorMsg = (String) execution.getVariable("ErrorMessage");
+ assertEquals("error in test case", errorMsg);
+ assertEquals(Status.ABORTED.toString(), req.getRequestStatus());
}
@Test
@@ -117,19 +136,52 @@ public class WorkflowActionBBFailureTest extends BaseTaskTest {
workflowActionBBFailure.updateRequestStatusToFailed(execution);
String errorMsg = (String) execution.getVariable("RollbackErrorMessage");
assertEquals("error in rollback", errorMsg);
+ assertEquals(Status.FAILED.toString(), req.getRequestStatus());
+ }
+
+ @Test
+ public void updateRequestStatusToRolledback() {
+ execution.setVariable("mso-request-id", "123");
+ execution.setVariable("isRollbackComplete", true);
+ execution.setVariable("isRollback", true);
+ execution.setVariable("rollbackTargetState", "ROLLED_BACK");
+ InfraActiveRequests req = new InfraActiveRequests();
+ doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId("123");
+ doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class));
+ workflowActionBBFailure.updateRequestStatusToFailed(execution);
+ String errorMsg = (String) execution.getVariable("RollbackErrorMessage");
+ assertEquals("Rollback has been completed successfully.", errorMsg);
+ assertEquals(Status.ROLLED_BACK.toString(), req.getRequestStatus());
+ }
+
+ @Test
+ public void updateRequestStatusToRolledbackToAssigned() {
+ execution.setVariable("mso-request-id", "123");
+ execution.setVariable("isRollbackComplete", true);
+ execution.setVariable("isRollback", true);
+ execution.setVariable("rollbackTargetState", "ROLLED_BACK_TO_ASSIGNED");
+ InfraActiveRequests req = new InfraActiveRequests();
+ doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId("123");
+ doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class));
+ workflowActionBBFailure.updateRequestStatusToFailed(execution);
+ String errorMsg = (String) execution.getVariable("RollbackErrorMessage");
+ assertEquals("Rollback has been completed successfully.", errorMsg);
+ assertEquals(Status.ROLLED_BACK_TO_ASSIGNED.toString(), req.getRequestStatus());
}
@Test
- public void updateRequestStatusToFailedRollbackCompleted() {
+ public void updateRequestStatusToRolledbackToCreated() {
execution.setVariable("mso-request-id", "123");
execution.setVariable("isRollbackComplete", true);
execution.setVariable("isRollback", true);
+ execution.setVariable("rollbackTargetState", "ROLLED_BACK_TO_CREATED");
InfraActiveRequests req = new InfraActiveRequests();
doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId("123");
doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class));
workflowActionBBFailure.updateRequestStatusToFailed(execution);
String errorMsg = (String) execution.getVariable("RollbackErrorMessage");
assertEquals("Rollback has been completed successfully.", errorMsg);
+ assertEquals(Status.ROLLED_BACK_TO_CREATED.toString(), req.getRequestStatus());
}
@Test
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java
index b6f8aafa55..9e2eac416c 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/MultiStageSkipListenerTest.java
@@ -36,16 +36,16 @@ import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.bpmn.common.BBConstants;
import org.onap.so.bpmn.common.BuildingBlockExecution;
import org.onap.so.bpmn.common.DelegateExecutionImpl;
-import org.onap.so.bpmn.infrastructure.workflow.tasks.listeners.MultiStageSkipListener;
import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClient;
+import org.onap.so.db.request.beans.InfraActiveRequests;
@RunWith(MockitoJUnitRunner.class)
-public class MultiStageSkipTest {
+public class MultiStageSkipListenerTest {
@Mock
private CatalogDbClient catalogDbClient;
@@ -71,6 +71,12 @@ public class MultiStageSkipTest {
assertFalse("should not be triggered",
multiStageSkipListener.shouldRunFor("AssignVfModuleBB2", true, execution));
+ execution.setVariable("multiStageDesign", true);
+ assertTrue("should be triggered", multiStageSkipListener.shouldRunFor(execution));
+
+ execution.setVariable("multiStageDesign", false);
+ assertFalse("should not be triggered", multiStageSkipListener.shouldRunFor(execution));
+
}
@@ -107,6 +113,15 @@ public class MultiStageSkipTest {
assertEquals("Flows should only have Assign", flowsToExecute.size(), 1);
assertEquals("Flows should only have Assign", flowsToExecute.get(0).getBuildingBlock().getBpmnFlowName(),
"AssignVfModuleBB");
+ }
+
+ @Test
+ public void postCompletionRequestsDbListenerTest() {
+ InfraActiveRequests request = new InfraActiveRequests();
+ BuildingBlockExecution execution = new DelegateExecutionImpl(new DelegateExecutionFake());
+ multiStageSkipListener.run(request, execution);
+ assertEquals("Successfully completed Assign Building Block only due to multi-stage-design VNF",
+ request.getFlowStatus());
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVfModuleResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVfModuleResourcesTest.java
index 57d6496a4f..14e993281a 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVfModuleResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVfModuleResourcesTest.java
@@ -98,10 +98,12 @@ public class SDNCVfModuleResourcesTest extends TestDataSetup {
@Test
public void unassignVfModuleTest() throws MapperException {
doReturn(sdncReq).when(vfModuleTopologyMapper).reqMapper(SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION,
- SDNCSvcAction.UNASSIGN, vfModule, null, vnf, serviceInstance, null, null, null, null, testURI);
- sdncVfModuleResources.unassignVfModule(vfModule, vnf, serviceInstance, testURI);
+ SDNCSvcAction.UNASSIGN, vfModule, null, vnf, serviceInstance, null, null, requestContext, null,
+ testURI);
+ sdncVfModuleResources.unassignVfModule(vfModule, vnf, serviceInstance, requestContext, testURI);
verify(vfModuleTopologyMapper, times(1)).reqMapper(SDNCSvcOperation.VF_MODULE_TOPOLOGY_OPERATION,
- SDNCSvcAction.UNASSIGN, vfModule, null, vnf, serviceInstance, null, null, null, null, testURI);
+ SDNCSvcAction.UNASSIGN, vfModule, null, vnf, serviceInstance, null, null, requestContext, null,
+ testURI);
}
@Test
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVnfResourcesTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVnfResourcesTest.java
index 4c0e2b873f..0ccf056ddc 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVnfResourcesTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/SDNCVnfResourcesTest.java
@@ -28,6 +28,8 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import java.net.URI;
+import java.net.URISyntaxException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -66,6 +68,7 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
private CloudRegion cloudRegion;
private RequestContext requestContext;
private GenericResourceApiVnfOperationInformation sdncReq;
+ private URI testURI;
@Before
public void before() {
@@ -75,6 +78,11 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
cloudRegion = buildCloudRegion();
requestContext = buildRequestContext();
sdncReq = new GenericResourceApiVnfOperationInformation();
+ try {
+ testURI = new URI("http://localhost:9800");
+ } catch (URISyntaxException e) {
+
+ }
}
@Test
@@ -82,12 +90,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
doReturn(sdncReq).when(MOCK_vnfTopologyOperationRequestMapper).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
- sdncVnfResources.assignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, false);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.assignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, false, testURI);
verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
+ anyBoolean(), any(URI.class));
}
@Test
@@ -95,12 +103,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
doReturn(sdncReq).when(MOCK_vnfTopologyOperationRequestMapper).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
- sdncVnfResources.activateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.activateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
+ anyBoolean(), any(URI.class));
}
@Test
@@ -108,12 +116,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
doReturn(sdncReq).when(MOCK_vnfTopologyOperationRequestMapper).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
- sdncVnfResources.deleteVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.deleteVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
+ anyBoolean(), any(URI.class));
}
@Test
@@ -137,11 +145,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
doReturn(sdncReq).when(MOCK_vnfTopologyOperationRequestMapper).reqMapper(isA(SDNCSvcOperation.class),
isA(SDNCSvcAction.class), isA(GenericResourceApiRequestActionEnumeration.class), isA(GenericVnf.class),
isA(ServiceInstance.class), isA(Customer.class), isA(CloudRegion.class), isA(RequestContext.class),
- anyBoolean());
- sdncVnfResources.changeModelVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
- verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION,
- SDNCSvcAction.CHANGE_ASSIGN, GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, genericVnf,
- serviceInstance, customer, cloudRegion, requestContext, false);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.changeModelVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
+ verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION),
+ eq(SDNCSvcAction.CHANGE_ASSIGN), eq(GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE),
+ eq(genericVnf), eq(serviceInstance), eq(customer), eq(cloudRegion), eq(requestContext), eq(false),
+ any(URI.class));
}
@Test
@@ -150,12 +159,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION), eq(SDNCSvcAction.DEACTIVATE),
isA(GenericResourceApiRequestActionEnumeration.class), any(GenericVnf.class),
any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class), any(RequestContext.class),
- anyBoolean());
- sdncVnfResources.deactivateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.deactivateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION),
eq(SDNCSvcAction.DEACTIVATE), isA(GenericResourceApiRequestActionEnumeration.class),
any(GenericVnf.class), any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class),
- any(RequestContext.class), anyBoolean());
+ any(RequestContext.class), anyBoolean(), any(URI.class));
}
@@ -166,8 +175,8 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION), eq(SDNCSvcAction.DEACTIVATE),
isA(GenericResourceApiRequestActionEnumeration.class), any(GenericVnf.class),
any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class), any(RequestContext.class),
- anyBoolean());
- sdncVnfResources.deactivateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.deactivateVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
}
@Test
@@ -176,12 +185,12 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION), eq(SDNCSvcAction.UNASSIGN),
isA(GenericResourceApiRequestActionEnumeration.class), any(GenericVnf.class),
any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class), any(RequestContext.class),
- anyBoolean());
- sdncVnfResources.unassignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.unassignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
verify(MOCK_vnfTopologyOperationRequestMapper, times(1)).reqMapper(eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION),
eq(SDNCSvcAction.UNASSIGN), isA(GenericResourceApiRequestActionEnumeration.class),
any(GenericVnf.class), any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class),
- any(RequestContext.class), anyBoolean());
+ any(RequestContext.class), anyBoolean(), any(URI.class));
}
@Test
@@ -191,7 +200,7 @@ public class SDNCVnfResourcesTest extends TestDataSetup {
eq(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION), eq(SDNCSvcAction.UNASSIGN),
isA(GenericResourceApiRequestActionEnumeration.class), any(GenericVnf.class),
any(ServiceInstance.class), any(Customer.class), any(CloudRegion.class), any(RequestContext.class),
- anyBoolean());
- sdncVnfResources.unassignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext);
+ anyBoolean(), any(URI.class));
+ sdncVnfResources.unassignVnf(genericVnf, serviceInstance, customer, cloudRegion, requestContext, testURI);
}
}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
index cecf34ea10..00836176f0 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sdnc/mapper/VnfTopologyOperationRequestMapperTest.java
@@ -23,15 +23,18 @@ package org.onap.so.client.sdnc.mapper;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Map;
import java.util.List;
+import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
+import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion;
import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer;
import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
@@ -45,8 +48,6 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup;
import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance;
import org.onap.so.client.sdnc.beans.SDNCSvcAction;
import org.onap.so.client.sdnc.beans.SDNCSvcOperation;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration;
-import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation;
@RunWith(MockitoJUnitRunner.class)
public class VnfTopologyOperationRequestMapperTest {
@@ -127,11 +128,11 @@ public class VnfTopologyOperationRequestMapperTest {
GenericResourceApiVnfOperationInformation vnfOpInformation =
mapper.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, requestContext, true);
+ cloudRegion, requestContext, true, new URI("http://localhost:8080"));
GenericResourceApiVnfOperationInformation vnfOpInformationNullReqContext =
mapper.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ASSIGN,
GenericResourceApiRequestActionEnumeration.CREATEVNFINSTANCE, vnf, serviceInstance, customer,
- cloudRegion, null, true);
+ cloudRegion, null, true, new URI("http://localhost:8080"));
assertNull(vnfOpInformation.getServiceInformation().getOnapModelInformation().getModelCustomizationUuid());
assertEquals("vnfModelCustomizationUUID",
diff --git a/common/src/main/java/org/onap/so/client/HttpClient.java b/common/src/main/java/org/onap/so/client/HttpClient.java
index 3fb09433e1..715ba32831 100644
--- a/common/src/main/java/org/onap/so/client/HttpClient.java
+++ b/common/src/main/java/org/onap/so/client/HttpClient.java
@@ -83,4 +83,16 @@ public class HttpClient extends RestClient {
}
}
+ public void setAcceptType(String value) {
+ try {
+ if (isNotBlank(value)) {
+ super.accept = value;
+ } else {
+ log.warn("Not adding accept to headers.");
+ }
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ }
+ }
+
}
diff --git a/common/src/main/java/org/onap/so/utils/TargetEntities.java b/common/src/main/java/org/onap/so/utils/TargetEntities.java
new file mode 100644
index 0000000000..94385ec8ea
--- /dev/null
+++ b/common/src/main/java/org/onap/so/utils/TargetEntities.java
@@ -0,0 +1,25 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 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.
+ * 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.utils;
+
+public interface TargetEntities {
+
+}
diff --git a/common/src/main/java/org/onap/so/utils/TargetEntity.java b/common/src/main/java/org/onap/so/utils/TargetEntity.java
index 0f1fe51114..3a3ec91d2f 100644
--- a/common/src/main/java/org/onap/so/utils/TargetEntity.java
+++ b/common/src/main/java/org/onap/so/utils/TargetEntity.java
@@ -22,7 +22,7 @@ package org.onap.so.utils;
import java.util.EnumSet;
-public enum TargetEntity {
+public enum TargetEntity implements TargetEntities {
OPENSTACK_ADAPTER,
BPMN,
GRM,
@@ -37,7 +37,11 @@ public enum TargetEntity {
SDC,
EXTERNAL,
MULTICLOUD,
- OOF;
+ OOF,
+ SDNC,
+ SO,
+ UNKNOWN,
+ OPENSTACK;
private static final String PREFIX = "SO";
diff --git a/docs/installconfigure/Configure_git_and_gerrit.rst b/docs/installconfigure/Configure_git_and_gerrit.rst
index c4598faf7b..76a4d75331 100644
--- a/docs/installconfigure/Configure_git_and_gerrit.rst
+++ b/docs/installconfigure/Configure_git_and_gerrit.rst
@@ -25,14 +25,14 @@ Enter your SSH public key (id_rsa) into gerrit:
- Log in
- Open the menu next to your name (under the green search button)
-.. image:: images/Configure_git_1.png
+.. image:: ../images/Configure_git_1.png
- Select "Settings"
- In the "Settings" sidebar, click "SSH Public Keys"`
- Click "Add Key..."
- Paste the entire contents of $HOME/.ssh/id_rsa.pub into the text area and click "Add".
-.. image:: images/Configure_git_2.png
+.. image:: ../images/Configure_git_2.png
Install the git-review package.
@@ -90,4 +90,4 @@ Verify that you have connectivity to gerrit through the proxy. Answer "yes" to
ssh -p 29418 gerrit.onap.org
-.. image:: images/Configure_git_3.png
+.. image:: ../images/Configure_git_3.png
diff --git a/docs/installconfigure/Install_Docker.rst b/docs/installconfigure/Install_Docker.rst
index 91e40ca138..d20c2b1951 100644
--- a/docs/installconfigure/Install_Docker.rst
+++ b/docs/installconfigure/Install_Docker.rst
@@ -3,7 +3,7 @@
.. Copyright 2018 Huawei Technologies Co., Ltd.
Install Docker
-===============
+==============
Make sure curl is installed on the Ubuntu VM:
@@ -58,7 +58,7 @@ If you are behind a corporate firewall, you will need to configure proxy setting
Restart docker:
.. code-block:: bash
-
+
sudo systemctl daemon-reload
sudo systemctl restart docker
@@ -82,4 +82,4 @@ Verify that you can download and run the hello-world container
docker run hello-world
-.. image:: images/Docker_install_1.png \ No newline at end of file
+.. image:: ../images/Docker_install_1.png \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ContactCamundaException.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ContactCamundaException.java
index 6b38eec4ae..d5fc01781e 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ContactCamundaException.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ContactCamundaException.java
@@ -23,7 +23,7 @@ package org.onap.so.apihandlerinfra.exceptions;
public class ContactCamundaException extends ApiException {
private static final String contactCamundaErrorMessage =
- "Unable to get process-instance history from Camunda for requestId: %s due to error: %s";
+ "Unable to get %s history from Camunda for requestId: %s due to error: %s";
private ContactCamundaException(Builder builder) {
super(builder);
@@ -32,9 +32,9 @@ public class ContactCamundaException extends ApiException {
public static class Builder extends ApiException.Builder<Builder> {
- public Builder(String requestId, String error, int httpResponseCode, String messageID) {
- super(contactCamundaErrorMessage.format(contactCamundaErrorMessage, requestId, error), httpResponseCode,
- messageID);
+ public Builder(String query, String requestId, String error, int httpResponseCode, String messageID) {
+ super(contactCamundaErrorMessage.format(contactCamundaErrorMessage, query, requestId, error),
+ httpResponseCode, messageID);
}
public ContactCamundaException build() {
diff --git a/mso-api-handlers/mso-api-handler-infra/pom.xml b/mso-api-handlers/mso-api-handler-infra/pom.xml
index dc665a9446..a3b9827d9f 100644
--- a/mso-api-handlers/mso-api-handler-infra/pom.xml
+++ b/mso-api-handlers/mso-api-handler-infra/pom.xml
@@ -88,6 +88,10 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.springframework.retry</groupId>
+ <artifactId>spring-retry</artifactId>
+ </dependency>
+ <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java
new file mode 100644
index 0000000000..451fa64585
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/CamundaRequestHandler.java
@@ -0,0 +1,180 @@
+package org.onap.so.apihandlerinfra;
+
+import java.security.GeneralSecurityException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.DatatypeConverter;
+import org.apache.http.HttpStatus;
+import org.camunda.bpm.engine.impl.persistence.entity.HistoricActivityInstanceEntity;
+import org.camunda.bpm.engine.impl.persistence.entity.HistoricProcessInstanceEntity;
+import org.onap.so.apihandler.common.ErrorNumbers;
+import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException;
+import org.onap.so.utils.CryptoUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.env.Environment;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.retry.policy.SimpleRetryPolicy;
+import org.springframework.retry.support.RetryTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.ResourceAccessException;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.RestTemplate;
+
+@Component
+public class CamundaRequestHandler {
+
+ private static Logger logger = LoggerFactory.getLogger(CamundaRequestHandler.class);
+
+ @Autowired
+ private RestTemplate restTemplate;
+
+ @Autowired
+ private Environment env;
+
+ public ResponseEntity<List<HistoricProcessInstanceEntity>> getCamundaProcessInstanceHistory(String requestId) {
+ RetryTemplate retryTemplate = setRetryTemplate();
+ String path = env.getProperty("mso.camunda.rest.history.uri") + requestId;
+ String targetUrl = env.getProperty("mso.camundaURL") + path;
+ HttpHeaders headers =
+ setCamundaHeaders(env.getRequiredProperty("mso.camundaAuth"), env.getRequiredProperty("mso.msoKey"));
+
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+
+ return retryTemplate.execute(context -> {
+ if (context.getLastThrowable() != null) {
+ logger.error("Retrying: Last call resulted in exception: ", context.getLastThrowable());
+ }
+ if (context.getRetryCount() == 0) {
+ logger.info("Querying Camunda for process-instance history for requestId: {}", requestId);
+ } else {
+ logger.info("Retry: {} of 3. Querying Camunda for process-instance history for requestId: {}",
+ context.getRetryCount(), requestId);
+ }
+ return restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ });
+ }
+
+ protected ResponseEntity<List<HistoricActivityInstanceEntity>> getCamundaActivityHistory(String processInstanceId,
+ String requestId) throws ContactCamundaException {
+ RetryTemplate retryTemplate = setRetryTemplate();
+ String path = env.getProperty("mso.camunda.rest.activity.uri") + processInstanceId;
+ String targetUrl = env.getProperty("mso.camundaURL") + path;
+ HttpHeaders headers =
+ setCamundaHeaders(env.getRequiredProperty("mso.camundaAuth"), env.getRequiredProperty("mso.msoKey"));
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ try {
+ return retryTemplate.execute(context -> {
+ if (context.getLastThrowable() != null) {
+ logger.error("Retrying: Last call resulted in exception: ", context.getLastThrowable());
+ }
+ if (context.getRetryCount() == 0) {
+ logger.info(
+ "Querying Camunda for activity-instance history for processInstanceId: {}, for requestId: {}",
+ processInstanceId, requestId);
+ } else {
+ logger.info(
+ "Retry: {} of 3. Querying Camunda for activity-instance history for processInstanceId: {}, for requestId: {}",
+ context.getRetryCount(), processInstanceId, requestId);
+ }
+
+ return restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
+ });
+
+ } catch (RestClientException e) {
+ logger.error(
+ "Error querying Camunda for activity-instance history for processInstanceId: {}, for requestId: {}, exception: {}",
+ processInstanceId, requestId, e.getMessage());
+ throw new ContactCamundaException.Builder("activity-instance", requestId, e.toString(),
+ HttpStatus.SC_INTERNAL_SERVER_ERROR, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e).build();
+ }
+ }
+
+ protected String getTaskName(String requestId) throws ContactCamundaException {
+ ResponseEntity<List<HistoricProcessInstanceEntity>> response = null;
+ ResponseEntity<List<HistoricActivityInstanceEntity>> activityResponse = null;
+ String processInstanceId = null;
+ try {
+ response = getCamundaProcessInstanceHistory(requestId);
+ } catch (RestClientException e) {
+ logger.error("Error querying Camunda for process-instance history for requestId: {}, exception: {}",
+ requestId, e.getMessage());
+ throw new ContactCamundaException.Builder("process-instance", requestId, e.toString(),
+ HttpStatus.SC_INTERNAL_SERVER_ERROR, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e).build();
+ }
+
+ List<HistoricProcessInstanceEntity> historicProcessInstanceList = response.getBody();
+
+ if (historicProcessInstanceList != null) {
+ Collections.reverse(historicProcessInstanceList);
+ processInstanceId = historicProcessInstanceList.get(0).getId();
+ } else {
+ return "No processInstances returned for requestId: " + requestId;
+ }
+
+ if (processInstanceId != null) {
+ activityResponse = getCamundaActivityHistory(processInstanceId, requestId);
+ } else {
+ return "No processInstanceId returned for requestId: " + requestId;
+ }
+
+ return getActivityName(activityResponse.getBody());
+ }
+
+ protected String getActivityName(List<HistoricActivityInstanceEntity> activityInstanceList) {
+ String activityName = null;
+ HistoricActivityInstanceEntity activityInstance = null;
+ String result = null;
+
+ if (activityInstanceList == null || activityInstanceList.isEmpty()) {
+ result = "No results returned on activityInstance history lookup.";
+ } else {
+ activityInstance = activityInstanceList.get(0);
+ activityName = activityInstance.getActivityName();
+
+ if (activityName == null) {
+ result = "Task name is null.";
+ } else {
+ result = "Last task executed: " + activityName;
+ }
+ }
+
+ return result;
+ }
+
+ protected HttpHeaders setCamundaHeaders(String auth, String msoKey) {
+ HttpHeaders headers = new HttpHeaders();
+ List<org.springframework.http.MediaType> acceptableMediaTypes = new ArrayList<>();
+ acceptableMediaTypes.add(org.springframework.http.MediaType.APPLICATION_JSON);
+ headers.setAccept(acceptableMediaTypes);
+ try {
+ String userCredentials = CryptoUtils.decrypt(auth, msoKey);
+ if (userCredentials != null) {
+ headers.add(HttpHeaders.AUTHORIZATION,
+ "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes()));
+ }
+ } catch (GeneralSecurityException e) {
+ logger.error("Security exception", e);
+ }
+ return headers;
+ }
+
+ protected RetryTemplate setRetryTemplate() {
+ RetryTemplate retryTemplate = new RetryTemplate();
+ Map<Class<? extends Throwable>, Boolean> retryableExceptions = new HashMap<>();
+ retryableExceptions.put(ResourceAccessException.class, true);
+ SimpleRetryPolicy policy = new SimpleRetryPolicy(4, retryableExceptions);
+ retryTemplate.setRetryPolicy(policy);
+ return retryTemplate;
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
index fdc51ffe24..d3a279fd8e 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/E2EServiceInstances.java
@@ -92,6 +92,8 @@ public class E2EServiceInstances {
private static final String END_OF_THE_TRANSACTION = "End of the transaction, the final response is: ";
+ private static final String SERVICE_ID = "serviceId";
+
@Autowired
private MsoRequest msoRequest;
@@ -138,9 +140,9 @@ public class E2EServiceInstances {
public Response updateE2EServiceInstance(String request, @PathParam("version") String version,
@PathParam("serviceId") String serviceId) throws ApiException {
- instanceIdMap.put("serviceId", serviceId);
+ instanceIdMap.put(SERVICE_ID, serviceId);
- return updateE2EserviceInstances(request, Action.updateInstance, instanceIdMap, version);
+ return updateE2EserviceInstances(request, Action.updateInstance, version);
}
/**
@@ -155,9 +157,9 @@ public class E2EServiceInstances {
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Delete E2E Service Instance on a specified version and serviceId", response = Response.class)
public Response deleteE2EServiceInstance(String request, @PathParam("version") String version,
- @PathParam("serviceId") String serviceId) throws ApiException {
+ @PathParam(SERVICE_ID) String serviceId) throws ApiException {
- instanceIdMap.put("serviceId", serviceId);
+ instanceIdMap.put(SERVICE_ID, serviceId);
return deleteE2EserviceInstances(request, Action.deleteInstance, instanceIdMap, version);
}
@@ -167,7 +169,7 @@ public class E2EServiceInstances {
@ApiOperation(value = "Find e2eServiceInstances Requests for a given serviceId and operationId",
response = Response.class)
@Produces(MediaType.APPLICATION_JSON)
- public Response getE2EServiceInstances(@PathParam("serviceId") String serviceId,
+ public Response getE2EServiceInstances(@PathParam(SERVICE_ID) String serviceId,
@PathParam("version") String version, @PathParam("operationId") String operationId) {
return getE2EServiceInstance(serviceId, operationId, version);
}
@@ -184,11 +186,11 @@ public class E2EServiceInstances {
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Scale E2E Service Instance on a specified version", response = Response.class)
public Response scaleE2EServiceInstance(String request, @PathParam("version") String version,
- @PathParam("serviceId") String serviceId) throws ApiException {
+ @PathParam(SERVICE_ID) String serviceId) throws ApiException {
logger.debug("------------------scale begin------------------");
- instanceIdMap.put("serviceId", serviceId);
- return scaleE2EserviceInstances(request, Action.scaleInstance, instanceIdMap, version);
+ instanceIdMap.put(SERVICE_ID, serviceId);
+ return scaleE2EserviceInstances(request, Action.scaleInstance, version);
}
/**
@@ -207,7 +209,7 @@ public class E2EServiceInstances {
public Response compareModelwithTargetVersion(String request, @PathParam("serviceId") String serviceId,
@PathParam("version") String version) throws ApiException {
- instanceIdMap.put("serviceId", serviceId);
+ instanceIdMap.put(SERVICE_ID, serviceId);
return compareModelwithTargetVersion(request, Action.compareModel, instanceIdMap, version);
}
@@ -216,7 +218,6 @@ public class E2EServiceInstances {
HashMap<String, String> instanceIdMap, String version) throws ApiException {
String requestId = UUID.randomUUID().toString();
- long startTime = System.currentTimeMillis();
CompareModelsRequest e2eCompareModelReq;
@@ -237,12 +238,12 @@ public class E2EServiceInstances {
return response;
}
- return runCompareModelBPMWorkflow(e2eCompareModelReq, requestJSON, requestId, startTime, action, version);
+ return runCompareModelBPMWorkflow(e2eCompareModelReq, requestJSON, requestId, action, version);
}
private Response runCompareModelBPMWorkflow(CompareModelsRequest e2eCompareModelReq, String requestJSON,
- String requestId, long startTime, Action action, String version) throws ApiException {
+ String requestId, Action action, String version) throws ApiException {
// Define RecipeLookupResult info here instead of query DB for efficiency
String workflowUrl = "/mso/async/services/CompareModelofE2EServiceInstance";
@@ -251,8 +252,6 @@ public class E2EServiceInstances {
RequestClient requestClient;
HttpResponse response;
- long subStartTime = System.currentTimeMillis();
-
try {
requestClient = requestClientFactory.getRequestClient(workflowUrl);
@@ -261,7 +260,7 @@ public class E2EServiceInstances {
// Capture audit event
logger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
- String serviceId = instanceIdMap.get("serviceId");
+ String serviceId = instanceIdMap.get(SERVICE_ID);
String serviceType = e2eCompareModelReq.getServiceType();
RequestClientParameter postParam = new RequestClientParameter.Builder().setRequestId(requestId)
.setBaseVfModule(false).setRecipeTimeout(recipeTimeout).setRequestAction(action.name())
@@ -291,8 +290,7 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
- version);
+ return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
}
private Response getE2EServiceInstance(String serviceId, String operationId, String version) {
@@ -301,8 +299,6 @@ public class E2EServiceInstances {
String apiVersion = version.substring(1);
- long startTime = System.currentTimeMillis();
-
OperationStatus operationStatus;
try {
@@ -339,7 +335,6 @@ public class E2EServiceInstances {
private Response deleteE2EserviceInstances(String requestJSON, Action action, HashMap<String, String> instanceIdMap,
String version) throws ApiException {
// TODO should be a new one or the same service instance Id
- long startTime = System.currentTimeMillis();
E2EServiceInstanceDeleteRequest e2eDelReq;
ObjectMapper mapper = new ObjectMapper();
@@ -392,7 +387,6 @@ public class E2EServiceInstances {
RequestClient requestClient;
HttpResponse response;
- long subStartTime = System.currentTimeMillis();
try {
requestClient = requestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI());
@@ -403,7 +397,7 @@ public class E2EServiceInstances {
// Capture audit event
logger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
- String serviceId = instanceIdMap.get("serviceId");
+ String serviceId = instanceIdMap.get(SERVICE_ID);
String serviceInstanceType = e2eDelReq.getServiceType();
RequestClientParameter clientParam = new RequestClientParameter.Builder().setRequestId(requestId)
.setBaseVfModule(false).setRecipeTimeout(recipeLookupResult.getRecipeTimeout())
@@ -436,17 +430,14 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
- version);
+ return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
}
- private Response updateE2EserviceInstances(String requestJSON, Action action, HashMap<String, String> instanceIdMap,
- String version) throws ApiException {
+ private Response updateE2EserviceInstances(String requestJSON, Action action, String version) throws ApiException {
String requestId = UUID.randomUUID().toString();
- long startTime = System.currentTimeMillis();
E2EServiceInstanceRequest e2eSir;
- String serviceId = instanceIdMap.get("serviceId");
+ String serviceId = instanceIdMap.get(SERVICE_ID);
ObjectMapper mapper = new ObjectMapper();
try {
@@ -513,7 +504,6 @@ public class E2EServiceInstances {
RequestClient requestClient;
HttpResponse response;
- long subStartTime = System.currentTimeMillis();
String sirRequestJson = convertToString(sir);
try {
@@ -554,15 +544,13 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(serviceId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
- version);
+ return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
}
private Response processE2EserviceInstances(String requestJSON, Action action,
HashMap<String, String> instanceIdMap, String version) throws ApiException {
String requestId = UUID.randomUUID().toString();
- long startTime = System.currentTimeMillis();
E2EServiceInstanceRequest e2eSir;
MsoRequest msoRequest = new MsoRequest();
@@ -625,11 +613,10 @@ public class E2EServiceInstances {
String serviceInstanceType = e2eSir.getService().getServiceType();
- String serviceId = "";
+ String serviceId = e2eSir.getService().getServiceId();
RequestClient requestClient;
HttpResponse response;
- long subStartTime = System.currentTimeMillis();
String sirRequestJson = convertToString(sir);
try {
@@ -668,15 +655,12 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
- version);
+ return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
}
- private Response scaleE2EserviceInstances(String requestJSON, Action action, HashMap<String, String> instanceIdMap,
- String version) throws ApiException {
+ private Response scaleE2EserviceInstances(String requestJSON, Action action, String version) throws ApiException {
String requestId = UUID.randomUUID().toString();
- long startTime = System.currentTimeMillis();
E2EServiceInstanceScaleRequest e2eScaleReq;
ObjectMapper mapper = new ObjectMapper();
@@ -728,7 +712,6 @@ public class E2EServiceInstances {
RequestClient requestClient;
HttpResponse response;
- long subStartTime = System.currentTimeMillis();
try {
requestClient = requestClientFactory.getRequestClient(recipeLookupResult.getOrchestrationURI());
@@ -739,7 +722,7 @@ public class E2EServiceInstances {
// Capture audit event
logger.debug("MSO API Handler Posting call to BPEL engine for url: " + requestClient.getUrl());
- String serviceId = instanceIdMap.get("serviceId");
+ String serviceId = instanceIdMap.get(SERVICE_ID);
String serviceInstanceType = e2eScaleReq.getService().getServiceType();
RequestClientParameter postParam = new RequestClientParameter.Builder().setRequestId(requestId)
.setBaseVfModule(false).setRecipeTimeout(recipeLookupResult.getRecipeTimeout())
@@ -772,12 +755,10 @@ public class E2EServiceInstances {
ResponseHandler respHandler = new ResponseHandler(response, requestClient.getType());
int bpelStatus = respHandler.getStatus();
- return beplStatusUpdate(requestId, startTime, requestClient, respHandler, bpelStatus, action, instanceIdMap,
- version);
+ return beplStatusUpdate(requestClient, respHandler, bpelStatus, version);
}
- private Response beplStatusUpdate(String serviceId, long startTime, RequestClient requestClient,
- ResponseHandler respHandler, int bpelStatus, Action action, HashMap<String, String> instanceIdMap,
+ private Response beplStatusUpdate(RequestClient requestClient, ResponseHandler respHandler, int bpelStatus,
String version) {
String apiVersion = version.substring(1);
@@ -876,7 +857,6 @@ public class E2EServiceInstances {
ServiceInstancesRequest sir = new ServiceInstancesRequest();
- String returnString = null;
RequestDetails requestDetails = new RequestDetails();
ModelInfo modelInfo = new ModelInfo();
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
index d8a7cb3f5d..ade13e7b57 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java
@@ -105,13 +105,9 @@ public class InstanceManagement {
private Response processCustomWorkflowRequest(String requestJSON, Actions action,
HashMap<String, String> instanceIdMap, String version, String requestId,
ContainerRequestContext requestContext) throws ApiException {
- String serviceInstanceId = null;
- if (instanceIdMap != null) {
- serviceInstanceId = instanceIdMap.get("serviceInstanceId");
- }
+ String serviceInstanceId;
Boolean aLaCarte = true;
- long startTime = System.currentTimeMillis();
- ServiceInstancesRequest sir = null;
+ ServiceInstancesRequest sir;
String apiVersion = version.substring(1);
String requestUri = requestHandlerUtils.getRequestUri(requestContext, uriPrefix);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java
index 113baf96e6..b9b7fcc0d4 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ManualTasks.java
@@ -50,8 +50,6 @@ import org.onap.so.apihandlerinfra.tasksbeans.TaskRequestReference;
import org.onap.so.apihandlerinfra.tasksbeans.TasksRequest;
import org.onap.so.apihandlerinfra.tasksbeans.Value;
import org.onap.so.apihandlerinfra.tasksbeans.Variables;
-import org.onap.so.constants.Status;
-import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.exceptions.ValidationException;
import org.onap.so.logger.ErrorCode;
import org.onap.so.logger.MessageEnum;
@@ -94,7 +92,6 @@ public class ManualTasks {
String requestId = requestContext.getProperty("requestId").toString();
logger.info(LoggingAnchor.TWO, MessageEnum.APIH_GENERATED_REQUEST_ID.toString(), requestId);
- long startTime = System.currentTimeMillis();
logger.debug("requestId is: {}", requestId);
TasksRequest taskRequest = null;
String apiVersion = version.substring(1);
@@ -141,9 +138,6 @@ public class ManualTasks {
throw validateException;
}
- // Create Request Record
- InfraActiveRequests currentActiveReq =
- msoRequest.createRequestObject(taskRequest, Action.completeTask, requestId, Status.PENDING, request);
// Transform the request to Camunda-style Complete request
Variables variablesForComplete = new Variables();
@@ -157,7 +151,7 @@ public class ManualTasks {
variablesForComplete.setResponseValue(responseValue);
variablesForComplete.setRequestorId(requestorIdValue);
- String camundaJsonReq = null;
+ String camundaJsonReq;
try {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
@@ -176,9 +170,8 @@ public class ManualTasks {
throw validateException;
}
- RequestClient requestClient = null;
- HttpResponse response = null;
- long subStartTime = System.currentTimeMillis();
+ RequestClient requestClient;
+ HttpResponse response;
String requestUrl = taskUri + "/" + taskId + "/complete";
try {
requestClient = reqClientFactory.getRequestClient(requestUrl);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java
index ba69355d5e..6f36fb2aff 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java
@@ -46,6 +46,7 @@ import org.apache.http.HttpStatus;
import org.onap.so.apihandler.common.ErrorNumbers;
import org.onap.so.apihandler.common.ResponseBuilder;
import org.onap.so.apihandlerinfra.exceptions.ApiException;
+import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException;
import org.onap.so.apihandlerinfra.exceptions.ValidateException;
import org.onap.so.apihandlerinfra.logging.ErrorLoggerInfo;
import org.onap.so.constants.OrchestrationRequestFormat;
@@ -91,6 +92,9 @@ public class OrchestrationRequests {
@Autowired
private ResponseBuilder builder;
+ @Autowired
+ private CamundaRequestHandler camundaRequestHandler;
+
@GET
@Path("/{version:[vV][4-7]}/{requestId}")
@ApiOperation(value = "Find Orchestrated Requests for a given requestId", response = Response.class)
@@ -165,13 +169,11 @@ public class OrchestrationRequests {
@QueryParam("includeCloudRequest") boolean includeCloudRequest, @QueryParam(value = "format") String format)
throws ApiException {
- long startTime = System.currentTimeMillis();
-
MultivaluedMap<String, String> queryParams = ui.getQueryParameters();
- List<InfraActiveRequests> activeRequests = null;
+ List<InfraActiveRequests> activeRequests;
- GetOrchestrationListResponse orchestrationList = null;
+ GetOrchestrationListResponse orchestrationList;
Map<String, List<String>> orchestrationMap;
String apiVersion = version.substring(1);
@@ -222,12 +224,10 @@ public class OrchestrationRequests {
public Response unlockOrchestrationRequest(String requestJSON, @PathParam("requestId") String requestId,
@PathParam("version") String version) throws ApiException {
- long startTime = System.currentTimeMillis();
logger.debug("requestId is: {}", requestId);
- ServiceInstancesRequest sir = null;
+ ServiceInstancesRequest sir;
- InfraActiveRequests infraActiveRequest = null;
- Request request = null;
+ InfraActiveRequests infraActiveRequest;
try {
ObjectMapper mapper = new ObjectMapper();
@@ -428,10 +428,19 @@ public class OrchestrationRequests {
}
protected void mapRequestStatusAndExtSysErrSrcToRequest(InfraActiveRequests iar, RequestStatus status,
- String format) {
+ String format) throws ContactCamundaException {
String rollbackStatusMessage = iar.getRollbackStatusMessage();
String flowStatusMessage = iar.getFlowStatus();
String retryStatusMessage = iar.getRetryStatusMessage();
+ String taskName = null;
+
+ if (flowStatusMessage != null && !flowStatusMessage.equals("Successfully completed all Building Blocks")
+ && !flowStatusMessage.equals("All Rollback flows have completed successfully")) {
+ taskName = camundaRequestHandler.getTaskName(iar.getRequestId());
+ if (taskName != null) {
+ flowStatusMessage = flowStatusMessage + " TASK INFORMATION: " + taskName;
+ }
+ }
String statusMessages = null;
if (iar.getStatusMessage() != null) {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
index c3f323459c..9ab95a2319 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/RequestHandlerUtils.java
@@ -27,7 +27,6 @@ package org.onap.so.apihandlerinfra;
import static org.onap.so.logger.HttpHeadersConstants.REQUESTOR_ID;
import java.io.IOException;
import java.net.URL;
-import java.security.GeneralSecurityException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
@@ -37,7 +36,6 @@ import java.util.Optional;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
-import javax.xml.bind.DatatypeConverter;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
@@ -78,21 +76,16 @@ import org.onap.so.serviceinstancebeans.RelatedInstanceList;
import org.onap.so.serviceinstancebeans.RequestParameters;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
-import org.onap.so.utils.CryptoUtils;
import org.onap.so.utils.UUIDChecker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.env.Environment;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.HttpStatusCodeException;
-import org.springframework.web.client.RestTemplate;
+import org.springframework.web.client.RestClientException;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -119,7 +112,7 @@ public class RequestHandlerUtils extends AbstractRestHandler {
private MsoRequest msoRequest;
@Autowired
- private RestTemplate restTemplate;
+ private CamundaRequestHandler camundaRequestHandler;
@Autowired
private CatalogDbClient catalogDbClient;
@@ -323,25 +316,20 @@ public class RequestHandlerUtils extends AbstractRestHandler {
public boolean camundaHistoryCheck(InfraActiveRequests duplicateRecord, InfraActiveRequests currentActiveReq)
throws RequestDbFailureException, ContactCamundaException {
String requestId = duplicateRecord.getRequestId();
- String path = env.getProperty("mso.camunda.rest.history.uri") + requestId;
- String targetUrl = env.getProperty("mso.camundaURL") + path;
- HttpHeaders headers =
- setCamundaHeaders(env.getRequiredProperty("mso.camundaAuth"), env.getRequiredProperty("mso.msoKey"));
- HttpEntity<?> requestEntity = new HttpEntity<>(headers);
ResponseEntity<List<HistoricProcessInstanceEntity>> response = null;
try {
- response = restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity,
- new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
- } catch (HttpStatusCodeException e) {
- ErrorLoggerInfo errorLoggerInfo =
- new ErrorLoggerInfo.Builder(MessageEnum.APIH_DUPLICATE_CHECK_EXC, ErrorCode.DataError)
- .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build();
+ response = camundaRequestHandler.getCamundaProcessInstanceHistory(requestId);
+ } catch (RestClientException e) {
+ logger.error("Error querying Camunda for process-instance history for requestId: {}, exception: {}",
+ requestId, e.getMessage());
ContactCamundaException contactCamundaException =
- new ContactCamundaException.Builder(requestId, e.toString(), HttpStatus.SC_INTERNAL_SERVER_ERROR,
- ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e).errorInfo(errorLoggerInfo).build();
+ new ContactCamundaException.Builder("process-instance", requestId, e.toString(),
+ HttpStatus.SC_INTERNAL_SERVER_ERROR, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(e)
+ .build();
updateStatus(currentActiveReq, Status.FAILED, contactCamundaException.getMessage());
throw contactCamundaException;
}
+
if (response.getBody().isEmpty()) {
updateStatus(duplicateRecord, Status.COMPLETE, "Request Completed");
}
@@ -355,23 +343,6 @@ public class RequestHandlerUtils extends AbstractRestHandler {
return false;
}
- protected HttpHeaders setCamundaHeaders(String auth, String msoKey) {
- HttpHeaders headers = new HttpHeaders();
- List<org.springframework.http.MediaType> acceptableMediaTypes = new ArrayList<>();
- acceptableMediaTypes.add(org.springframework.http.MediaType.APPLICATION_JSON);
- headers.setAccept(acceptableMediaTypes);
- try {
- String userCredentials = CryptoUtils.decrypt(auth, msoKey);
- if (userCredentials != null) {
- headers.add(HttpHeaders.AUTHORIZATION,
- "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes()));
- }
- } catch (GeneralSecurityException e) {
- logger.error("Security exception", e);
- }
- return headers;
- }
-
public ServiceInstancesRequest convertJsonToServiceInstanceRequest(String requestJSON, Actions action,
String requestId, String requestUri) throws ApiException {
try {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
index bba8064f7c..b57bb5d1d8 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2019 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
@@ -91,13 +93,13 @@ public class WorkflowSpecificationsHandler {
List<Workflow> workflows = catalogDbClient.findWorkflowByModelUUID(vnfModelVersionId);
List<Workflow> nativeWorkflows = catalogDbClient.findWorkflowBySource(NATIVE_WORKFLOW);
- if (nativeWorkflows != null && nativeWorkflows.size() != 0) {
+ if (nativeWorkflows != null && !nativeWorkflows.isEmpty()) {
workflows.addAll(nativeWorkflows);
}
WorkflowSpecifications workflowSpecifications = mapWorkflowsToWorkflowSpecifications(workflows);
- String jsonResponse = null;
+ String jsonResponse;
try {
ObjectMapper mapper = new ObjectMapper();
jsonResponse = mapper.writeValueAsString(workflowSpecifications);
@@ -116,11 +118,11 @@ public class WorkflowSpecificationsHandler {
}
protected WorkflowSpecifications mapWorkflowsToWorkflowSpecifications(List<Workflow> workflows) {
- if (workflows == null || workflows.size() == 0) {
+ if (workflows == null || workflows.isEmpty()) {
return null;
}
WorkflowSpecifications workflowSpecifications = new WorkflowSpecifications();
- List<WorkflowSpecificationList> workflowSpecificationList = new ArrayList<WorkflowSpecificationList>();
+ List<WorkflowSpecificationList> workflowSpecificationList = new ArrayList<>();
for (Workflow workflow : workflows) {
WorkflowSpecificationList workflowSpecificationListItem = new WorkflowSpecificationList();
@@ -153,10 +155,10 @@ public class WorkflowSpecificationsHandler {
private List<ActivitySequence> buildActivitySequence(Workflow workflow) {
List<WorkflowActivitySpecSequence> workflowActivitySpecSequences = workflow.getWorkflowActivitySpecSequence();
- if (workflowActivitySpecSequences == null || workflowActivitySpecSequences.size() == 0) {
+ if (workflowActivitySpecSequences == null || workflowActivitySpecSequences.isEmpty()) {
return null;
}
- List<ActivitySequence> activitySequences = new ArrayList<ActivitySequence>();
+ List<ActivitySequence> activitySequences = new ArrayList<>();
for (WorkflowActivitySpecSequence workflowActivitySpecSequence : workflowActivitySpecSequences) {
if (workflowActivitySpecSequence != null) {
ActivitySpec activitySpec = workflowActivitySpecSequence.getActivitySpec();
@@ -174,17 +176,17 @@ public class WorkflowSpecificationsHandler {
private List<WorkflowInputParameter> buildWorkflowInputParameters(Workflow workflow) {
List<WorkflowActivitySpecSequence> workflowActivitySpecSequences = workflow.getWorkflowActivitySpecSequence();
- if (workflowActivitySpecSequences == null || workflowActivitySpecSequences.size() == 0) {
- return new ArrayList<WorkflowInputParameter>();
+ if (workflowActivitySpecSequences == null || workflowActivitySpecSequences.isEmpty()) {
+ return new ArrayList<>();
}
- Map<String, WorkflowInputParameter> workflowInputParameterMap = new HashMap<String, WorkflowInputParameter>();
+ Map<String, WorkflowInputParameter> workflowInputParameterMap = new HashMap<>();
for (WorkflowActivitySpecSequence workflowActivitySpecSequence : workflowActivitySpecSequences) {
if (workflowActivitySpecSequence != null) {
ActivitySpec activitySpec = workflowActivitySpecSequence.getActivitySpec();
if (activitySpec != null) {
List<ActivitySpecUserParameters> activitySpecUserParameters =
activitySpec.getActivitySpecUserParameters();
- if (activitySpecUserParameters != null && activitySpecUserParameters.size() != 0) {
+ if (activitySpecUserParameters != null && !activitySpecUserParameters.isEmpty()) {
for (ActivitySpecUserParameters activitySpecUserParameter : activitySpecUserParameters) {
UserParameters userParameter = activitySpecUserParameter.getUserParameters();
if (userParameter != null) {
@@ -199,7 +201,7 @@ public class WorkflowSpecificationsHandler {
}
if (workflowInputParameterMap.size() == 0) {
- return new ArrayList<WorkflowInputParameter>();
+ return new ArrayList<>();
}
List<WorkflowInputParameter> workflowInputParameterList =
workflowInputParameterMap.values().stream().collect(Collectors.toList());
@@ -220,7 +222,7 @@ public class WorkflowSpecificationsHandler {
private List<Validation> buildValidationList(UserParameters userParameter) {
List<Validation> validationList = null;
if (userParameter.getMaxLength() != null || userParameter.getAllowableChars() != null) {
- validationList = new ArrayList<Validation>();
+ validationList = new ArrayList<>();
Validation validation = new Validation();
if (userParameter.getMaxLength() != null) {
validation.setMaxLength(userParameter.getMaxLength().toString());
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/e2eserviceinstancebeans/E2EService.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/e2eserviceinstancebeans/E2EService.java
index f969674ed1..d6a99af8cd 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/e2eserviceinstancebeans/E2EService.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/e2eserviceinstancebeans/E2EService.java
@@ -47,6 +47,9 @@ public class E2EService {
@JsonProperty("serviceType")
private String serviceType;
+ @JsonProperty("serviceId")
+ private String serviceId;
+
@JsonProperty("parameters")
private E2EParameters parameters;
@@ -109,6 +112,14 @@ public class E2EService {
this.serviceType = serviceType;
}
+ public String getServiceId() {
+ return serviceId;
+ }
+
+ public void setServiceId(String serviceId) {
+ this.serviceId = serviceId;
+ }
+
public String getServiceUuid() {
return serviceUuid;
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java
index c44f1f0e0a..ec3df21fdb 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Network.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2019 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
@@ -38,8 +40,6 @@ import org.onap.so.db.catalog.beans.Recipe;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -50,8 +50,6 @@ import io.swagger.annotations.ApiOperation;
@Path("/onap/so/infra/serviceInstantiation")
public class Network {
- private static Logger logger = LoggerFactory.getLogger(Network.class);
-
@Autowired
private NetworkRestHandler networkRestHandler;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java
index bf10fcc183..07e8092449 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/ServiceInstance.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2019 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
@@ -38,8 +40,6 @@ import org.onap.so.db.catalog.beans.Recipe;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -50,8 +50,6 @@ import io.swagger.annotations.ApiOperation;
@Path("/onap/so/infra/serviceInstantiation")
public class ServiceInstance {
- private static Logger logger = LoggerFactory.getLogger(ServiceInstance.class);
-
@Autowired
private ServiceInstanceRestHandler requestHandler;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java
index 1a2688f0b3..1b9eb1f802 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/VfModules.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2019 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
@@ -39,8 +41,6 @@ import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.serviceinstancebeans.ModelType;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -51,8 +51,6 @@ import io.swagger.annotations.ApiOperation;
@Path("/onap/so/infra/serviceInstantiation")
public class VfModules {
- private static Logger logger = LoggerFactory.getLogger(VfModules.class);
-
@Autowired
private VFModuleRestHandler restHandler;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java
index b161713a71..a8ccdeecac 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Vnf.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2019 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
@@ -37,8 +39,6 @@ import org.onap.so.db.catalog.beans.Recipe;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -49,8 +49,6 @@ import io.swagger.annotations.ApiOperation;
@Path("/onap/so/infra/serviceInstantiation")
public class Vnf {
- private static Logger logger = LoggerFactory.getLogger(Vnf.class);
-
@Autowired
private BpmnRequestBuilder requestBuilder;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java
index afabdd9c60..d3e394d6d8 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/Volumes.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2019 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
@@ -40,8 +42,6 @@ import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.serviceinstancebeans.ModelType;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
import org.onap.so.serviceinstancebeans.ServiceInstancesResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -52,8 +52,6 @@ import io.swagger.annotations.ApiOperation;
@Path("/onap/so/infra/serviceInstantiation")
public class Volumes {
- private static Logger logger = LoggerFactory.getLogger(Volumes.class);
-
@Autowired
private BpmnRequestBuilder requestBuilder;
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java
index 20e8fed32d..e9cd303c0b 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/CloudResourcesOrchestration.java
@@ -88,9 +88,9 @@ public class CloudResourcesOrchestration {
public Response unlockOrchestrationRequest(String requestJSON, @PathParam("requestId") String requestId,
@PathParam("version") String version) throws ApiException {
TenantIsolationRequest msoRequest = new TenantIsolationRequest(requestId);
- InfraActiveRequests infraActiveRequest = null;
+ InfraActiveRequests infraActiveRequest;
- CloudOrchestrationRequest cor = null;
+ CloudOrchestrationRequest cor;
logger.debug("requestId is: {}", requestId);
@@ -140,8 +140,8 @@ public class CloudResourcesOrchestration {
} else {
String status = infraActiveRequest.getRequestStatus();
- if (status.equalsIgnoreCase("IN_PROGRESS") || status.equalsIgnoreCase("PENDING")
- || status.equalsIgnoreCase("PENDING_MANUAL_TASK")) {
+ if ("IN_PROGRESS".equalsIgnoreCase(status) || "PENDING".equalsIgnoreCase(status)
+ || "PENDING_MANUAL_TASK".equalsIgnoreCase(status)) {
infraActiveRequest.setRequestStatus("UNLOCKED");
infraActiveRequest.setLastModifiedBy(Constants.MODIFIED_BY_APIHANDLER);
infraActiveRequest.setRequestId(requestId);
@@ -181,8 +181,7 @@ public class CloudResourcesOrchestration {
String requestId = requestIdKey.get(0);
CloudOrchestrationResponse cloudOrchestrationGetResponse = new CloudOrchestrationResponse();
- TenantIsolationRequest tenantIsolationRequest = new TenantIsolationRequest(requestId);
- InfraActiveRequests requestDB = null;
+ InfraActiveRequests requestDB;
try {
requestDB = requestDbClient.getInfraActiveRequestbyRequestId(requestId);
@@ -213,8 +212,8 @@ public class CloudResourcesOrchestration {
} else {
TenantIsolationRequest tenantIsolationRequest = new TenantIsolationRequest();
- List<InfraActiveRequests> activeRequests = null;
- CloudOrchestrationRequestList orchestrationList = null;
+ List<InfraActiveRequests> activeRequests;
+ CloudOrchestrationRequestList orchestrationList;
Map<String, String> orchestrationMap;
@@ -233,7 +232,7 @@ public class CloudResourcesOrchestration {
}
activeRequests = requestDbClient.getCloudOrchestrationFiltersFromInfraActive(orchestrationMap);
orchestrationList = new CloudOrchestrationRequestList();
- List<CloudOrchestrationResponse> requestLists = new ArrayList<CloudOrchestrationResponse>();
+ List<CloudOrchestrationResponse> requestLists = new ArrayList<>();
for (InfraActiveRequests infraActive : activeRequests) {
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java
index b2933df030..216588432b 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/ModelDistributionRequest.java
@@ -75,8 +75,7 @@ public class ModelDistributionRequest {
@Transactional
public Response updateModelDistributionStatus(String requestJSON, @PathParam("version") String version,
@PathParam("distributionId") String distributionId) throws ApiException {
- long startTime = System.currentTimeMillis();
- Distribution distributionRequest = null;
+ Distribution distributionRequest;
try {
ObjectMapper mapper = new ObjectMapper();
@@ -146,7 +145,7 @@ public class ModelDistributionRequest {
}
re.setServiceException(se);
- String requestErrorStr = null;
+ String requestErrorStr;
try {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(Include.NON_DEFAULT);
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironment.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironment.java
index fe81a07212..5eb4a67fa6 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironment.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironment.java
@@ -145,7 +145,7 @@ public class CreateVnfOperationalEnvironment {
throws TenantIsolationException {
List<ServiceEndPoint> endpointList = serviceEndPointList.getServiceEndPointList();
logger.debug("Number of service endpoints from GRM: {}", endpointList.size());
- List<ServiceEndPointRequest> serviceEndPointRequestList = new ArrayList<ServiceEndPointRequest>();
+ List<ServiceEndPointRequest> serviceEndPointRequestList = new ArrayList<>();
for (ServiceEndPoint serviceEndpoint : endpointList) {
serviceEndPointRequestList.add(buildServiceEndpoint(serviceEndpoint));
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/resources/application-local.yaml b/mso-api-handlers/mso-api-handler-infra/src/main/resources/application-local.yaml
deleted file mode 100644
index a39d28038c..0000000000
--- a/mso-api-handlers/mso-api-handler-infra/src/main/resources/application-local.yaml
+++ /dev/null
@@ -1,179 +0,0 @@
-# will be used as entry in DB to say SITE OFF/ON for healthcheck
-
-server:
- port: 8080
- tomcat:
- max-threads: 50
-ssl-enable: false
-
-apih-healthcheck-urn: /ecomp/mso/healthcheck,/ecomp/mso/homing/healthcheck,/ecomp/mso/infra/healthcheck,/asdc/healthcheck,/dbadapters/healthcheck,/ecomp/mso/catalog/v2/healthcheck
-jra-healthcheck-urn: /networks/rest/healthcheck,/adapters/rest/healthcheck,/vnfs/rest/healthcheck,/tenants/rest/healthcheck,/appc/rest/healthcheck,/workflows/messages/healthcheck
-camunda-healthcheck-urn: /mso/healthcheck
-
-apih-nodehealthcheck-urn: /ecomp/mso/infra/nodehealthcheck
-jra-nodehealthcheck-urn: /adapters/rest/nodehealthcheck
-camunda-nodehealthcheck-urn: /mso/nodehealthcheck
-
-
-
-mso:
- health:
- endpoints:
- catalogdb: http://localhost:8800
- sdnc: http://localhost:8400
- openstack: http://localhost:8300
- requestdb: http://localhost:8700
- bpmn: http://localhost:8200
- asdc: http://localhost:8400
- requestdbattsvc: http://localhost:8600
-
- adapters:
- requestDb:
- auth: Basic YnBlbDptc28tZGItMTUwNyE=
- endpoint: http://localhost:8081
- logPath: logs
- site-name: mtanj
- catalog:
- db:
- spring:
- endpoint: "http://localhost:8080"
- db:
- auth: Basic YnBlbDptc28tZGItMTUwNyE=
- config:
- path: /src/main/resources/
- infra:
- default:
- alacarte:
- orchestrationUri: /mso/async/services/ALaCarteOrchestrator
- recipeTimeout: 180
- testApi: VNF_API
- service:
- macro:
- default:
- testApi: GR_API
- apih:
- homing:
- sdna:
- url: http://localhost:8089/
- password: 4E0BDC08EE8EDC0572ABBE9FD2D59B62DB725A00B8469E39393D6C86D64284C5D34A57D56F7B58C375316F
- camundaURL: http://localhost:8089/
- camundaAuth: E8E19DD16CC90D2E458E8FF9A884CC0452F8F3EB8E321F96038DE38D5C1B0B02DFAE00B88E2CF6E2A4101AB2C011FC161212EE
- async:
- core-pool-size: 50
- max-pool-size: 50
- queue-capacity: 500
- sdc:
- client:
- auth: 97FF88AB352DA16E00DDD81E3876431DEF8744465DACA489EB3B3BE1F10F63EDA1715E626D0A4827A3E19CD88421BF
- activate:
- instanceid: test
- userid: cs0008
- endpoint: http://localhost:28090
- msoKey: 07a7159d3bf51a0e53be7a8f89699be7
- tenant:
- isolation:
- retry:
- count: 3
- aai:
- endpoint: http://localhost:28090
- auth: 5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C
- grm:
- endpoint: http://localhost:28090
- username: gmruser
- password: test
- so:
- operational-environment:
- dmaap:
- username: testuser
- password: VjR5NDcxSzA=
- host: http://localhost:28090
- publisher:
- topic: com.att.ecomp.mso.operationalEnvironmentEvent
-
-# controls what actions the infra API (APIH) allows sent in on REST request
-vnf:
- v1:
- ApiAllowableActions:
- v2:
- ApiAllowableActions:
- v3:
- ApiAllowableActions:
-
-network:
- v1:
- ApiAllowableActions:
- v2:
- ApiAllowableActions:
- v3:
- ApiAllowableActions:
-
-volume:
- v1:
- ApiAllowableActions:
- v2:
- ApiAllowableActions:
- v3:
- ApiAllowableActions:
-
-# H2
-spring:
- datasource:
- url: jdbc:h2:mem:AZ;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
- username: sa
- password: sa
- driver-class-name: org.h2.Driver
- intialize: true
- h2:
- console:
- enabled: true
- path: /h2
-
- jpa:
- show-sql: true
- hibernate:
- dialect: org.hibernate.dialect.H2Dialect
- ddl-auto: validate
- naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
- enable_lazy_load_no_trans: true
- jersey:
- type: filter
- security:
- usercredentials:
- -
- username: sitecontrol
- password: '$2a$12$VBUF.qBmeK1FNyO2MqTpD.P2M1tvlesZlhCkAjjHvF9hmYNVdMDmu'
- role: SiteControl-Client
- -
- username: gui
- password: '$2a$12$9Y4daXavh.oX5fz6t/e7TuCdj7EKW5B5ibqq425fN3/xpp0/Fhyti'
- role: GUI-Client
- -
- username: infraportal
- password: '$2a$12$IpUEhQijWTNbq0fGYVkA9upZrDvdIK6QfblIaKAiwi0vBQRE.C6Ri'
- role: InfraPortal-Client
- -
- username: bpel
- password: '$2a$12$1xyutEZNfjGewIZRfKaE8eZE99f5sYFUmmM80BobI65KNjmcK0JuO'
- role: BPEL-Client
- -
- username: mso_admin
- password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
- role: ACTUATOR
-request:
- datasource:
- url: jdbc:h2:mem:AZ;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
- username: sa
- password: sa
- driver-class-name: org.h2.Driver
- intialize: true
-
-#Actuator
-management:
- context-path: /manage
-
-org:
- onap:
- so:
- adapters:
- network:
- encryptionKey: aa3871669d893c7fb8abbcda31b88b4f
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/resources/application.yaml b/mso-api-handlers/mso-api-handler-infra/src/main/resources/application.yaml
index 136acfb9e1..93a4ae9489 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/resources/application.yaml
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/resources/application.yaml
@@ -26,6 +26,10 @@ mso:
uri: /sobpmnengine/task
history:
uri: /sobpmnengine/history/process-instance?variables=mso-request-id_eq_
+ activity:
+ uri: /sobpmnengine/history/activity-instance?processInstanceId=
+ camundaURL: http://localhost:8089
+ camundaAuth: E8E19DD16CC90D2E458E8FF9A884CC0452F8F3EB8E321F96038DE38D5C1B0B02DFAE00B88E2CF6E2A4101AB2C011FC161212EE
spring:
datasource:
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerTest.java
new file mode 100644
index 0000000000..e6b5163f59
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/CamundaRequestHandlerTest.java
@@ -0,0 +1,327 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 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.
+ * 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.apihandlerinfra;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import org.camunda.bpm.engine.impl.persistence.entity.HistoricActivityInstanceEntity;
+import org.camunda.bpm.engine.impl.persistence.entity.HistoricProcessInstanceEntity;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.apihandlerinfra.exceptions.ContactCamundaException;
+import org.onap.so.apihandlerinfra.exceptions.RequestDbFailureException;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.env.Environment;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.HttpStatusCodeException;
+import org.springframework.web.client.ResourceAccessException;
+import org.springframework.web.client.RestTemplate;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@RunWith(MockitoJUnitRunner.class)
+public class CamundaRequestHandlerTest {
+
+ @Mock
+ private RestTemplate restTemplate;
+
+ @Mock
+ private Environment env;
+
+ @InjectMocks
+ @Spy
+ private CamundaRequestHandler camundaRequestHandler;
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ private static final String REQUEST_ID = "eca3a1b1-43ab-457e-ab1c-367263d148b4";
+ private ResponseEntity<List<HistoricActivityInstanceEntity>> activityInstanceResponse = null;
+ private ResponseEntity<List<HistoricProcessInstanceEntity>> processInstanceResponse = null;
+ private List<HistoricActivityInstanceEntity> activityInstanceList = null;
+ private List<HistoricProcessInstanceEntity> processInstanceList = null;
+
+
+
+ @Before
+ public void setup() throws IOException {
+ ObjectMapper mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ activityInstanceList = mapper.readValue(
+ new String(Files.readAllBytes(
+ Paths.get("src/test/resources/OrchestrationRequest/ActivityInstanceHistoryResponse.json"))),
+ new TypeReference<List<HistoricActivityInstanceEntity>>() {});
+ processInstanceList = mapper.readValue(
+ new String(Files.readAllBytes(
+ Paths.get("src/test/resources/OrchestrationRequest/ProcessInstanceHistoryResponse.json"))),
+ new TypeReference<List<HistoricProcessInstanceEntity>>() {});
+ processInstanceResponse =
+ new ResponseEntity<List<HistoricProcessInstanceEntity>>(processInstanceList, HttpStatus.ACCEPTED);
+ activityInstanceResponse =
+ new ResponseEntity<List<HistoricActivityInstanceEntity>>(activityInstanceList, HttpStatus.ACCEPTED);
+
+ doReturn("/sobpmnengine/history/process-instance?variables=mso-request-id_eq_").when(env)
+ .getProperty("mso.camunda.rest.history.uri");
+ doReturn("/sobpmnengine/history/activity-instance?processInstanceId=").when(env)
+ .getProperty("mso.camunda.rest.activity.uri");
+ doReturn("auth").when(env).getRequiredProperty("mso.camundaAuth");
+ doReturn("key").when(env).getRequiredProperty("mso.msoKey");
+ doReturn("http://localhost:8089").when(env).getProperty("mso.camundaURL");
+ }
+
+ public HttpHeaders setHeaders() {
+ HttpHeaders headers = new HttpHeaders();
+ List<org.springframework.http.MediaType> acceptableMediaTypes = new ArrayList<>();
+ acceptableMediaTypes.add(org.springframework.http.MediaType.APPLICATION_JSON);
+ headers.setAccept(acceptableMediaTypes);
+ headers.add(HttpHeaders.AUTHORIZATION, "auth");
+
+ return headers;
+ }
+
+ @Test
+ public void getActivityNameTest() throws IOException {
+ String expectedActivityName = "Last task executed: BB to Execute";
+ String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
+
+ assertEquals(expectedActivityName, actualActivityName);
+ }
+
+ @Test
+ public void getActivityNameNullActivityNameTest() throws IOException {
+ String expectedActivityName = "Task name is null.";
+ HistoricActivityInstanceEntity activityInstance = new HistoricActivityInstanceEntity();
+ List<HistoricActivityInstanceEntity> activityInstanceList = new ArrayList<>();
+ activityInstanceList.add(activityInstance);
+
+ String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
+
+ assertEquals(expectedActivityName, actualActivityName);
+ }
+
+ @Test
+ public void getActivityNameNullListTest() throws IOException {
+ String expectedActivityName = "No results returned on activityInstance history lookup.";
+ List<HistoricActivityInstanceEntity> activityInstanceList = null;
+ String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
+
+ assertEquals(expectedActivityName, actualActivityName);
+ }
+
+ @Test
+ public void getActivityNameEmptyListTest() throws IOException {
+ String expectedActivityName = "No results returned on activityInstance history lookup.";
+ List<HistoricActivityInstanceEntity> activityInstanceList = new ArrayList<>();
+ String actualActivityName = camundaRequestHandler.getActivityName(activityInstanceList);
+
+ assertEquals(expectedActivityName, actualActivityName);
+ }
+
+ @Test
+ public void getTaskNameTest() throws IOException, ContactCamundaException {
+ doReturn(processInstanceResponse).when(camundaRequestHandler).getCamundaProcessInstanceHistory(REQUEST_ID);
+ doReturn(activityInstanceResponse).when(camundaRequestHandler)
+ .getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b", REQUEST_ID);
+ doReturn("Last task executed: BB to Execute").when(camundaRequestHandler).getActivityName(activityInstanceList);
+ String expectedTaskName = "Last task executed: BB to Execute";
+
+ String actualTaskName = camundaRequestHandler.getTaskName(REQUEST_ID);
+
+ assertEquals(expectedTaskName, actualTaskName);
+ }
+
+ @Test
+ public void getTaskNameNullProcessInstanceListTest() throws IOException, ContactCamundaException {
+ ResponseEntity<List<HistoricProcessInstanceEntity>> response = new ResponseEntity<>(null, HttpStatus.OK);
+ doReturn(response).when(camundaRequestHandler).getCamundaProcessInstanceHistory(REQUEST_ID);
+ String expected = "No processInstances returned for requestId: " + REQUEST_ID;
+
+ String actual = camundaRequestHandler.getTaskName(REQUEST_ID);
+
+ assertEquals(expected, actual);
+ }
+
+ @Test
+ public void getTaskNameNullProcessInstanceIdTest() throws IOException, ContactCamundaException {
+ HistoricProcessInstanceEntity processInstance = new HistoricProcessInstanceEntity();
+ List<HistoricProcessInstanceEntity> processInstanceList = new ArrayList<>();
+ processInstanceList.add(processInstance);
+ ResponseEntity<List<HistoricProcessInstanceEntity>> response =
+ new ResponseEntity<>(processInstanceList, HttpStatus.OK);
+ doReturn(response).when(camundaRequestHandler).getCamundaProcessInstanceHistory(REQUEST_ID);
+ String expected = "No processInstanceId returned for requestId: " + REQUEST_ID;
+
+ String actual = camundaRequestHandler.getTaskName(REQUEST_ID);
+
+ assertEquals(expected, actual);
+ }
+
+ @Test
+ public void getTaskNameProcessInstanceLookupFailureTest() throws IOException, ContactCamundaException {
+ doThrow(HttpClientErrorException.class).when(camundaRequestHandler)
+ .getCamundaProcessInstanceHistory(REQUEST_ID);
+
+ thrown.expect(ContactCamundaException.class);
+ camundaRequestHandler.getTaskName(REQUEST_ID);
+ }
+
+ @Test
+ public void getCamundaActivityHistoryTest() throws IOException, ContactCamundaException {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl = "http://localhost:8089/sobpmnengine/history/activity-instance?processInstanceId="
+ + "c4c6b647-a26e-11e9-b144-0242ac14000b";
+ doReturn(activityInstanceResponse).when(restTemplate).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+ ResponseEntity<List<HistoricActivityInstanceEntity>> actualResponse =
+ camundaRequestHandler.getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b", REQUEST_ID);
+ assertEquals(activityInstanceResponse, actualResponse);
+ }
+
+ @Test
+ public void getCamundaActivityHistoryErrorTest() {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl = "http://localhost:8089/sobpmnengine/history/activity-instance?processInstanceId="
+ + "c4c6b647-a26e-11e9-b144-0242ac14000b";
+ doThrow(new ResourceAccessException("IOException")).when(restTemplate).exchange(targetUrl, HttpMethod.GET,
+ requestEntity, new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+
+ try {
+ camundaRequestHandler.getCamundaActivityHistory("c4c6b647-a26e-11e9-b144-0242ac14000b", REQUEST_ID);
+ } catch (ContactCamundaException e) {
+ // Exception thrown after retries are completed
+ }
+
+ verify(restTemplate, times(4)).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricActivityInstanceEntity>>() {});
+ }
+
+ @Test
+ public void getCamundaProccesInstanceHistoryTest() throws IOException, ContactCamundaException {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl =
+ "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
+ doReturn(processInstanceResponse).when(restTemplate).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+
+ ResponseEntity<List<HistoricProcessInstanceEntity>> actualResponse =
+ camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID);
+ assertEquals(processInstanceResponse, actualResponse);
+ }
+
+ @Test
+ public void getCamundaProccesInstanceHistoryRetryTest() {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl =
+ "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
+ doThrow(new ResourceAccessException("I/O error")).when(restTemplate).exchange(targetUrl, HttpMethod.GET,
+ requestEntity, new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+
+ try {
+ camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID);
+ } catch (ResourceAccessException e) {
+ // Exception thrown after retries are completed
+ }
+ verify(restTemplate, times(4)).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ }
+
+ @Test
+ public void getCamundaProccesInstanceHistoryNoRetryTest() {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl =
+ "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
+ doThrow(HttpClientErrorException.class).when(restTemplate).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+
+ try {
+ camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID);
+ } catch (HttpStatusCodeException e) {
+ // Exception thrown, no retries
+ }
+ verify(restTemplate, times(1)).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ }
+
+ @Test
+ public void getCamundaProccesInstanceHistoryFailThenSuccessTest() throws IOException, ContactCamundaException {
+ HttpHeaders headers = setHeaders();
+ HttpEntity<?> requestEntity = new HttpEntity<>(headers);
+ String targetUrl =
+ "http://localhost:8089/sobpmnengine/history/process-instance?variables=mso-request-id_eq_" + REQUEST_ID;
+ when(restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {}))
+ .thenThrow(new ResourceAccessException("I/O Exception")).thenReturn(processInstanceResponse);
+ doReturn(headers).when(camundaRequestHandler).setCamundaHeaders("auth", "key");
+
+ ResponseEntity<List<HistoricProcessInstanceEntity>> actualResponse =
+ camundaRequestHandler.getCamundaProcessInstanceHistory(REQUEST_ID);
+ assertEquals(processInstanceResponse, actualResponse);
+ verify(restTemplate, times(2)).exchange(targetUrl, HttpMethod.GET, requestEntity,
+ new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {});
+ }
+
+ @Test
+ public void setCamundaHeadersTest() throws ContactCamundaException, RequestDbFailureException {
+ String encryptedAuth = "015E7ACF706C6BBF85F2079378BDD2896E226E09D13DC2784BA309E27D59AB9FAD3A5E039DF0BB8408"; // user:password
+ String key = "07a7159d3bf51a0e53be7a8f89699be7";
+
+ HttpHeaders headers = camundaRequestHandler.setCamundaHeaders(encryptedAuth, key);
+ List<org.springframework.http.MediaType> acceptedType = headers.getAccept();
+
+ String expectedAcceptedType = "application/json";
+ assertEquals(expectedAcceptedType, acceptedType.get(0).toString());
+ String basicAuth = headers.getFirst(HttpHeaders.AUTHORIZATION);
+ String expectedBasicAuth = "Basic dXNlcjpwYXNzd29yZA==";
+
+ assertEquals(expectedBasicAuth, basicAuth);
+ }
+}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java
index f82f5ac746..12f0ffcc11 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java
@@ -26,6 +26,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;
import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.shazam.shazamcrest.MatcherAssert.assertThat;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
@@ -42,6 +43,7 @@ import java.util.Map;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
+import org.junit.Before;
import org.junit.Test;
import org.onap.so.apihandler.common.ErrorNumbers;
import org.onap.so.db.request.beans.InfraActiveRequests;
@@ -92,6 +94,21 @@ public class OrchestrationRequestsTest extends BaseTest {
return list;
}
+ @Before
+ public void setup() throws IOException {
+ wireMockServer.stubFor(get(urlMatching("/sobpmnengine/history/process-instance.*")).willReturn(aResponse()
+ .withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody(new String(Files.readAllBytes(
+ Paths.get("src/test/resources/OrchestrationRequest/ProcessInstanceHistoryResponse.json"))))
+ .withStatus(org.apache.http.HttpStatus.SC_OK)));
+ wireMockServer.stubFor(
+ get(("/sobpmnengine/history/activity-instance?processInstanceId=c4c6b647-a26e-11e9-b144-0242ac14000b"))
+ .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
+ .withBody(new String(Files.readAllBytes(Paths.get(
+ "src/test/resources/OrchestrationRequest/ActivityInstanceHistoryResponse.json"))))
+ .withStatus(HttpStatus.SC_OK)));
+ }
+
@Test
public void testGetOrchestrationRequest() throws Exception {
setupTestGetOrchestrationRequest();
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java
index fc548a715e..5023155768 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsUnitTest.java
@@ -25,6 +25,7 @@ import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.doReturn;
import javax.ws.rs.core.Response;
import org.apache.commons.lang.StringUtils;
import org.junit.Before;
@@ -55,6 +56,8 @@ public class OrchestrationRequestsUnitTest {
private ResponseBuilder builder;
@Mock
private Response response;
+ @Mock
+ private CamundaRequestHandler camundaRequestHandler;
@Rule
public ExpectedException thrown = ExpectedException.none();
@InjectMocks
@@ -68,6 +71,7 @@ public class OrchestrationRequestsUnitTest {
private static final String FLOW_STATUS = "FlowStatus";
private static final String RETRY_STATUS_MESSAGE = "RetryStatusMessage";
private static final String ROLLBACK_STATUS_MESSAGE = "RollbackStatusMessage";
+ private static final String TASK_INFORMATION = " TASK INFORMATION: Last task executed: Call SDNC";
private InfraActiveRequests iar;
boolean includeCloudRequest = false;
private static final String ROLLBACK_EXT_SYSTEM_ERROR_SOURCE = "SDNC";
@@ -79,14 +83,23 @@ public class OrchestrationRequestsUnitTest {
iar.setRequestScope(SERVICE);
iar.setRequestId(REQUEST_ID);
iar.setServiceInstanceId(SERVICE_INSTANCE_ID);
+ iar.setExtSystemErrorSource(EXT_SYSTEM_ERROR_SOURCE);
+ iar.setRollbackExtSystemErrorSource(ROLLBACK_EXT_SYSTEM_ERROR_SOURCE);
+ iar.setFlowStatus(FLOW_STATUS);
+ iar.setRollbackStatusMessage(ROLLBACK_STATUS_MESSAGE);
+ iar.setRetryStatusMessage(RETRY_STATUS_MESSAGE);
}
@Test
public void mapInfraActiveRequestToRequestWithOriginalRequestIdTest() throws ApiException {
+ doReturn("Last task executed: Call SDNC").when(camundaRequestHandler).getTaskName(REQUEST_ID);
InstanceReferences instanceReferences = new InstanceReferences();
instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
RequestStatus requestStatus = new RequestStatus();
requestStatus.setRequestState(iar.getRequestStatus());
+ requestStatus.setStatusMessage(String.format("FLOW STATUS: %s RETRY STATUS: %s ROLLBACK STATUS: %s",
+ FLOW_STATUS + TASK_INFORMATION, RETRY_STATUS_MESSAGE, ROLLBACK_STATUS_MESSAGE));
+
Request expected = new Request();
expected.setRequestId(REQUEST_ID);
expected.setOriginalRequestId(ORIGINAL_REQUEST_ID);
@@ -103,10 +116,13 @@ public class OrchestrationRequestsUnitTest {
@Test
public void mapInfraActiveRequestToRequestOriginalRequestIdNullTest() throws ApiException {
+ doReturn("Last task executed: Call SDNC").when(camundaRequestHandler).getTaskName(REQUEST_ID);
InstanceReferences instanceReferences = new InstanceReferences();
instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
RequestStatus requestStatus = new RequestStatus();
requestStatus.setRequestState(iar.getRequestStatus());
+ requestStatus.setStatusMessage(String.format("FLOW STATUS: %s RETRY STATUS: %s ROLLBACK STATUS: %s",
+ FLOW_STATUS + TASK_INFORMATION, RETRY_STATUS_MESSAGE, ROLLBACK_STATUS_MESSAGE));
Request expected = new Request();
expected.setRequestId(REQUEST_ID);
expected.setInstanceReferences(instanceReferences);
@@ -120,10 +136,13 @@ public class OrchestrationRequestsUnitTest {
@Test
public void mapRequestStatusAndExtSysErrSrcToRequestFalseTest() throws ApiException {
+ doReturn("Last task executed: Call SDNC").when(camundaRequestHandler).getTaskName(REQUEST_ID);
InstanceReferences instanceReferences = new InstanceReferences();
instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
RequestStatus requestStatus = new RequestStatus();
requestStatus.setRequestState(iar.getRequestStatus());
+ requestStatus.setStatusMessage(String.format("FLOW STATUS: %s RETRY STATUS: %s ROLLBACK STATUS: %s",
+ FLOW_STATUS + TASK_INFORMATION, RETRY_STATUS_MESSAGE, ROLLBACK_STATUS_MESSAGE));
Request expected = new Request();
expected.setRequestId(REQUEST_ID);
@@ -140,6 +159,7 @@ public class OrchestrationRequestsUnitTest {
@Test
public void mapRequestStatusAndExtSysErrSrcToRequestStatusDetailTest() throws ApiException {
+ doReturn(null).when(camundaRequestHandler).getTaskName(REQUEST_ID);
InstanceReferences instanceReferences = new InstanceReferences();
instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
RequestStatus requestStatus = new RequestStatus();
@@ -157,11 +177,6 @@ public class OrchestrationRequestsUnitTest {
expected.setRequestScope(SERVICE);
includeCloudRequest = false;
- iar.setExtSystemErrorSource(EXT_SYSTEM_ERROR_SOURCE);
- iar.setRollbackExtSystemErrorSource(ROLLBACK_EXT_SYSTEM_ERROR_SOURCE);
- iar.setFlowStatus(FLOW_STATUS);
- iar.setRollbackStatusMessage(ROLLBACK_STATUS_MESSAGE);
- iar.setRetryStatusMessage(RETRY_STATUS_MESSAGE);
Request actual = orchestrationRequests.mapInfraActiveRequestToRequest(iar, includeCloudRequest,
OrchestrationRequestFormat.STATUSDETAIL.toString());
@@ -170,12 +185,13 @@ public class OrchestrationRequestsUnitTest {
@Test
public void mapRequestStatusAndExtSysErrSrcToRequestDetailTest() throws ApiException {
+ doReturn("Last task executed: Call SDNC").when(camundaRequestHandler).getTaskName(REQUEST_ID);
InstanceReferences instanceReferences = new InstanceReferences();
instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
RequestStatus requestStatus = new RequestStatus();
requestStatus.setRequestState(iar.getRequestStatus());
requestStatus.setStatusMessage(String.format("FLOW STATUS: %s RETRY STATUS: %s ROLLBACK STATUS: %s",
- FLOW_STATUS, RETRY_STATUS_MESSAGE, ROLLBACK_STATUS_MESSAGE));
+ FLOW_STATUS + TASK_INFORMATION, RETRY_STATUS_MESSAGE, ROLLBACK_STATUS_MESSAGE));
Request expected = new Request();
expected.setRequestId(REQUEST_ID);
@@ -184,11 +200,78 @@ public class OrchestrationRequestsUnitTest {
expected.setRequestScope(SERVICE);
includeCloudRequest = false;
- iar.setExtSystemErrorSource(EXT_SYSTEM_ERROR_SOURCE);
- iar.setRollbackExtSystemErrorSource(ROLLBACK_EXT_SYSTEM_ERROR_SOURCE);
- iar.setFlowStatus(FLOW_STATUS);
- iar.setRollbackStatusMessage(ROLLBACK_STATUS_MESSAGE);
- iar.setRetryStatusMessage(RETRY_STATUS_MESSAGE);
+
+ Request actual = orchestrationRequests.mapInfraActiveRequestToRequest(iar, includeCloudRequest,
+ OrchestrationRequestFormat.DETAIL.toString());
+
+ assertThat(actual, sameBeanAs(expected));
+ }
+
+ @Test
+ public void mapRequestStatusAndExtSysErrSrcToRequestNoFlowStatusTest() throws ApiException {
+ InstanceReferences instanceReferences = new InstanceReferences();
+ instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
+ RequestStatus requestStatus = new RequestStatus();
+ requestStatus.setRequestState(iar.getRequestStatus());
+ requestStatus.setStatusMessage(
+ String.format("RETRY STATUS: %s ROLLBACK STATUS: %s", RETRY_STATUS_MESSAGE, ROLLBACK_STATUS_MESSAGE));
+
+ Request expected = new Request();
+ expected.setRequestId(REQUEST_ID);
+ expected.setInstanceReferences(instanceReferences);
+ expected.setRequestStatus(requestStatus);
+ expected.setRequestScope(SERVICE);
+
+ includeCloudRequest = false;
+ iar.setFlowStatus(null);
+
+ Request actual = orchestrationRequests.mapInfraActiveRequestToRequest(iar, includeCloudRequest,
+ OrchestrationRequestFormat.DETAIL.toString());
+
+ assertThat(actual, sameBeanAs(expected));
+ }
+
+ @Test
+ public void mapRequestStatusAndExtSysErrSrcToRequestFlowStatusSuccessfulCompletionTest() throws ApiException {
+ InstanceReferences instanceReferences = new InstanceReferences();
+ instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
+ RequestStatus requestStatus = new RequestStatus();
+ requestStatus.setRequestState(iar.getRequestStatus());
+ requestStatus.setStatusMessage(String.format("FLOW STATUS: %s RETRY STATUS: %s ROLLBACK STATUS: %s",
+ "Successfully completed all Building Blocks", RETRY_STATUS_MESSAGE, ROLLBACK_STATUS_MESSAGE));
+
+ Request expected = new Request();
+ expected.setRequestId(REQUEST_ID);
+ expected.setInstanceReferences(instanceReferences);
+ expected.setRequestStatus(requestStatus);
+ expected.setRequestScope(SERVICE);
+
+ includeCloudRequest = false;
+ iar.setFlowStatus("Successfully completed all Building Blocks");
+
+ Request actual = orchestrationRequests.mapInfraActiveRequestToRequest(iar, includeCloudRequest,
+ OrchestrationRequestFormat.DETAIL.toString());
+
+ assertThat(actual, sameBeanAs(expected));
+ }
+
+ @Test
+ public void mapRequestStatusAndExtSysErrSrcToRequestFlowStatusSuccessfulRollbackTest() throws ApiException {
+ InstanceReferences instanceReferences = new InstanceReferences();
+ instanceReferences.setServiceInstanceId(SERVICE_INSTANCE_ID);
+ RequestStatus requestStatus = new RequestStatus();
+ requestStatus.setRequestState(iar.getRequestStatus());
+ requestStatus.setStatusMessage(String.format("FLOW STATUS: %s RETRY STATUS: %s ROLLBACK STATUS: %s",
+ "All Rollback flows have completed successfully", RETRY_STATUS_MESSAGE, ROLLBACK_STATUS_MESSAGE));
+
+ Request expected = new Request();
+ expected.setRequestId(REQUEST_ID);
+ expected.setInstanceReferences(instanceReferences);
+ expected.setRequestStatus(requestStatus);
+ expected.setRequestScope(SERVICE);
+
+ includeCloudRequest = false;
+ iar.setFlowStatus("All Rollback flows have completed successfully");
Request actual = orchestrationRequests.mapInfraActiveRequestToRequest(iar, includeCloudRequest,
OrchestrationRequestFormat.DETAIL.toString());
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
index 62a6f44a63..5306888570 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/RequestHandlerUtilsTest.java
@@ -76,6 +76,9 @@ public class RequestHandlerUtilsTest extends BaseTest {
@Autowired
private RequestHandlerUtils requestHandlerUtils;
+ @Autowired
+ private CamundaRequestHandler camundaRequestHandler;
+
@Value("${wiremock.server.port}")
private String wiremockPort;
@@ -327,7 +330,7 @@ public class RequestHandlerUtilsTest extends BaseTest {
public void setCamundaHeadersTest() throws ContactCamundaException, RequestDbFailureException {
String encryptedAuth = "015E7ACF706C6BBF85F2079378BDD2896E226E09D13DC2784BA309E27D59AB9FAD3A5E039DF0BB8408"; // user:password
String key = "07a7159d3bf51a0e53be7a8f89699be7";
- HttpHeaders headers = requestHandlerUtils.setCamundaHeaders(encryptedAuth, key);
+ HttpHeaders headers = camundaRequestHandler.setCamundaHeaders(encryptedAuth, key);
List<org.springframework.http.MediaType> acceptedType = headers.getAccept();
String expectedAcceptedType = "application/json";
assertEquals(expectedAcceptedType, acceptedType.get(0).toString());
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
index b72e5124d1..4b2644bc00 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java
@@ -2917,19 +2917,6 @@ public class ServiceInstancesTest extends BaseTest {
}
@Test
- public void setCamundaHeadersTest() throws ContactCamundaException, RequestDbFailureException {
- String encryptedAuth = "015E7ACF706C6BBF85F2079378BDD2896E226E09D13DC2784BA309E27D59AB9FAD3A5E039DF0BB8408"; // user:password
- String key = "07a7159d3bf51a0e53be7a8f89699be7";
- HttpHeaders headers = requestHandlerUtils.setCamundaHeaders(encryptedAuth, key);
- List<org.springframework.http.MediaType> acceptedType = headers.getAccept();
- String expectedAcceptedType = "application/json";
- assertEquals(expectedAcceptedType, acceptedType.get(0).toString());
- String basicAuth = headers.getFirst(HttpHeaders.AUTHORIZATION);
- String expectedBasicAuth = "Basic dXNlcjpwYXNzd29yZA==";
- assertEquals(expectedBasicAuth, basicAuth);
- }
-
- @Test
public void handleReplaceInstance_Test() throws JsonParseException, JsonMappingException, IOException {
String replaceVfModule = inputStream("/ReplaceVfModule.json");
ObjectMapper mapper = new ObjectMapper();
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/ActivityInstanceHistoryResponse.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/ActivityInstanceHistoryResponse.json
new file mode 100644
index 0000000000..efd80f3347
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/ActivityInstanceHistoryResponse.json
@@ -0,0 +1,48 @@
+[
+ {
+ "id":"Call_BBToExecute:c4f603e4-a26e-11e9-b144-0242ac14000b",
+ "parentActivityInstanceId":"c4c6b647-a26e-11e9-b144-0242ac14000b",
+ "activityId":"Call_BBToExecute",
+ "activityName":"BB to Execute",
+ "activityType":"callActivity",
+ "processDefinitionKey":"ExecuteBuildingBlock",
+ "processDefinitionId":"ExecuteBuildingBlock:1:a46566de-a26b-11e9-b144-0242ac14000b",
+ "processInstanceId":"c4c6b647-a26e-11e9-b144-0242ac14000b",
+ "executionId":"c4f603e3-a26e-11e9-b144-0242ac14000b",
+ "taskId":null,
+ "calledProcessInstanceId":"c4f603e6-a26e-11e9-b144-0242ac14000b",
+ "calledCaseInstanceId":null,
+ "assignee":null,
+ "startTime":"2019-07-09T17:27:04.607+0000",
+ "endTime":"2019-07-09T17:27:05.545+0000",
+ "durationInMillis":938,
+ "canceled":true,
+ "completeScope":false,
+ "tenantId":null,
+ "removalTime":null,
+ "rootProcessInstanceId":"c2fd4066-a26e-11e9-b144-0242ac14000b"
+ },
+ {
+ "id":"EndEvent_0mvmk3i:c59b1d39-a26e-11e9-b144-0242ac14000b",
+ "parentActivityInstanceId":"SubProcess_0tv8zda:c5852427-a26e-11e9-b144-0242ac14000b",
+ "activityId":"EndEvent_0mvmk3i",
+ "activityName":null,
+ "activityType":"noneEndEvent",
+ "processDefinitionKey":"ExecuteBuildingBlock",
+ "processDefinitionId":"ExecuteBuildingBlock:1:a46566de-a26b-11e9-b144-0242ac14000b",
+ "processInstanceId":"c4c6b647-a26e-11e9-b144-0242ac14000b",
+ "executionId":"c5852426-a26e-11e9-b144-0242ac14000b",
+ "taskId":null,
+ "calledProcessInstanceId":null,
+ "calledCaseInstanceId":null,
+ "assignee":null,
+ "startTime":"2019-07-09T17:27:05.689+0000",
+ "endTime":"2019-07-09T17:27:05.689+0000",
+ "durationInMillis":0,
+ "canceled":false,
+ "completeScope":true,
+ "tenantId":null,
+ "removalTime":null,
+ "rootProcessInstanceId":"c2fd4066-a26e-11e9-b144-0242ac14000b"
+ }
+ ] \ No newline at end of file
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json
index 3b2eca7ce2..96fed36d45 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json
@@ -61,7 +61,7 @@
},
"requestStatus": {
"requestState": "COMPLETE",
- "statusMessage": "STATUS: Vf Module has been deleted successfully. FLOW STATUS: Building blocks 1 of 3 completed. ROLLBACK STATUS: Rollback has been completed successfully.",
+ "statusMessage": "STATUS: Vf Module has been deleted successfully. FLOW STATUS: Building blocks 1 of 3 completed. TASK INFORMATION: Last task executed: BB to Execute ROLLBACK STATUS: Rollback has been completed successfully.",
"percentProgress": 100,
"timestamp": "Thu, 22 Dec 2016 08:30:28 GMT"
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json
index baddb21617..801841313a 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationList.json
@@ -58,7 +58,7 @@
},
"requestStatus":{
"requestState":"PENDING",
- "statusMessage":"FLOW STATUS: Building blocks 1 of 3 completed. RETRY STATUS: Retry 2/5 will be started in 8 min. ROLLBACK STATUS: Rollback has been completed successfully.",
+ "statusMessage":"FLOW STATUS: Building blocks 1 of 3 completed. TASK INFORMATION: Last task executed: BB to Execute RETRY STATUS: Retry 2/5 will be started in 8 min. ROLLBACK STATUS: Rollback has been completed successfully.",
"percentProgress":0,
"timestamp": "Thu, 22 Dec 2016 08:30:28 GMT"
}
@@ -321,7 +321,7 @@
},
"requestStatus":{
"requestState":"PENDING",
- "statusMessage":"STATUS: Adding members. FLOW STATUS: Building blocks 1 of 3 completed. RETRY STATUS: Retry 2/5 will be started in 8 min. ROLLBACK STATUS: Rollback has been completed successfully.",
+ "statusMessage":"STATUS: Adding members. FLOW STATUS: Building blocks 1 of 3 completed. TASK INFORMATION: Last task executed: BB to Execute RETRY STATUS: Retry 2/5 will be started in 8 min. ROLLBACK STATUS: Rollback has been completed successfully.",
"percentProgress":0,
"timestamp": "Thu, 22 Dec 2016 08:30:28 GMT"
}
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/ProcessInstanceHistoryResponse.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/ProcessInstanceHistoryResponse.json
new file mode 100644
index 0000000000..faa283463b
--- /dev/null
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/ProcessInstanceHistoryResponse.json
@@ -0,0 +1,44 @@
+[
+ {
+ "id":"c2fd4066-a26e-11e9-b144-0242ac14000b",
+ "businessKey":"84eacc7b-b046-4333-9272-5e8513bdd4cc",
+ "processDefinitionId":"WorkflowActionBB:1:a461210d-a26b-11e9-b144-0242ac14000b",
+ "processDefinitionKey":"WorkflowActionBB",
+ "processDefinitionName":"WorkflowActionBB",
+ "processDefinitionVersion":1,
+ "startTime":"2019-07-09T17:27:01.299+0000",
+ "endTime":"2019-07-09T17:27:06.585+0000",
+ "removalTime":null,
+ "durationInMillis":5286,
+ "startUserId":null,
+ "startActivityId":"Start_WorkflowActionBB",
+ "deleteReason":null,
+ "rootProcessInstanceId":"c2fd4066-a26e-11e9-b144-0242ac14000b",
+ "superProcessInstanceId":null,
+ "superCaseInstanceId":null,
+ "caseInstanceId":null,
+ "tenantId":null,
+ "state":"COMPLETED"
+ },
+ {
+ "id":"c4c6b647-a26e-11e9-b144-0242ac14000b",
+ "businessKey":null,
+ "processDefinitionId":"ExecuteBuildingBlock:1:a46566de-a26b-11e9-b144-0242ac14000b",
+ "processDefinitionKey":"ExecuteBuildingBlock",
+ "processDefinitionName":"ExecuteBuildingBlock",
+ "processDefinitionVersion":1,
+ "startTime":"2019-07-09T17:27:04.298+0000",
+ "endTime":"2019-07-09T17:27:05.690+0000",
+ "removalTime":null,
+ "durationInMillis":1392,
+ "startUserId":null,
+ "startActivityId":"Start_ExecuteBuildingBlock",
+ "deleteReason":null,
+ "rootProcessInstanceId":"c2fd4066-a26e-11e9-b144-0242ac14000b",
+ "superProcessInstanceId":"c2fd4066-a26e-11e9-b144-0242ac14000b",
+ "superCaseInstanceId":null,
+ "caseInstanceId":null,
+ "tenantId":null,
+ "state":"COMPLETED"
+ }
+ ] \ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db-repositories/pom.xml b/mso-api-handlers/mso-requests-db-repositories/pom.xml
index f890dabedd..4dbf22cd87 100644
--- a/mso-api-handlers/mso-requests-db-repositories/pom.xml
+++ b/mso-api-handlers/mso-requests-db-repositories/pom.xml
@@ -30,7 +30,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
- <optional>true</optional>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java
new file mode 100644
index 0000000000..575e5ff347
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/configuration/ExposeEntityIdResourceConfiguration.java
@@ -0,0 +1,21 @@
+package org.onap.so.db.request.configuration;
+
+import org.onap.so.db.request.beans.RequestProcessingData;
+import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
+import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ExposeEntityIdResourceConfiguration extends RepositoryRestConfigurerAdapter {
+
+ /**
+ * Spring Data Rest hides the ID by default, in order to have it in the JSON you have to manually configure that for
+ * your entity
+ *
+ * @param config
+ */
+ @Override
+ public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
+ config.exposeIdsFor(RequestProcessingData.class);
+ }
+}
diff --git a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java
index ba2d021010..708171366d 100644
--- a/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java
+++ b/mso-api-handlers/mso-requests-db-repositories/src/main/java/org/onap/so/db/request/data/repository/RequestProcessingDataRepository.java
@@ -7,9 +7,9 @@
* 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.
@@ -38,4 +38,7 @@ public interface RequestProcessingDataRepository extends JpaRepository<RequestPr
@Param("NAME") String name);
List<RequestProcessingData> findBySoRequestIdOrderByGroupingIdDesc(@Param("SO_REQUEST_ID") String soRequestId);
+
+ List<RequestProcessingData> findByGroupingIdAndNameAndTag(@Param("GROUPING_ID") String groupingId,
+ @Param("NAME") String name, @Param("TAG") String tag);
}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
index c0ce59dc66..4d16d9c272 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/client/RequestsDbClient.java
@@ -7,9 +7,9 @@
* 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.
@@ -26,6 +26,8 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
import javax.annotation.PostConstruct;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
@@ -72,6 +74,7 @@ public class RequestsDbClient {
private static final String REQUEST_ID = "REQUEST_ID";
private static final String OPERATIONAL_ENVIRONMENT_ID = "OPERATIONAL_ENV_ID";
private static final String SERVICE_MODEL_VERSION_ID = "SERVICE_MODEL_VERSION_ID";
+ private static final String TAG = "TAG";
private static final String FLOW_EXECUTION_PATH = "flowExecutionPath";
private static final String BPMN_EXECUTION_DATA_TAG = "BPMNExecutionData";
@@ -119,6 +122,8 @@ public class RequestsDbClient {
private static final String findBySoRequestIdOrderByGroupingIdDesc =
"/requestProcessingData/search/findBySoRequestIdOrderByGroupingIdDesc";
+ private static final String findByGroupingIdAndNameAndTag =
+ "/requestProcessingData/search/findByGroupingIdAndNameAndTag";
@Autowired
protected RestTemplate restTemplate;
@@ -349,7 +354,7 @@ public class RequestsDbClient {
public void updateRequestProcessingData(RequestProcessingData requestProcessingData) {
HttpHeaders headers = getHttpHeaders();
- URI uri = getUri(requestProcessingDataURI);
+ URI uri = getUri(requestProcessingDataURI + "/" + requestProcessingData.getId());
HttpEntity<RequestProcessingData> entity = new HttpEntity<>(requestProcessingData, headers);
restTemplate.put(uri, entity);
}
@@ -368,6 +373,20 @@ public class RequestsDbClient {
.queryParam(GROUPING_ID, groupingId).build().toString()));
}
+ public List<RequestProcessingData> getRequestProcessingDataByGroupingIdAndNameAndTag(String groupingId, String name,
+ String tag) {
+ Iterable<RequestProcessingData> requestProcessingDataListIt =
+ getClientFactory().create(RequestProcessingData.class)
+ .getAll(getUri(UriBuilder.fromUri(endpoint + findByGroupingIdAndNameAndTag)
+ .queryParam(GROUPING_ID, groupingId).queryParam(NAME, name).queryParam(TAG, tag).build()
+ .toString()));
+
+ List<RequestProcessingData> requestProcessingDataList =
+ StreamSupport.stream(requestProcessingDataListIt.spliterator(), false).collect(Collectors.toList());
+
+ return requestProcessingDataList;
+ }
+
public RequestProcessingData getRequestProcessingDataBySoRequestIdAndName(String soRequestId, String name) {
return getClientFactory().create(RequestProcessingData.class)
.get(getUri(UriBuilder.fromUri(endpoint + findBySoRequestIdAndName)
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java
new file mode 100644
index 0000000000..fdbc04acb4
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/client/RequestDbClientTest.java
@@ -0,0 +1,35 @@
+package org.onap.so.db.request.client;
+
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isA;
+import static org.mockito.Mockito.times;
+import java.net.URI;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.so.db.request.beans.RequestProcessingData;
+import org.springframework.http.HttpEntity;
+import org.springframework.web.client.RestTemplate;
+
+
+@RunWith(MockitoJUnitRunner.class)
+public class RequestDbClientTest {
+
+ @InjectMocks
+ protected RequestsDbClient requestsDbClient;
+
+ @Mock
+ protected RestTemplate restTemplate;
+
+ @Test
+ public void updateRequestProcessingDataTest() {
+ RequestProcessingData requestProcessingData = new RequestProcessingData();
+ requestProcessingData.setId(1);
+ URI uri = URI.create("/requestProcessingData/1");
+ requestsDbClient.updateRequestProcessingData(requestProcessingData);
+ Mockito.verify(restTemplate, times(1)).put(eq(uri), isA(HttpEntity.class));
+ }
+}
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
index 9c257bdec3..b82c17dc84 100644
--- a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
@@ -7,9 +7,9 @@
* 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.
@@ -170,4 +170,5 @@ public class CatalogDbClientTest {
CvnfcCustomization aCvnfc = catalogDbClient.findCvnfcCustomizationInAList(cvnfcCustomizationUuid, cvnfcs);
assertTrue(aCvnfc.getModelCustomizationUUID().equals("a123"));
}
+
}
diff --git a/readme.md b/readme.md
index 449743493c..862ca1ee42 100644
--- a/readme.md
+++ b/readme.md
@@ -1,79 +1,102 @@
-# ONAP MSO
+# ONAP SO
----
----
# Introduction
-ONAP MSO is delivered with **2 Docker containers**, 1 hosting the **database** (MariaDB) and 1 hosting the **JBoss** application server running all ONAP MSO code.
+SO (Service Orchestrator) project is mostly composed of java & groovy code along with camunda BPMN code flow.
-Both containers runs on the same machine and can be started with **`docker-compose`**.
+SO consists of following sub-components:
+ - API Handler (*/mso-api-handlers*) set of REST services for incoming requests (northbound clients)
+ - BPMN Execution Engine (*/bpmn*) contains all business logic of service order execution and interact with AAI, SDNC, requestdb, catalogdb etc. Exposes rest interface for Api Handler
+ - Set of adapters (*/adapters*) adapters that interact with ONAP components (SDNC, VFC, Request DB, Catalog DB) or external components (VNFM, Openstack)
+ - Data Stores: Catalog DB (configuration is here */mso-catalog-db*) to store service and resource models, recipes and workflows
+ - SDC Client and Controller (*/asdc-controller) to receive updated models from SDC and populate Catalog DB
+ - SO Monitoring (*/so-monitoring) service to monitor BPMN workflow execution status
-# Compiling MSO
+# Compiling SO
-MSO can be compiled with `mvn clean install`. Integration tests are started with the following profile
-`-P with-integration-tests`
+SO can be compiled with `mvn clean install`. By default it executes:
+ - the standard unit tests
+ - the Spring integration tests
+ - javadoc and doclint creation
+ - BUT *does not build the docker images*
-**to be edited for rrelease**
-Docker containers are build with the following profile
-`-P docker -Ddocker.buildArg.chef_repo_branch_name=bugfix/external_adress -Ddocker.buildArg.chef_repo_git_username=git -Ddocker.buildArg.chef_repo_address=23.253.149.175/mso -Ddocker.buildArg.chef_repo_git_name=chef-repo`
+Integration tests are started with the following profile `-P with-integration-tests`
-# Getting the containers
+You can disable the integration tests by executing: `mvn clean install -DskipTests=true -Dmaven.test.skip=true`
-ONAP MSO containers are stored on [here](https://nexus3.onap.org:10002) for the releases, and [here](https://nexus3.onap.org:10003) for the snapshots
+You can disable the javadoc or doclint creation by executing `mvn clean install -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none`
-The following Docker images are the actual deployment images used for running MSO
+# Code Formatting
-| Name | Tag | Description |
-|-----------------|---------|-------------------------------------------------------------------------------------------------------------------------------|
-| onap/mso | 1.0.0 | Contains **JBoss** + **OpenJDK** + **MSO** components (BPMN engine and MSO API handlers and adapters) |
-| library/mariadb | 10.1.11 | **MariaDB** image from Docker.io, this image hosts the database and is preloaded with MSO schema and configuration at startup |
+Your build may fail if you don't follow Code Guidelines. In order to format files run `mvn process-sources -P format`
-# Starting MSO
+# Building Docker images
-### docker-compose
+You can build docker images by executing profile "docker": `mvn clean install -P docker`
-You can use `docker-compose` to start MSO.
-The file is as the root of the directory.
-See `Getting the containers` to pull the images
+If you want to build docker images with out executing test and javadoc, then run the below command `mvn clean install -U -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none -P docker`
-### Heat template
+# Getting the containers
-A heat template that can be used on RackSpace to spin up the MSO Host VM and run docker-compose is currently being built by the Demo Team.
+ONAP SO containers are stored on [here](https://nexus3.onap.org:10002) for the releases, and [here](https://nexus3.onap.org:10003) for the snapshots
-# Accessing MSO
+The following Docker images are the actual deployment images used for running SO
-MSO UIs are not really used for operating MSO, but they provide information on what is currently happening and get an insight on the components.
+| Name | Tag | Description |
+|-----------------|---------|-------------------------------------------------------------------------------------------------------------------------------|
+| onap/so/api-handler-infra | 1.4.4 | MSO Api handler for SO REST service entry point |
+| onap/so/bpmn-infra | 1.4.4 | BPMN-Infra contains business logic of execution flow |
+| onap/so/catalog-db-adapter | 1.4.4 | CatalogDB to interact with mariaDB catalogdb schema |
+| onap/so/openstack-adapter | 1.4.4 | Adapter to interact with Openstack as a VIM |
+| onap/so/request-db-adapter | 1.4.4 | RequestDB to interact with mariaDB requestdb schema |
+| onap/so/sdc-controller | 1.4.4 | SDC-controller to interact with SDC module |
+| onap/so/sdnc-adapter | 1.4.4 | SDNC Adapter to interacts with SDNC module |
+| onap/so/so-monitoring | 1.4.4 | SO Monitoring for monitoring the SO workflows |
+| onap/so/vfc-adapter | 1.4.4 | Adapter to interact with VFC module |
+| onap/so/vnfm-adapter | 1.4.4 | Adapter to interact with external VNFMs through SOL003 interface |
+| library/mariadb | 10.1.11 | MariaDB image from Docker.io, this image hosts the database and is preloaded with SO schema and configuration at startup |
+
+# Starting SO
-### MSO JBoss console
+### docker-compose
-JBoss Wildly provides administrative functions through the application [server console](https://docs.jboss.org/author/display/WFLY10/Admin+Guide#AdminGuide-Accessingthewebconsole].
+You can use docker-compose to start SO. For running docker-compose, you need to checkout docker-config project.
-Said console can be used to have a look at the status of MSO. It is providing details on deployed artifacts and gives a remote access to the main server log file
+docker-config code is located in a single git repository named *so/docker-config*
-The UI can be accessed trough http://containerHostName:9990/
+To start SO:
+ - `cd docker-config`
+ - set up DOCKER_HOST env variable with your specific host+port i.e. `export DOCKER_HOST=tcp://127.0.0.1:2375`
+ - run helper script `./deploy.sh` (OR `docker-compose up -d`)
-The configuration preloads a default user (admin) with the standard `placeholder` password.
+You can also run / restart independent docker, like to run bpmn-infra docker, use command `docker-compose up -d bpmn-infra`
-The configuration of JBoss should not be touched. But it is possible to look at the two following sections for insights on the MSO health :
+**NOTE**: container *onap/so/vnfm-adapter* is not started via docker-compose script
-![deployments or runtime](http://img11.hostingpics.net/pics/332403image2016112412225.png)
+### Heat template
-Deployments shows what is deployed and running on the application server, you should see the following once MSO is up and running (Actual names of the War files may differ but their numbers and general format should be the same)
+A heat template that can be used on RackSpace to spin up the SO Host VM and run docker-compose is currently being built by the Demo Team.
-***to be upload when rrelease***
+# Accessing SO
-Runtime can be used to have a look a the main server log files, see JVM status and parameters, environment settings etc,...
+SO UIs are not really used for operating SO, but they provide information on what is currently happening and get an insight on the components.
-![runtime monitor](http://img11.hostingpics.net/pics/244948image20161124123216.png)
+### Spring Boot Actuator Endpoints
-See the logging section below for more details about other logfiles (EELF framework)
+Some of SO components (Api Handler, SO monitoring) use Embedded Tomcat from Spring boot to run application.
+To monitor the app, Actuator endpoint can be used:
-### MSO Camunda Cockpit console
+ - /manage/health - Shows application health information
+ - /manage/info - Displays arbitrary application info
-MSO orchestration processes can be monitored with the [Camunda Engine cockpit UI](https://camunda.org/features/cockpit/). It gives an insight about the available processes, allows to trigger them manually and provides monitoring of the currently running processes
+### SO Camunda Cockpit console
-**IMPORTANT NOTE** : since ONAP MSO only uses Camunda Community version it is not possible to see history of running process as this is an Enterprise feature only.
+SO orchestration processes can be monitored with the [Camunda Engine cockpit UI](https://camunda.org/features/cockpit/). It gives an insight about the available processes, allows to trigger them manually and provides monitoring of the currently running processes
+
+**IMPORTANT NOTE** : since ONAP SO only uses Camunda Community version, which don't show history of running processes - SO-Monitoring component was developed for that purpose.
#### Accessing the Cockpit
@@ -86,15 +109,15 @@ It is also possible to trigger them from the UI if you know the parameters that
***screenshots to be uploaded when rrelease***
-### MSO APIs
+### SO APIs
-Most of the MSO features within ONAP MSO are triggered by using **RESTful interfaces**. MSO supports both **HTTP** and **HTTPS**, but is configured on this release with HTTP only using Basic Authentification.
+Most of the SO features within ONAP SO are triggered by using **RESTful interfaces**. SO supports both **HTTP** and **HTTPS**, but is configured on this release with HTTP only using Basic Authentification.
-The MSO APIs are configured to accept requests having a **basic auth. header** set with various **username and password** depending on which API is being triggered.
+The SO APIs are configured to accept requests having a **basic auth. header** set with various **username and password** depending on which API is being triggered.
-All API endpoints are exposed on port **8080**, it is possible to reach all MSO subsystems directly with the proper query (see more information below on how to test MSO functions)
+All API endpoints are exposed on port **8080**, it is possible to reach all SO subsystems directly with the proper query (see more information below on how to test SO functions)
-##### Main API endpoints in the first open source release
+##### Main API endpoints
- ***to be completed*** APIHandler health checks
- ***to be completed*** VID API
@@ -103,15 +126,15 @@ VID endpoint : http://vm1.mso.simpledemo.onap.org:8080/ecomp/mso/infra/serviceIn
The typical easy way to trigger these endpoints is to use a RESTful client or automation framework.
-# Configuration of MSO
+# Configuration of SO
-It is important to understand that the Docker containers are using a configuration file (JSON) in order to provision MSO basic configuration, in the above Jenkins Job, Jenkins pulls that JSON file from the MSO repository, any other mean to provide that JSON file (for specific environments) would also work.
+It is important to understand that the Docker containers are using a configuration file (JSON) in order to provision SO basic configuration, in the above Jenkins Job, Jenkins pulls that JSON file from the SO repository, any other mean to provide that JSON file (for specific environments) would also work.
-Once the deployment of the docker images is done, you will need to configure your installation to be able to interact with all the components that MSO needs.
+Once the deployment of the docker images is done, you will need to configure your installation to be able to interact with all the components that SO needs.
Change the environment file located here : **/shared/mso-docker.json** then run the following command `chef-solo -c /var/berks-cookbooks/chef-repo/solo.rb -o recipe[mso-config::apih],recipe[mso-config::bpmn],recipe[mso-config::jra]`
-**Important note:** The host mso is mapped automatically to c1.vm1.mso.simpledemo.onap.org in /etc/host of the docker image so you can keep mso:8080 when you want to mention the APIH, JRA or Camunda host.
+**Important note:** The host SO is mapped automatically to c1.vm1.mso.simpledemo.onap.org in /etc/host of the docker image so you can keep mso:8080 when you want to mention the APIH, JRA or Camunda host.
Here are the main parameters you could change:
@@ -126,29 +149,22 @@ Here are the main parameters you could change:
The credentials are defined in 2 places:
-- JBoss users credentials are defined in /opt/jboss/standalone/configuration/application-users.properties and are associated to the corresponding role in application-roles.properties (you should not change this file except if you add a new user)
-- In the environment. Replace the authorisation key in the file /shared/mso-docker.json and run the command to apply the configuration as explained above.
+- In the application.yaml in projects
+- application.yaml can be overriden in two places: in *so/docker-config* repository and directories *so/docker-config/volumes/so/config/so-monitoring/onapheat/override.yaml*
+- In *oom* repository (if intstallation is done via oom)
-You can encrypt the JBoss user with the following command `echo -n 'LOGIN:ApplicationRealm:PASSWORD' |openssl dgst -md5` and replace the line corresponding to this user in /opt/jboss/standalone/configuration/application-users.properties
+You can find default users there for specific so component.
+**Note** that these default users should be changed.
You can replace the authentication in the environment by the value returned by the following API `GET on http://c1.vm1.mso.simpledemo.onap.org:8080/asdc/properties/encrypt/{value}/{cryptKey}` where {value} is the string login:password and cryptKey (also defined in the environment) is the key to use to encrypt the credentials
-Exemple of credentials you could change:
-- BPELClient: if you change this credentials, you have to change it in JBoss users AND environment file (+ apply the new config) and be careful to set the same password. In the environment it is the parameter "adaptersPoAuth" under the section "mso-bpmn-urn-config". The cryptKey to use is 07a7159d3bf51a0e53be7a8f89699be7
-- BPMNClient: if you change this credentials, you have to change it in JBoss users AND environment file (+ apply the new config) and be careful to set the same password. In the environment it is the parameter "camundaAuth" under the sections "mso-api-handler-config" AND "mso-api-handler-infra-config". The cryptKey to use is
-aa3871669d893c7fb8abbcda31b88b4f
-
# Logging
-### JBoss
-
-MSO log files are located the [JBoss log](https://docs.jboss.org/author/display/WFLY8/Logging+Configuration) folder in the container.
-
### EELF
-EELF framework is used for **specific logs** (audit, metric and error logs). They are tracking inter component logs (request and response) and allow to follow a complete flow through the MSO subsystem
+EELF framework is used for **specific logs** (audit, metric and error logs). They are tracking inter component logs (request and response) and allow to follow a complete flow through the SO subsystem
-EELF logs are located at the following location on the MSO JBoss container :
+Logs are located at the following locations in SO containers :
- /var/log/ecomp/MSO (each module has its own folder)
@@ -156,27 +172,20 @@ The DEBUG mode is enabled by module and has to be re-enabled if the application
It can be enabled with a GET on the following APIs:
- Camunda (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/mso/logging/debug
-- APIH Infra (use any jboss user with role InfraPortal-Client for authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/ecomp/mso/infra/logging/debug
+- APIH Infra (use any user with role InfraPortal-Client for authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/ecomp/mso/infra/logging/debug
- ASDC (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/asdc/logging/debug
- DBAdapter (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/dbadapters/logging/debug
- Network adapter (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/networks/rest/logging/debug
-- SDNC adapter (use any jboss user with role MSO-Client for authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/adapters/rest/logging/debug
+- SDNC adapter (use any user with role MSO-Client for authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/adapters/rest/logging/debug
- VNF adapter (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/vnfs/rest/logging/debug
- Tenant adapter (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/tenants/rest/logging/debug
- APPC adapter (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/appc/rest/logging/debug
-Default JBoss users:
-- with role CSI-Client: CSIClient/password1$
-- with role CSI-Client: InfraPortalClient/password1$
-- with role CSI-Client: MSOClient/password1$
-
-Note that these default users should be changed.
+# Testing SO Functionalities
-# Testing MSO Functionalities
+For this first release of SO, the queries to start the various VNFs should come first through API Handler.
-For this first release of MSO, the queries to start the various VNFs should come first through API Handler.
-
-To help with the testing we are providing here a sample [SoapUI](https://www.soapui.org/) project [file](add link when rrealease) with the main queries that VID should send to MSO
+To help with the testing we are providing here a sample [SoapUI](https://www.soapui.org/) project [file](add link when rrealease) with the main queries that VID should send to SO
### To simulate Loading of Artifacts & models (bypass ASDC)i
@@ -184,11 +193,11 @@ The MariaDB container can load up special SQL scripts that simulates the loading
Simply use the load ability embedded to run the 'preload SQL' script for vFirewall or vDNS
-### Once the HEAT artifacts are loaded into MSO
+### Once the HEAT artifacts are loaded into SO
-It is also possible to simulate queries to the PO (platform orchestrator) adapter of MSO (thus bypassing BPMN flows and API handler) to verify MSO interaction with Rackspace and verify the behavior of the Adapter (so that it loads HEAT and connect to Rackspace and instantiate elements)
+It is also possible to simulate queries to the PO (platform orchestrator) adapter of SO (thus bypassing BPMN flows and API handler) to verify SO interaction with Rackspace and verify the behavior of the Adapter (so that it loads HEAT and connect to Rackspace and instantiate elements)
-Below is a query used from FireFox RESTClient plugin to trigger MSO adapter directly (replace values accordingly)
+Below is a query used from FireFox RESTClient plugin to trigger SO adapter directly (replace values accordingly)
```
POST http://<containername>:8080/vnfs/rest/v1/vnfs/5259ba4a-cf0d-4791-9c60-9117faa5cdea/vf-modules
@@ -201,11 +210,5 @@ login/password BPELClient/password1$F
# Getting Help
-*** to be completed on rrelease ***
-
-mso@lists.onap.org
-
-MSO Javadoc and Maven site
-
-*** to be completed on rrelease ***
+Subscribe and post messages with SO tag in onap-discuss group at https://lists.onap.org/g/onap-discuss
diff --git a/so-monitoring/readme.md b/so-monitoring/readme.md
new file mode 100644
index 0000000000..d4b876c763
--- /dev/null
+++ b/so-monitoring/readme.md
@@ -0,0 +1,35 @@
+# SO Monitoring
+
+----
+
+## Introduction
+
+SO Monitoring provides multiple useful features:
+* Search/Filtering Menu
+* A graphical user interface
+* Workflow pathing
+* Subflow navigation
+* Access to the workflow variables
+
+## Compiling / Running
+
+Compiling is simple: `mvn clean install`
+Compilation may fail if your code is not formatted properly.
+
+## Components
+
+### so-monitoring-handler
+
+
+### so-monitoring-service
+
+Backend API for so-monitoring. Requires basic auth to access it.
+
+Default credentials:
+- with role GUI-Client: gui/password1$
+
+Note that these default users should be changed for production.
+
+### so-monitoring-ui
+
+UI for so-monitoring has a separate README.md - so-monitoring/so-monitoring-ui/src/main/frontend/README.md
diff --git a/so-monitoring/so-monitoring-service/pom.xml b/so-monitoring/so-monitoring-service/pom.xml
index ff70a77239..f5448aaf5c 100644
--- a/so-monitoring/so-monitoring-service/pom.xml
+++ b/so-monitoring/so-monitoring-service/pom.xml
@@ -64,6 +64,10 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-security</artifactId>
+ </dependency>
</dependencies>
<build>
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java
new file mode 100644
index 0000000000..3959631f94
--- /dev/null
+++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/UserController.java
@@ -0,0 +1,35 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.monitoring.rest.api;
+
+import java.security.Principal;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class UserController {
+
+ @RequestMapping("/user")
+ public Principal user(Principal user) {
+ return user;
+ }
+}
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
index cadd60b0d9..2b53ed8953 100644
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
+++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
@@ -2,7 +2,9 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
* ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * 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
*
@@ -21,16 +23,15 @@ package org.onap.so.monitoring.rest.api;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @author waqas.ikram@ericsson.com
*/
@Configuration
-public class WebApplicationConfig extends WebMvcConfigurerAdapter {
+public class WebApplicationConfig implements WebMvcConfigurer {
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
- super.addViewControllers(registry);
registry.addViewController("/details/**").setViewName("forward:/");
}
}
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java
new file mode 100644
index 0000000000..298f52bd35
--- /dev/null
+++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebSecurityConfigImpl.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.monitoring.rest.api;
+
+import org.onap.so.security.WebSecurityConfig;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+
+@EnableWebSecurity
+@Configuration("att-security-config")
+@Order(2)
+public class WebSecurityConfigImpl extends WebSecurityConfig {
+
+ @Override
+ protected void configure(HttpSecurity http) throws Exception {
+ http.authorizeRequests().antMatchers("/actuator", "/actuator/*", "/login", "/", "/index.html", "/*.js",
+ "/*.js.map", "/favicon.png").permitAll().anyRequest().authenticated().and().httpBasic();
+ }
+}
diff --git a/so-monitoring/so-monitoring-service/src/main/resources/application.yaml b/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
index 8235c7480a..347845e422 100644
--- a/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
+++ b/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
@@ -16,3 +16,10 @@ mso:
url: http://so-request-db-adapter.onap:8083/infraActiveRequests/
auth: Basic YnBlbDpwYXNzd29yZDEk
+spring:
+ security:
+ usercredentials:
+ -
+ username: gui
+ password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+ role: GUI-Client
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/README.md b/so-monitoring/so-monitoring-ui/src/main/frontend/README.md
index 329de0f833..65731cdc5d 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/README.md
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/README.md
@@ -6,6 +6,15 @@ This project was generated with [Angular CLI](https://github.com/angular/angular
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
+FYI: You may need to change environments.ts to hit to your backend: not so-monitoring:30224 but localhost:8088
+
+### Logging in
+
+Backend API for so-monitoring. Requires basic auth to access it.
+
+Default credentials:
+- with role GUI-Client: gui/password1$
+
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts
index 428998dc62..03e77fc2d9 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app-routing.module.ts
@@ -2,6 +2,8 @@
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. 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
@@ -24,17 +26,25 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { DetailsComponent } from './details/details.component';
+import {AuthGuard} from "./auth.guard";
+import {LoginComponent} from "./login/login.component";
const routes: Routes = [
{
// Route to home page
path: '',
- component: HomeComponent
+ component: HomeComponent,
+ canActivate: [AuthGuard]
},
{
// Route to page to show individual process based on ID
path: 'details/:id',
component: DetailsComponent
+ },
+ {
+ // Route to login page
+ path: 'login',
+ component: LoginComponent
}
];
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts
index 23308639b6..71294bfffe 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/app.module.ts
@@ -2,6 +2,8 @@
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. 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
@@ -28,7 +30,7 @@ import { AppComponent } from './app.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { TopbarComponent } from './topbar/topbar.component';
import { HomeComponent } from './home/home.component';
-import { HttpClientModule } from '@angular/common/http';
+import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { DetailsComponent } from './details/details.component';
import { ToastrNotificationService } from './toastr-notification-service.service';
@@ -37,6 +39,9 @@ import { MatFormFieldModule, MatInputModule, MatTableModule, MatTabsModule, MatS
import { NgxSpinnerModule } from 'ngx-spinner';
import { RouterModule, Routes } from '@angular/router';
import { APP_BASE_HREF } from '@angular/common';
+import { LoginComponent } from './login/login.component';
+import {BasicAuthInterceptor} from "./basic-auth.interceptor";
+import {ErrorInterceptor} from "./error.interceptor";
@NgModule({
declarations: [
@@ -44,7 +49,8 @@ import { APP_BASE_HREF } from '@angular/common';
SidebarComponent,
TopbarComponent,
HomeComponent,
- DetailsComponent
+ DetailsComponent,
+ LoginComponent
],
imports: [
BrowserModule,
@@ -64,12 +70,16 @@ import { APP_BASE_HREF } from '@angular/common';
RouterModule,
MatPaginatorModule,
MatSortModule,
- RouterModule.forRoot([])
+ RouterModule.forRoot([]),
+ ReactiveFormsModule
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
],
- providers: [ToastrNotificationService],
+ providers: [
+ { provide: HTTP_INTERCEPTORS, useClass: BasicAuthInterceptor, multi: true },
+ { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
+ ToastrNotificationService],
bootstrap: [AppComponent]
})
export class AppModule { }
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts
new file mode 100644
index 0000000000..f437a21710
--- /dev/null
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/auth.guard.ts
@@ -0,0 +1,46 @@
+/**
+ ============LICENSE_START=======================================================
+ Copyright (C) 2019 Samsung. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+
+ @authors: k.kazak@samsung.com
+ **/
+
+import { Injectable } from '@angular/core';
+import {CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router} from '@angular/router';
+import { Observable } from 'rxjs';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class AuthGuard implements CanActivate {
+
+ constructor(private router:Router) { }
+
+ canActivate(
+ next: ActivatedRouteSnapshot,
+ state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean {
+ if (localStorage.getItem('authdata')) {
+ // logged in
+ return true;
+ }
+
+ // not logged in
+ this.router.navigate(['/login'], { queryParams: {returnUrl: state.url}});
+ return false;
+ }
+}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts
new file mode 100644
index 0000000000..d7610eed0d
--- /dev/null
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/authentication.service.ts
@@ -0,0 +1,50 @@
+/**
+ ============LICENSE_START=======================================================
+ Copyright (C) 2019 Samsung. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+
+ @authors: k.kazak@samsung.com
+ **/
+
+import {Injectable} from '@angular/core';
+import {HttpClient} from "@angular/common/http";
+import {environment} from "../environments/environment";
+
+@Injectable({
+ providedIn: 'root'
+})
+export class AuthenticationService {
+
+ constructor(private http: HttpClient) {
+ }
+
+ login(username: string, password: string) {
+ // remove old data from storage
+ localStorage.removeItem('authdata');
+ // add to local storage
+ var authdata = window.btoa(username + ':' + password);
+ localStorage.setItem('authdata', authdata);
+
+ // make request
+ return this.http.get(environment.authBackendURL);
+ }
+
+ logout() {
+ // remove from local storage
+ localStorage.removeItem('authdata');
+ }
+}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts
new file mode 100644
index 0000000000..4990d05ecb
--- /dev/null
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/basic-auth.interceptor.ts
@@ -0,0 +1,43 @@
+/**
+ ============LICENSE_START=======================================================
+ Copyright (C) 2019 Samsung. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+
+ @authors: k.kazak@samsung.com
+ **/
+
+import { Injectable } from '@angular/core';
+import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
+import { Observable } from 'rxjs';
+
+@Injectable()
+export class BasicAuthInterceptor implements HttpInterceptor {
+ intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
+ //add authorization header with basic auth credentials if available
+ let auth = localStorage.getItem('authdata');
+ if (auth) {
+ const authReq = request.clone({
+ headers: request.headers.set('Authorization', 'Basic Z3VpOnBhc3N3b3JkMSQ=')
+ });
+
+ // send cloned request with header to the next handler.
+ return next.handle(authReq);
+ }
+
+ return next.handle(request);
+ }
+}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts
index b391672728..8dfae3da1e 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts
@@ -21,7 +21,7 @@ SPDX-License-Identifier: Apache-2.0
*/
import { Injectable } from '@angular/core';
-import { HttpClient, HttpErrorResponse } from '@angular/common/http';
+import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
import { BpmnInfraRequest } from './model/bpmnInfraRequest.model';
import { catchError } from 'rxjs/operators';
import { Observable } from 'rxjs';
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts
new file mode 100644
index 0000000000..afe792c80f
--- /dev/null
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/error.interceptor.ts
@@ -0,0 +1,45 @@
+/**
+ ============LICENSE_START=======================================================
+ Copyright (C) 2019 Samsung. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+
+ @authors: k.kazak@samsung.com
+ **/
+
+import { Injectable } from '@angular/core';
+import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
+import { Observable, throwError } from 'rxjs';
+import { catchError } from 'rxjs/operators';
+import {AuthenticationService} from "./authentication.service";
+
+@Injectable()
+export class ErrorInterceptor implements HttpInterceptor {
+ constructor(private authenticationService: AuthenticationService) {}
+
+ intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
+ return next.handle(request).pipe(catchError(err => {
+ if (err.status === 401) {
+ // auto logout if 401 response returned from api
+ this.authenticationService.logout();
+ location.reload(true);
+ }
+
+ const error = err.error.message || err.statusText;
+ return throwError(error);
+ }))
+ }
+}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html
new file mode 100644
index 0000000000..107e1da04a
--- /dev/null
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.html
@@ -0,0 +1,43 @@
+<!--
+============LICENSE_START=======================================================
+Copyright (C) 2019 Samsung. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: k.kazak@samsung.com
+-->
+<h2>Login</h2>
+<form [formGroup]="loginForm" (ngSubmit)="onSubmit()">
+ <div class="form-group">
+ <label for="username">Username</label>
+ <input type="text" formControlName="username" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.username.errors }" />
+ <div *ngIf="submitted && f.username.errors" class="invalid-feedback">
+ <div *ngIf="f.username.errors.required">Username is required</div>
+ </div>
+ </div>
+ <div class="form-group">
+ <label for="password">Password</label>
+ <input type="password" formControlName="password" class="form-control" [ngClass]="{ 'is-invalid': submitted && f.password.errors }" />
+ <div *ngIf="submitted && f.password.errors" class="invalid-feedback">
+ <div *ngIf="f.password.errors.required">Password is required</div>
+ </div>
+ </div>
+ <div class="form-group">
+ <button [disabled]="loading" class="btn btn-primary">Login</button>
+ <img *ngIf="loading" src="data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==" />
+ </div>
+ <div *ngIf="error" class="alert alert-danger">{{error}}</div>
+</form>
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts
new file mode 100644
index 0000000000..8cf379d04f
--- /dev/null
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.spec.ts
@@ -0,0 +1,108 @@
+/**
+ ============LICENSE_START=======================================================
+ Copyright (C) 2019 Samsung. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+
+ @authors: k.kazak@samsung.com
+ **/
+
+import {async, ComponentFixture, inject, TestBed} from '@angular/core/testing';
+
+import {LoginComponent} from './login.component';
+import {AuthenticationService} from "../authentication.service";
+import {CUSTOM_ELEMENTS_SCHEMA} from "@angular/core";
+import {FormsModule, ReactiveFormsModule} from '@angular/forms';
+import {RouterTestingModule} from "@angular/router/testing";
+import {ActivatedRoute, Router, RouterModule} from "@angular/router";
+
+describe('LoginComponent', () => {
+ // Create SPY Object for Jasmine tests to mock DataService
+ let spyDataService: jasmine.SpyObj<AuthenticationService>;
+ let component: LoginComponent;
+ let fixture: ComponentFixture<LoginComponent>;
+ let router: Router;
+
+ beforeEach(async(() => {
+ spyDataService = jasmine.createSpyObj('AuthenticationService', ['login', 'logout']);
+
+ TestBed.configureTestingModule({
+ providers: [LoginComponent,
+ {provide: AuthenticationService, useValue: spyDataService},
+ {provide: ActivatedRoute, useValue: { snapshot: {queryParams: { returnUrl: 'test'}}}}
+ ],
+ imports: [RouterTestingModule, ReactiveFormsModule, FormsModule, RouterModule.forRoot([])],
+ declarations: [LoginComponent],
+ schemas: [
+ CUSTOM_ELEMENTS_SCHEMA
+ ]
+ });
+
+ fixture = TestBed.createComponent(LoginComponent);
+ component = fixture.componentInstance;
+ router = TestBed.get(Router);
+ }));
+
+
+ it('should create', inject([LoginComponent],
+ (component: LoginComponent) => {
+ expect(component).toBeTruthy();
+ }));
+
+ it('should logout and route to test directory', inject([LoginComponent],
+ (component: LoginComponent) => {
+ component.ngOnInit();
+ expect(component.returnUrl).toBe('test');
+ }));
+
+ it('should logout and route to root directory', inject([LoginComponent],
+ (component: LoginComponent) => {
+ router.initialNavigation();
+ component.ngOnInit();
+ expect(component.returnUrl).toBe('test');
+ }));
+
+ it('should submit without success', inject([LoginComponent],
+ (component: LoginComponent) => {
+ component.ngOnInit();
+ expect(component.loginForm.valid).toBe(false);
+ component.onSubmit();
+ expect(component.submitted).toBe(true);
+ }));
+
+ it('should submit without success', inject([LoginComponent],
+ (component: LoginComponent) => {
+ component.ngOnInit();
+ expect(component.loginForm.valid).toBe(false);
+ spyDataService.login.and.returnValue(Promise.resolve());
+
+ let compiled = fixture.debugElement.nativeElement;
+ let username = compiled.querySelector('input[type="text"]');
+ let password = compiled.querySelector('input[type="password"]');
+
+ fixture.detectChanges();
+
+ // Change value
+ username.value = 'test';
+ password.value = 'password';
+
+ // dispatch input event
+ dispatchEvent(new Event('input'));
+
+ component.onSubmit();
+ expect(component.submitted).toBe(true);
+ }));
+});
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts
new file mode 100644
index 0000000000..4a3f4e6b0f
--- /dev/null
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/login/login.component.ts
@@ -0,0 +1,81 @@
+/**
+ ============LICENSE_START=======================================================
+ Copyright (C) 2019 Samsung. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+
+ @authors: k.kazak@samsung.com
+ **/
+
+import { Component, OnInit } from '@angular/core';
+import {FormBuilder, FormGroup, Validators, ReactiveFormsModule} from "@angular/forms";
+import {ActivatedRoute, Router} from "@angular/router";
+import {AuthenticationService} from "../authentication.service";
+import {first} from "rxjs/internal/operators";
+
+@Component({
+ selector: 'app-login',
+ templateUrl: './login.component.html',
+ styleUrls: []
+})
+export class LoginComponent implements OnInit {
+
+ loginForm: FormGroup;
+ loading = false;
+ submitted = false;
+ returnUrl: string;
+ error = '';
+
+ constructor(private formBuilder: FormBuilder,
+ private route: ActivatedRoute,
+ private router: Router,
+ private authenticationService: AuthenticationService) { }
+
+ ngOnInit() {
+ this.loginForm = this.formBuilder.group({
+ username: ['', Validators.required],
+ password: ['', Validators.required]
+ });
+
+ // logout
+ this.authenticationService.logout();
+
+ this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/';
+ }
+
+ // convenience getter for easy access to form fields
+ get f() { return this.loginForm.controls; }
+
+ onSubmit() {
+ this.submitted = true;
+
+ // stop here if form is invalid
+ if (this.loginForm.invalid) {
+ return;
+ }
+
+ this.loading = true;
+ this.authenticationService.login(this.f.username.value, this.f.password.value)
+ .subscribe(
+ next => {
+ this.router.navigate([this.returnUrl]);
+ },
+ error => {
+ this.error = error;
+ this.loading = false;
+ });
+ }
+}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html
index e8b54d7ae3..1c623518c7 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/sidebar/sidebar.component.html
@@ -1,29 +1,34 @@
-<!--
-============LICENSE_START=======================================================
- Copyright (C) 2018 Ericsson. All rights reserved.
-================================================================================
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
- limitations under the License.
-
-SPDX-License-Identifier: Apache-2.0
-============LICENSE_END=========================================================
-
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
--->
-
-<nav>
- <ul>
- <li>
- <a routerLink="/">Home</a>
- </li>
- </ul>
-</nav>
+<!--
+============LICENSE_START=======================================================
+ Copyright (C) 2018 Ericsson. 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.
+
+SPDX-License-Identifier: Apache-2.0
+============LICENSE_END=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+-->
+
+<nav>
+ <ul>
+ <li>
+ <a routerLink="/">Home</a>
+ </li>
+ <li>
+ <a routerLink="/login">Logout</a>
+ </li>
+ </ul>
+</nav>
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts
index f0c63fe582..484a156fa9 100644
--- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts
+++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts
@@ -2,6 +2,8 @@
============LICENSE_START=======================================================
Copyright (C) 2018 Ericsson. 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
@@ -24,5 +26,6 @@ SPDX-License-Identifier: Apache-2.0
export const environment = {
production: false,
- soMonitoringBackendURL: 'http://so-monitoring:30224/so/monitoring/'
+ soMonitoringBackendURL: 'http://so-monitoring:30224/so/monitoring/',
+ authBackendURL: 'http://so-monitoring:30224/user'
};
diff --git a/vnfm-simulator/vnfm-service/pom.xml b/vnfm-simulator/vnfm-service/pom.xml
index c09c5f070a..7beccb6561 100644
--- a/vnfm-simulator/vnfm-service/pom.xml
+++ b/vnfm-simulator/vnfm-service/pom.xml
@@ -144,5 +144,23 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ <excludes>
+ <exclude>**/*.p12</exclude>
+ <exclude>**/*.jks</exclude>
+ </excludes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>false</filtering>
+ <includes>
+ <include>**/*.p12</include>
+ <include>**/*.jks</include>
+ </includes>
+ </resource>
+ </resources>
</build>
</project>
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java
index 91b79754a5..32c05ebca8 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java
+++ b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java
@@ -4,6 +4,7 @@ import java.net.InetAddress;
import java.util.Arrays;
import org.onap.svnfm.simulator.constants.Constant;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.cache.Cache;
@@ -19,6 +20,9 @@ public class ApplicationConfig implements ApplicationRunner {
private static final String PORT = "local.server.port";
+ @Value("${server.dns.name:so-vnfm-simulator.onap}")
+ private String serverDnsName;
+
@Autowired
private Environment environment;
@@ -26,7 +30,7 @@ public class ApplicationConfig implements ApplicationRunner {
@Override
public void run(final ApplicationArguments args) throws Exception {
- baseUrl = "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + environment.getProperty(PORT);
+ baseUrl = "https://" + serverDnsName + ":" + environment.getProperty(PORT);
}
public String getBaseUrl() {
@@ -35,8 +39,8 @@ public class ApplicationConfig implements ApplicationRunner {
@Bean
public CacheManager cacheManager() {
- Cache inlineResponse201 = new ConcurrentMapCache(Constant.IN_LINE_RESPONSE_201_CACHE);
- SimpleCacheManager manager = new SimpleCacheManager();
+ final Cache inlineResponse201 = new ConcurrentMapCache(Constant.IN_LINE_RESPONSE_201_CACHE);
+ final SimpleCacheManager manager = new SimpleCacheManager();
manager.setCaches(Arrays.asList(inlineResponse201));
return manager;
}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java
index 9c3a02d4e6..d3ff66aed0 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java
+++ b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java
@@ -168,6 +168,6 @@ public class SvnfmController {
final HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
- return new ResponseEntity<>(response, headers, HttpStatus.OK);
+ return new ResponseEntity<>(response, headers, HttpStatus.CREATED);
}
}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/VnfmHelper.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/VnfmHelper.java
index 60b251c4d4..8f1e299fec 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/VnfmHelper.java
+++ b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/services/VnfmHelper.java
@@ -43,9 +43,13 @@ import org.springframework.stereotype.Component;
@Component
public class VnfmHelper {
- @Autowired
private ApplicationConfig applicationConfig;
+ @Autowired
+ public VnfmHelper(ApplicationConfig applicationConfig) {
+ this.applicationConfig = applicationConfig;
+ }
+
/**
*
* @param createVNFRequest
diff --git a/vnfm-simulator/vnfm-service/src/main/resources/application.yaml b/vnfm-simulator/vnfm-service/src/main/resources/application.yaml
index 2ef302ce25..ea8105d891 100644
--- a/vnfm-simulator/vnfm-service/src/main/resources/application.yaml
+++ b/vnfm-simulator/vnfm-service/src/main/resources/application.yaml
@@ -34,6 +34,11 @@ server:
port: 9093
tomcat:
max-threads: 50
+ ssl:
+ key-alias: so@so.onap.org
+ key--store-password: '7Em3&j4.19xYiMelhD5?xbQ.'
+ key-store: classpath:so-vnfm-simulator.p12
+ key-store-type: PKCS12
vnfds:
vnfdlist:
@@ -56,4 +61,4 @@ vnfds:
- vnfcid: VNFC4
resourceTemplateId: vnfd2_vnfc4
vduId: vnfd2_vduForVnfc4
- type: COMPUTE \ No newline at end of file
+ type: COMPUTE
diff --git a/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12 b/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12
new file mode 100644
index 0000000000..7ac02855bc
--- /dev/null
+++ b/vnfm-simulator/vnfm-service/src/main/resources/so-vnfm-simulator.p12
Binary files differ
diff --git a/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/VnfmHelperTest.java b/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/VnfmHelperTest.java
new file mode 100644
index 0000000000..2b9598e54f
--- /dev/null
+++ b/vnfm-simulator/vnfm-service/src/test/java/org/onap/svnfm/simulator/services/VnfmHelperTest.java
@@ -0,0 +1,104 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 Nokia.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.svnfm.simulator.services;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum;
+import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201LinksSelf;
+import org.onap.svnfm.simulator.config.ApplicationConfig;
+import org.onap.svnfm.simulator.constants.Constant;
+import org.onap.svnfm.simulator.model.VnfInstance;
+
+public class VnfmHelperTest {
+
+ private static final String VNF_INSTANCE_ID = "vnfInstanceTestId";
+ private static final String VNFD_ID = "vnfdTestId";
+ private static final String VNF_INSTANCE_NAME = "vnfInsNameTest";
+ private static final String VNF_INSTANCE_DESCRIPTION = "vnfInstTestDescr";
+ private static final String APPLICATION_CONFIG_BASE_URL = "appConfUrl";
+ private VnfmHelper testedObject;
+ private ApplicationConfig applicationConfigMock;
+
+ @Before
+ public void setup() {
+ applicationConfigMock = mock(ApplicationConfig.class);
+ testedObject = new VnfmHelper(applicationConfigMock);
+ }
+
+ @Test
+ public void createVnfInstance() {
+ // when
+ VnfInstance result = testedObject.createVnfInstance(createVnfRequest(), VNF_INSTANCE_ID);
+ // then
+ assertThat(result.getId()).isEqualTo(VNF_INSTANCE_ID);
+ assertThat(result.getVnfdId()).isEqualTo(VNFD_ID);
+ assertThat(result.getVnfInstanceName()).isEqualTo(VNF_INSTANCE_NAME);
+ assertThat(result.getVnfInstanceDescription()).isEqualTo(VNF_INSTANCE_DESCRIPTION);
+ assertThat(result.getVnfProvider()).isEqualTo(Constant.VNF_PROVIDER);
+ assertThat(result.getVnfProductName()).isEqualTo(Constant.VNF_PROVIDER_NAME);
+ }
+
+ @Test
+ public void getInlineResponse201() throws Exception {
+ // given
+ when(applicationConfigMock.getBaseUrl()).thenReturn(APPLICATION_CONFIG_BASE_URL);
+ // when
+ InlineResponse201 result = testedObject.getInlineResponse201(prepareVnfInstance());
+ // then
+ assertThat(result.getVnfdVersion()).isEqualTo(Constant.VNFD_VERSION);
+ assertThat(result.getVnfSoftwareVersion()).isEqualTo(Constant.VNF_SOFTWARE_VERSION);
+ assertThat(result.getInstantiationState()).isEqualByComparingTo(InstantiationStateEnum.NOT_INSTANTIATED);
+ verifyAdditionalPropertyInlineResponse201(result);
+ }
+
+ private CreateVnfRequest createVnfRequest() {
+ CreateVnfRequest createVnfRequest = new CreateVnfRequest();
+ createVnfRequest.setVnfdId(VNFD_ID);
+ createVnfRequest.setVnfInstanceName(VNF_INSTANCE_NAME);
+ createVnfRequest.setVnfInstanceDescription(VNF_INSTANCE_DESCRIPTION);
+ return createVnfRequest;
+ }
+
+ private VnfInstance prepareVnfInstance() {
+ VnfInstance vnfInstance = new VnfInstance();
+ vnfInstance.setId(VNF_INSTANCE_ID);
+ return vnfInstance;
+ }
+
+ private void verifyAdditionalPropertyInlineResponse201(InlineResponse201 result) {
+ InlineResponse201LinksSelf expectedVnfInstancesLinksSelf = new InlineResponse201LinksSelf();
+ expectedVnfInstancesLinksSelf
+ .setHref(APPLICATION_CONFIG_BASE_URL + "/vnflcm/v1/vnf_instances/" + VNF_INSTANCE_ID);
+ assertThat(result.getLinks().getSelf()).isEqualTo(expectedVnfInstancesLinksSelf);
+
+ InlineResponse201LinksSelf expectedVnfInstancesLinksSelfInstantiate = new InlineResponse201LinksSelf();
+ expectedVnfInstancesLinksSelfInstantiate.setHref(
+ (APPLICATION_CONFIG_BASE_URL + "/vnflcm/v1/vnf_instances/" + VNF_INSTANCE_ID + "/instantiate"));
+ assertThat(result.getLinks().getInstantiate()).isEqualTo(expectedVnfInstancesLinksSelfInstantiate);
+ }
+
+}