From 38f720752af4d4aad8c4e467a288d9048659f688 Mon Sep 17 00:00:00 2001
From: Rob Daugherty
Date: Wed, 14 Mar 2018 02:07:32 -0400
Subject: AT&T 1712 and 1802 release code
This is code from AT&T's 1712 and 1802 releases.
Change-Id: Ie1e85851e94bc66c4d9514a0226c221939531a04
Issue-ID: SO-425
Signed-off-by: Rob Daugherty
---
.../scripts/CreateCustomE2EServiceInstance.groovy | 642 +++---
.../CreateGenericALaCarteServiceInstance.groovy | 96 +-
.../scripts/CreateNetworkInstance.groovy | 24 +-
.../scripts/CreateSDNCNetworkResource.groovy | 8 +-
.../scripts/CreateVFCNSResource.groovy | 31 +-
.../scripts/CreateVfModuleInfra.groovy | 27 +-
.../scripts/CreateVfModuleVolumeInfraV1.groovy | 28 +-
.../infrastructure/scripts/CreateVnfInfra.groovy | 81 +-
.../scripts/DeleteCustomE2EServiceInstance.groovy | 96 +-
.../DeleteGenericALaCarteServiceInstance.groovy | 18 +-
.../scripts/DeleteNetworkInstance.groovy | 22 +-
.../scripts/DeleteVfModuleInfra.groovy | 21 +-
.../scripts/DeleteVfModuleVolumeInfraV1.groovy | 28 +-
.../infrastructure/scripts/DeleteVnfInfra.groovy | 10 +-
.../scripts/DoCreateE2EServiceInstance.groovy | 22 +-
.../DoCreateE2EServiceInstanceRollback.groovy | 12 +-
.../scripts/DoCreateE2EServiceInstanceV2.groovy | 57 +-
.../scripts/DoCreateNetworkInstance.groovy | 74 +-
.../scripts/DoCreateNetworkInstanceRollback.groovy | 12 +-
.../scripts/DoCreateServiceInstance.groovy | 290 ++-
.../scripts/DoCreateServiceInstanceRollback.groovy | 12 +-
.../DoCreateServiceInstanceRollbackV2.groovy | 51 +
.../scripts/DoCreateServiceInstanceV2.groovy | 101 +
.../infrastructure/scripts/DoCreateVfModule.groovy | 316 ++-
.../scripts/DoCreateVfModuleRollback.groovy | 50 +-
.../scripts/DoCreateVfModuleVolumeRollback.groovy | 12 +-
.../scripts/DoCreateVfModuleVolumeV2.groovy | 84 +-
.../bpmn/infrastructure/scripts/DoCreateVnf.groovy | 67 +-
.../scripts/DoCreateVnfAndModules.groovy | 21 +-
.../scripts/DoCreateVnfAndModulesRollback.groovy | 25 +-
.../DoCustomDeleteE2EServiceInstance.groovy | 20 +-
.../DoCustomDeleteE2EServiceInstanceV2.groovy | 66 +-
.../scripts/DoDeleteNetworkInstance.groovy | 44 +-
.../scripts/DoDeleteNetworkInstanceRollback.groovy | 10 +-
.../scripts/DoDeleteServiceInstance.groovy | 100 +-
.../DoDeleteVFCNetworkServiceInstance.groovy | 22 +-
.../infrastructure/scripts/DoDeleteVfModule.groovy | 112 +-
.../scripts/DoDeleteVfModuleFromVnf.groovy | 28 +-
.../scripts/DoDeleteVfModuleVolumeV2.groovy | 16 +-
.../bpmn/infrastructure/scripts/DoDeleteVnf.groovy | 6 +-
.../scripts/DoDeleteVnfAndModules.groovy | 94 +-
.../scripts/DoUpdateE2EServiceInstance.groovy | 24 +-
.../scripts/DoUpdateNetworkInstance.groovy | 62 +-
.../scripts/DoUpdateNetworkInstanceRollback.groovy | 10 +-
.../infrastructure/scripts/DoUpdateVfModule.groovy | 78 +-
.../scripts/DoUpdateVnfAndModules.groovy | 39 +-
.../scripts/HealchCheckActivate.groovy | 6 +-
.../infrastructure/scripts/ReplaceVnfInfra.groovy | 380 ++--
.../bpmn/infrastructure/scripts/RollbackVnf.groovy | 153 ++
.../scripts/UpdateCustomE2EServiceInstance.groovy | 12 +-
.../scripts/UpdateNetworkInstance.groovy | 24 +-
.../infrastructure/scripts/UpdateVfModule.groovy | 16 +-
.../scripts/UpdateVfModuleInfra.groovy | 20 +-
.../scripts/UpdateVfModuleInfraV2.groovy | 41 +-
.../scripts/UpdateVfModuleVolume.groovy | 20 +-
.../scripts/UpdateVfModuleVolumeInfraV1.groovy | 28 +-
.../infrastructure/scripts/UpdateVnfInfra.groovy | 395 +---
.../bpmn/infrastructure/scripts/VnfCmBase.groovy | 806 +++++++
.../infrastructure/scripts/VnfConfigUpdate.groovy | 503 +++++
.../infrastructure/scripts/VnfInPlaceUpdate.groovy | 622 ++++++
.../vcpe/scripts/CreateVcpeResCustService.groovy | 1482 ++++++-------
.../vcpe/scripts/DeleteVcpeResCustService.groovy | 26 +-
.../scripts/DoCreateAllottedResourceBRG.groovy | 36 +-
.../DoCreateAllottedResourceBRGRollback.groovy | 16 +-
.../scripts/DoCreateAllottedResourceTXC.groovy | 36 +-
.../DoCreateAllottedResourceTXCRollback.groovy | 16 +-
.../scripts/DoDeleteAllottedResourceBRG.groovy | 26 +-
.../scripts/DoDeleteAllottedResourceTXC.groovy | 26 +-
.../AAITasks/AAICreateOwningEntity.java | 50 +
.../infrastructure/AAITasks/AAICreateProject.java | 50 +
.../AAITasks/AAICreateServiceInstance.java | 50 +
.../RollbackAAIServiceInstance.java | 56 +
.../DoCreateServiceInstance/RollbackError.java | 38 +
.../SetupServiceDecomp.java | 112 +
.../MSOInfrastructureApplication.java | 2 +-
.../SDNCTasks/SDNCCreateServiceInstance.java | 49 +
.../infrastructure/aai/AAICreateResources.java | 84 +
.../aai/AAIDeleteServiceInstance.java | 49 +
.../infrastructure/aai/AAIServiceInstance.java | 94 +
.../SdncNetworkTopologyOperationTask.java | 4 +-
.../SdncServiceTopologyOperationTask.java | 11 +-
.../serviceTask/SdncUnderlayVpnPreprocessTask.java | 2 +-
.../src/main/resources/META-INF/persistence.xml | 2 +-
.../process/CreateCustomE2EServiceInstance.bpmn | 9 +-
.../CreateGenericALaCarteServiceInstance.bpmn | 281 ++-
.../resources/process/CreateNetworkInstance.bpmn | 55 +-
.../resources/process/CreateVFCNSResource.bpmn | 8 +-
.../process/CreateVcpeResCustService.bpmn | 3 +-
.../resources/process/CreateVfModuleInfra.bpmn | 1 +
.../src/main/resources/process/CreateVnfInfra.bpmn | 78 +-
.../process/DeleteCustomE2EServiceInstance.bpmn | 74 +-
.../resources/process/DeleteNetworkInstance.bpmn | 264 +--
.../resources/process/DeleteVfModuleInfra.bpmn | 1 +
.../main/resources/process/ReplaceVnfInfra.bpmn | 1705 ++++++++++-----
.../src/main/resources/process/UpdateVnfInfra.bpmn | 1563 ++++++++-----
.../main/resources/process/VnfConfigUpdate.bpmn | 1631 ++++++++++++++
.../main/resources/process/VnfInPlaceUpdate.bpmn | 2290 ++++++++++++++++++++
.../subprocess/CreateServiceInstanceV3.bpmn | 146 ++
.../CreateServiceInstanceV3Rollback.bpmn | 97 +
.../subprocess/DoCreateServiceInstance.bpmn | 252 ++-
.../DoCreateServiceInstanceRollback.bpmn | 68 +-
.../DoCreateServiceInstanceRollbackV2.bpmn | 103 +
.../subprocess/DoCreateServiceInstanceV2.bpmn | 197 ++
.../resources/subprocess/DoCreateVfModule.bpmn | 856 ++++++--
.../subprocess/DoCreateVfModuleRollback.bpmn | 255 ++-
.../subprocess/DoCreateVfModuleVolumeV2.bpmn | 4 +-
.../src/main/resources/subprocess/DoCreateVnf.bpmn | 1 +
.../subprocess/DoCreateVnfAndModules.bpmn | 4 +-
.../subprocess/DoCreateVnfAndModulesRollback.bpmn | 3 +-
.../DoCustomDeleteE2EServiceInstance.bpmn | 2 +-
.../subprocess/DoDeleteServiceInstance.bpmn | 14 +-
.../resources/subprocess/DoDeleteVfModule.bpmn | 228 +-
.../subprocess/DoDeleteVnfAndModules.bpmn | 2 +
.../subprocess/DoUpdateVnfAndModules.bpmn | 1 +
.../src/main/resources/subprocess/RollbackVnf.bpmn | 343 +++
.../subprocess/SetRefactorServiceDecomp.bpmn | 68 +
.../src/main/webapp/WEB-INF/web.xml | 9 +-
...CreateGenericAlaCarteServiceInstanceTest.groovy | 8 +-
.../scripts/CreateNetworkInstanceTest.groovy | 20 +-
.../DeleteCustomE2EServiceInstanceTest.groovy | 3 +-
...DeleteGenericAlaCarteServiceInstanceTest.groovy | 6 +-
.../scripts/DeleteNetworkInstanceTest.groovy | 16 +-
.../DoCreateNetworkInstanceRollbackTest.groovy | 16 +-
.../scripts/DoCreateNetworkInstanceTest.groovy | 447 +++-
.../scripts/DoCreateVfModuleVolumeV2Test.groovy | 93 +
.../DoCustomDeleteE2EServiceInstanceTest.groovy | 2 +-
.../DoDeleteNetworkInstanceRollbackTest.groovy | 646 +++---
.../scripts/DoDeleteNetworkInstanceTest.groovy | 48 +-
.../DoUpdateNetworkInstanceRollbackTest.groovy | 630 +++---
.../scripts/DoUpdateNetworkInstanceTest.groovy | 182 +-
.../scripts/UpdateNetworkInstanceTest.groovy | 20 +-
.../scripts/CreateVcpeResCustServiceTest.groovy | 5 +-
.../scripts/DeleteVcpeResCustServiceTest.groovy | 1 -
.../DoCreateAllottedResourceBRGRollbackTest.groovy | 1 -
.../scripts/DoCreateAllottedResourceBRGTest.groovy | 1 -
.../DoCreateAllottedResourceTXCRollbackTest.groovy | 1 -
.../scripts/DoCreateAllottedResourceTXCTest.groovy | 1 -
.../scripts/DoDeleteAllottedResourceBRGTest.groovy | 1 -
.../scripts/DoDeleteAllottedResourceTXCTest.groovy | 1 -
.../mso/bpmn/vcpe/scripts/GroovyTestBase.groovy | 1 -
.../CreateGenericALaCarteServiceInstanceTest.java | 10 +-
.../infrastructure/CreateNetworkInstanceTest.java | 12 +-
.../infrastructure/CreateVfModuleInfraTest.java | 57 +
.../bpmn/infrastructure/CreateVnfInfraTest.java | 2 +
.../infrastructure/DeleteNetworkInstanceTest.java | 6 +-
.../infrastructure/DeleteVfModuleInfraTest.java | 76 +-
.../infrastructure/DoCreateSIRollbackTest.java | 8 +-
.../DoCreateServiceInstanceTest.java | 18 +-
.../DoCreateServiceInstanceV2Test.java | 109 +
.../DoCreateServiceInstanceV3Test.java | 70 +
.../bpmn/infrastructure/DoCreateVfModuleTest.java | 183 +-
.../infrastructure/DoCreateVnfAndModulesTest.java | 4 +-
.../mso/bpmn/infrastructure/DoCreateVnfTest.java | 3 +
.../bpmn/infrastructure/DoDeleteVfModuleTest.java | 79 +-
.../infrastructure/DoDeleteVnfAndModulesTest.java | 144 +-
.../bpmn/infrastructure/DoUpdateVfModuleTest.java | 13 +
.../infrastructure/DoUpdateVnfAndModulesTest.java | 2 +-
.../bpmn/infrastructure/ReplaceVnfInfraTest.java | 27 +-
.../mso/bpmn/infrastructure/RollbackVnfTest.java | 134 ++
.../infrastructure/SetupServiceDecompTest.java | 65 +
.../infrastructure/UpdateNetworkInstanceTest.java | 13 +-
.../bpmn/infrastructure/UpdateVnfInfraTest.java | 21 +-
.../bpmn/infrastructure/VnfConfigUpdateTest.java | 146 ++
.../bpmn/infrastructure/VnfInPlaceUpdateTest.java | 159 ++
.../bpmn/vcpe/CreateVcpeResCustServiceTest.java | 5 +
.../AAI/AAI_defaultCloudRegionByCloudRegionId.json | 12 +
.../__files/AAI/AAI_genericVnfsByVnfId.json | 108 +-
.../src/test/resources/__files/AAI/mockObject.json | 10 +
.../test/resources/__files/APPC/appc_error.json | 21 +
.../CreateNetworkV2/createNetworkResponse_500.xml | 136 +-
...eNetwork_queryNetworkId_AAIResponse_Success.xml | 15 +
...ork_queryVpnBindingList_AAIResponse_Success.xml | 57 +
.../DoCreateServiceInstanceInput.json | 42 +
.../SetupServiceDecompJson.json | 33 +
.../createVfModuleVolume_VID_request.json | 9 +-
.../__files/CreateVfModule_VID_request.json | 137 +-
.../CreateVfModule_VID_request_noPreloads.json | 152 +-
.../CreateVfModule_VID_request_userParam.json | 77 +
.../createVfModuleVolume_VID_request.json | 72 +-
.../InfrastructureFlows/ConfigVnf_VID_request.json | 39 +
.../InfrastructureFlows/CreateVnfInfraRequest.json | 9 +-
.../DoCreateServiceInstance_request.json | 186 ++
.../UpdateVfModule_VID_request.json | 117 +-
.../InfrastructureFlows/UpdateVnf_VID_request.json | 10 +-
.../VnfInPlaceUpdate_VID_request.json | 16 +
.../UpdateNetworkV2/updateNetworkResponse_500.xml | 136 +-
...ork_queryVpnBindingList_AAIResponse_Success.xml | 57 +
.../SDNCTopologyQueryBRGCallback.xml | 4 +-
.../SDNCTopologyQueryTXCCallback.xml | 4 +-
.../VCPE/DeleteVcpeResCustService/request.json | 11 +-
.../SDNCTopologyQueryCallback.xml | 4 +-
.../sdncActivateRollbackReq.xml | 6 +-
.../sdncAssignRollbackReq.xml | 6 +-
.../sdncCreateRollbackReq.xml | 6 +-
.../SDNCTopologyQueryCallback.xml | 4 +-
.../sdncActivateRollbackReq.xml | 6 +-
.../sdncAssignRollbackReq.xml | 6 +-
.../sdncCreateRollbackReq.xml | 6 +-
.../VIPR/getCatalogServiceResourcesData.json | 94 +
...alogServiceResourcesDataForReplaceVnfInfra.json | 5 +
...talogServiceResourcesDataForUpdateVnfInfra.json | 5 +
.../resources/__files/VIPR/getCatalogVnfData.json | 44 +
.../VIPR/getCatalogVnfNoTwoPhasedForVfModule.json | 44 +
.../VIPR/getCatalogVnfYesTwoPhasedForVfModule.json | 44 +
.../VfModularity/DoUpdateVfModuleRequest.xml | 29 +
.../SDNCTopologyQueryCallbackVfModuleNoVnf.xml | 9 +-
.../VfModularity/SDNCTopologyQueryCallbackVnf.xml | 6 +-
.../VfModule-new-PendingActivation.xml | 9 +
.../src/test/resources/camunda.cfg.xml | 15 -
.../src/test/resources/mso.bpmn.urn.properties | 17 +-
210 files changed, 18638 insertions(+), 5741 deletions(-)
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollbackV2.groovy
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceV2.groovy
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/RollbackVnf.groovy
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfCmBase.groovy
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateOwningEntity.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateProject.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateServiceInstance.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/RollbackAAIServiceInstance.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/RollbackError.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/SetupServiceDecomp.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/SDNCTasks/SDNCCreateServiceInstance.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAICreateResources.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIServiceInstance.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/resources/process/VnfConfigUpdate.bpmn
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/resources/process/VnfInPlaceUpdate.bpmn
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/CreateServiceInstanceV3.bpmn
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/CreateServiceInstanceV3Rollback.bpmn
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateServiceInstanceRollbackV2.bpmn
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoCreateServiceInstanceV2.bpmn
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/RollbackVnf.bpmn
create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/SetRefactorServiceDecomp.bpmn
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2Test.groovy
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceV2Test.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstanceV3Test.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/RollbackVnfTest.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/SetupServiceDecompTest.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfConfigUpdateTest.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/java/org/openecomp/mso/bpmn/infrastructure/VnfInPlaceUpdateTest.java
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/AAI_defaultCloudRegionByCloudRegionId.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/AAI/mockObject.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/APPC/appc_error.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateNetworkV2/createNetwork_queryVpnBindingList_AAIResponse_Success.xml
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/DoCreateServiceInstanceInput.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateServiceInstance/SetupServiceDecompJson.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/CreateVfModule_VID_request_userParam.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/ConfigVnf_VID_request.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/DoCreateServiceInstance_request.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/InfrastructureFlows/VnfInPlaceUpdate_VID_request.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/UpdateNetworkV2/updateNetwork_queryVpnBindingList_AAIResponse_Success.xml
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogServiceResourcesData.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfData.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfNoTwoPhasedForVfModule.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VIPR/getCatalogVnfYesTwoPhasedForVfModule.json
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/DoUpdateVfModuleRequest.xml
create mode 100644 bpmn/MSOInfrastructureBPMN/src/test/resources/__files/VfModularity/VfModule-new-PendingActivation.xml
(limited to 'bpmn/MSOInfrastructureBPMN/src')
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
index 450c5b1147..1464aedc5c 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy
@@ -1,321 +1,341 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.mso.bpmn.infrastructure.scripts;
-
-import static org.apache.commons.lang3.StringUtils.*;
-import groovy.xml.XmlUtil
-import groovy.json.*
-import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
-
-import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.bpmn.core.json.JsonUtils
-import org.openecomp.mso.rest.APIResponse
-
-import java.util.List;
-import java.util.UUID;
-
-import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
-import org.apache.commons.lang3.*
-import org.apache.commons.codec.binary.Base64;
-import org.springframework.web.util.UriUtils
-
-/**
- * This groovy class supports the CreateServiceInstance.bpmn process.
- * AlaCarte flow for 1702 ServiceInstance Create
- *
- */
-public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor {
- String Prefix="CRESI_"
- ExceptionUtil exceptionUtil = new ExceptionUtil()
- JsonUtils jsonUtil = new JsonUtils()
-
-
- public void preProcessRequest (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- execution.setVariable("prefix",Prefix)
- String msg = ""
- utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)
-
- try {
-
- String siRequest = execution.getVariable("bpmnRequest")
- utils.logAudit(siRequest)
-
- String requestId = execution.getVariable("mso-request-id")
- execution.setVariable("msoRequestId", requestId)
- utils.log("INFO", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)
-
- String serviceInstanceId = execution.getVariable("serviceInstanceId")
- if (isBlank(serviceInstanceId)) {
- serviceInstanceId = UUID.randomUUID().toString()
- }
- utils.log("INFO", "Generated new Service Instance:" + serviceInstanceId, isDebugEnabled)
- serviceInstanceId = UriUtils.encode(serviceInstanceId,"UTF-8")
- execution.setVariable("serviceInstanceId", serviceInstanceId)
-
- //subscriberInfo
- String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "requestDetails.subscriberInfo.globalSubscriberId")
- if (isBlank(globalSubscriberId)) {
- msg = "Input globalSubscriberId' is null"
- exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
- } else {
- execution.setVariable("globalSubscriberId", globalSubscriberId)
- }
-
- //requestInfo
- execution.setVariable("source", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.source"))
- execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.instanceName"))
- execution.setVariable("disableRollback", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.suppressRollback"))
- String productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId")
- if (isBlank(productFamilyId))
- {
- msg = "Input productFamilyId is null"
- utils.log("INFO", msg, isDebugEnabled)
- //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
- } else {
- execution.setVariable("productFamilyId", productFamilyId)
- }
- String userParams = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams")
- utils.log("INFO", "userParams:" + userParams, isDebugEnabled)
- List paramList = jsonUtil.StringArrayToList(execution, userParams)
- String uuiRequest = jsonUtil.getJsonValue(paramList.get(0), "UUIRequest")
- //modelInfo
- if (isBlank(uuiRequest)) {
- msg = "Input uuiRequest is null"
- utils.log("INFO", msg, isDebugEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
- } else
- {
- execution.setVariable("uuiRequest", uuiRequest)
- }
-
- utils.log("INFO", "uuiRequest:\n" + uuiRequest, isDebugEnabled)
-
- //requestParameters
- String serviceType = jsonUtil.getJsonValue(uuiRequest, "service.parameters.serviceType")
- if (isBlank(serviceType)) {
- msg = "Input serviceType is null"
- utils.log("INFO", msg, isDebugEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
- } else {
- execution.setVariable("serviceType", serviceType)
- }
- execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
-
- } catch (BpmnError e) {
- throw e;
- } catch (Exception ex){
- msg = "Exception in preProcessRequest " + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
- }
- utils.log("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled)
- }
-
- public void sendSyncResponse (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", " *** sendSyncResponse *** ", isDebugEnabled)
-
- try {
- String operationId = execution.getVariable("operationId")
- String serviceInstanceId = execution.getVariable("serviceInstanceId")
- // RESTResponse for API Handler (APIH) Reply Task
- String createServiceRestRequest = """{"service":{"serviceId":"${serviceInstanceId}","operationId":"${operationId}"}}""".trim()
- utils.log("INFO", " sendSyncResponse to APIH:" + "\n" + createServiceRestRequest, isDebugEnabled)
- sendWorkflowResponse(execution, 202, createServiceRestRequest)
- execution.setVariable("sentSyncResponse", true)
-
- } catch (Exception ex) {
- String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
- }
- utils.log("INFO"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
- }
-
-
- public void sendSyncError (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", " *** sendSyncError *** ", isDebugEnabled)
-
- try {
- String errorMessage = ""
- if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
- WorkflowException wfe = execution.getVariable("WorkflowException")
- errorMessage = wfe.getErrorMessage()
- } else {
- errorMessage = "Sending Sync Error."
- }
-
- String buildworkflowException =
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.bpmn.infrastructure.scripts;
+
+import static org.apache.commons.lang3.StringUtils.*;
+import groovy.xml.XmlUtil
+import groovy.json.*
+import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
+
+import org.openecomp.mso.bpmn.core.WorkflowException
+import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.openecomp.mso.rest.APIResponse
+
+import java.util.UUID;
+
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.apache.commons.lang3.*
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.web.util.UriUtils
+
+/**
+ * This groovy class supports the CreateServiceInstance.bpmn process.
+ * AlaCarte flow for 1702 ServiceInstance Create
+ *
+ */
+public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor {
+ String Prefix="CRESI_"
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+ JsonUtils jsonUtil = new JsonUtils()
+
+
+ public void preProcessRequest (DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ execution.setVariable("prefix",Prefix)
+ String msg = ""
+ utils.log("DEBUG", " *** preProcessRequest() *** ", isDebugEnabled)
+
+ try {
+
+ String siRequest = execution.getVariable("bpmnRequest")
+ utils.logAudit(siRequest)
+
+ String requestId = execution.getVariable("mso-request-id")
+ execution.setVariable("msoRequestId", requestId)
+ utils.log("DEBUG", "Input Request:" + siRequest + " reqId:" + requestId, isDebugEnabled)
+
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ if (isBlank(serviceInstanceId)) {
+ serviceInstanceId = UUID.randomUUID().toString()
+ }
+ utils.log("DEBUG", "Generated new Service Instance:" + serviceInstanceId, isDebugEnabled)
+ serviceInstanceId = UriUtils.encode(serviceInstanceId,"UTF-8")
+ execution.setVariable("serviceInstanceId", serviceInstanceId)
+
+ //subscriberInfo
+ String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "requestDetails.subscriberInfo.globalSubscriberId")
+ if (isBlank(globalSubscriberId)) {
+ msg = "Input globalSubscriberId' is null"
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ } else {
+ execution.setVariable("globalSubscriberId", globalSubscriberId)
+ }
+
+ //requestInfo
+ execution.setVariable("source", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.source"))
+ execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.instanceName"))
+ execution.setVariable("disableRollback", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.suppressRollback"))
+ String productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId")
+ if (isBlank(productFamilyId))
+ {
+ msg = "Input productFamilyId is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ } else {
+ execution.setVariable("productFamilyId", productFamilyId)
+ }
+
+ //modelInfo
+ String serviceModelInfo = jsonUtil.getJsonValue(siRequest, "requestDetails.modelInfo")
+ if (isBlank(serviceModelInfo)) {
+ msg = "Input serviceModelInfo is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ } else
+ {
+ execution.setVariable("serviceModelInfo", serviceModelInfo)
+ }
+
+ utils.log("DEBUG", "modelInfo" + serviceModelInfo, isDebugEnabled)
+
+ //requestParameters
+ String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.subscriptionServiceType")
+ if (isBlank(subscriptionServiceType)) {
+ msg = "Input subscriptionServiceType is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ } else {
+ execution.setVariable("subscriptionServiceType", subscriptionServiceType)
+ }
+
+
+ /*
+ * Extracting User Parameters from incoming Request and converting into a Map
+ */
+ def jsonSlurper = new JsonSlurper()
+ def jsonOutput = new JsonOutput()
+
+ Map reqMap = jsonSlurper.parseText(siRequest)
+
+ //InputParams
+ def userParams = reqMap.requestDetails?.requestParameters?.userParams
+
+ Map inputMap = [:]
+ if (userParams) {
+ userParams.each {
+ userParam -> inputMap.put(userParam.name, userParam.value.toString())
+ }
+ }
+
+ utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
+ execution.setVariable("serviceInputParams", inputMap)
+ execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
+ //TODO
+ //execution.setVariable("serviceInputParams", jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams"))
+ //execution.setVariable("failExists", true)
+
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception ex){
+ msg = "Exception in preProcessRequest " + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
+ }
+
+ public void sendSyncResponse (DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
+
+ try {
+ String operationId = execution.getVariable("operationId")
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ // RESTResponse for API Handler (APIH) Reply Task
+ String createServiceRestRequest = """{"service":{"serviceId":"${serviceInstanceId}","operationId":"${operationId}"}}""".trim()
+ utils.log("DEBUG", " sendSyncResponse to APIH:" + "\n" + createServiceRestRequest, isDebugEnabled)
+ sendWorkflowResponse(execution, 202, createServiceRestRequest)
+ execution.setVariable("sentSyncResponse", true)
+
+ } catch (Exception ex) {
+ String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
+ }
+
+
+ public void sendSyncError (DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " *** sendSyncError *** ", isDebugEnabled)
+
+ try {
+ String errorMessage = ""
+ if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
+ WorkflowException wfe = execution.getVariable("WorkflowException")
+ errorMessage = wfe.getErrorMessage()
+ } else {
+ errorMessage = "Sending Sync Error."
+ }
+
+ String buildworkflowException =
"""
- ${errorMessage}
- 7000
- """
-
- utils.logAudit(buildworkflowException)
- sendWorkflowResponse(execution, 500, buildworkflowException)
-
- } catch (Exception ex) {
- utils.log("INFO", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled)
- }
-
- }
-
- public void prepareCompletionRequest (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", " *** prepareCompletion *** ", isDebugEnabled)
-
- try {
- String requestId = execution.getVariable("msoRequestId")
- String serviceInstanceId = execution.getVariable("serviceInstanceId")
- String source = execution.getVariable("source")
-
- String msoCompletionRequest =
+ ${errorMessage}
+ 7000
+ """
+
+ utils.logAudit(buildworkflowException)
+ sendWorkflowResponse(execution, 500, buildworkflowException)
+
+ } catch (Exception ex) {
+ utils.log("DEBUG", " Sending Sync Error Activity Failed. " + "\n" + ex.getMessage(), isDebugEnabled)
+ }
+
+ }
+
+ public void prepareCompletionRequest (DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " *** prepareCompletion *** ", isDebugEnabled)
+
+ try {
+ String requestId = execution.getVariable("msoRequestId")
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ String source = execution.getVariable("source")
+
+ String msoCompletionRequest =
"""
- ${requestId}
- CREATE
- ${source}
-
- Service Instance was created successfully.
- ${serviceInstanceId}
- CreateGenericALaCarteServiceInstance
- """
-
- // Format Response
- String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
-
- execution.setVariable("completionRequest", xmlMsoCompletionRequest)
- utils.log("INFO", " Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
-
- } catch (Exception ex) {
- String msg = " Exception in prepareCompletion:" + ex.getMessage()
- utils.log("INFO", msg, isDebugEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
- }
- utils.log("INFO", "*** Exit prepareCompletionRequest ***", isDebugEnabled)
- }
-
- public void prepareFalloutRequest(Execution execution){
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", " *** prepareFalloutRequest *** ", isDebugEnabled)
-
- try {
- WorkflowException wfex = execution.getVariable("WorkflowException")
- utils.log("INFO", " Input Workflow Exception: " + wfex.toString(), isDebugEnabled)
- String requestId = execution.getVariable("msoRequestId")
- String source = execution.getVariable("source")
- String requestInfo =
+ ${requestId}
+ CREATE
+ ${source}
+
+ Service Instance was created successfully.
+ ${serviceInstanceId}
+ CreateGenericALaCarteServiceInstance
+ """
+
+ // Format Response
+ String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
+
+ execution.setVariable("completionRequest", xmlMsoCompletionRequest)
+ utils.log("DEBUG", " Overall SUCCESS Response going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
+
+ } catch (Exception ex) {
+ String msg = " Exception in prepareCompletion:" + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG", "*** Exit prepareCompletionRequest ***", isDebugEnabled)
+ }
+
+ public void prepareFalloutRequest(DelegateExecution execution){
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " *** prepareFalloutRequest *** ", isDebugEnabled)
+
+ try {
+ WorkflowException wfex = execution.getVariable("WorkflowException")
+ utils.log("DEBUG", " Input Workflow Exception: " + wfex.toString(), isDebugEnabled)
+ String requestId = execution.getVariable("msoRequestId")
+ String source = execution.getVariable("source")
+ String requestInfo =
"""
- ${requestId}
- CREATE
- ${source}
- """
-
- String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
- execution.setVariable("falloutRequest", falloutRequest)
- } catch (Exception ex) {
- utils.log("INFO", "Exception prepareFalloutRequest:" + ex.getMessage(), isDebugEnabled)
- String errorException = " Bpmn error encountered in CreateGenericALaCarteServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
- String requestId = execution.getVariable("msoRequestId")
- String falloutRequest =
+ ${requestId}
+ CREATE
+ ${source}
+ """
+
+ String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
+ execution.setVariable("falloutRequest", falloutRequest)
+ } catch (Exception ex) {
+ utils.log("DEBUG", "Exception prepareFalloutRequest:" + ex.getMessage(), isDebugEnabled)
+ String errorException = " Bpmn error encountered in CreateGenericALaCarteServiceInstance flow. FalloutHandlerRequest, buildErrorResponse() - " + ex.getMessage()
+ String requestId = execution.getVariable("msoRequestId")
+ String falloutRequest =
"""
- ${requestId}
- CREATE
- UUI
-
+ ${requestId}
+ CREATE
+ UUI
+
- ${errorException}
- 7000
-
- """
-
- execution.setVariable("falloutRequest", falloutRequest)
- }
- utils.log("INFO", "*** Exit prepareFalloutRequest ***", isDebugEnabled)
- }
-
- /**
- * Init the service Operation Status
- */
- public void prepareInitServiceOperationStatus(Execution execution){
- def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
- utils.log("INFO", " ======== STARTED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
- try{
- String serviceId = execution.getVariable("serviceInstanceId")
- String operationId = UUID.randomUUID().toString()
- String serviceName = execution.getVariable("serviceInstanceName")
- String operationType = "CREATE"
- String userId = ""
- String result = "processing"
- String progress = "0"
- String reason = ""
- String operationContent = "Prepare service creation"
- utils.log("INFO", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)
- serviceId = UriUtils.encode(serviceId,"UTF-8")
- execution.setVariable("serviceInstanceId", serviceId)
- execution.setVariable("operationId", operationId)
- execution.setVariable("operationType", operationType)
-
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
- execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
- utils.log("INFO", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
-
- String payload =
- """
-
-
-
- ${serviceId}
- ${operationId}
- ${serviceName}
- ${operationType}
- ${userId}
- ${result}
- ${operationContent}
-
- ${reason}
-
-
- """
-
- payload = utils.formatXml(payload)
- execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
- utils.log("INFO", "Outgoing updateServiceOperStatusRequest: \n" + payload, isDebugEnabled)
- utils.logAudit("CreateVfModuleInfra Outgoing updateServiceOperStatusRequest Request: " + payload)
-
- }catch(Exception e){
- utils.log("ERROR", "Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e, isDebugEnabled)
- execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
- }
- utils.log("INFO", "======== COMPLETED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
- }
-
-}
+ ${errorException}
+ 7000
+
+ """
+
+ execution.setVariable("falloutRequest", falloutRequest)
+ }
+ utils.log("DEBUG", "*** Exit prepareFalloutRequest ***", isDebugEnabled)
+ }
+
+ /**
+ * Init the service Operation Status
+ */
+ public void prepareInitServiceOperationStatus(DelegateExecution execution){
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " ======== STARTED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
+ try{
+ String serviceId = execution.getVariable("serviceInstanceId")
+ String operationId = UUID.randomUUID().toString()
+ String operationType = "CREATE"
+ String userId = ""
+ String result = "processing"
+ String progress = "0"
+ String reason = ""
+ String operationContent = "Prepare service creation"
+ utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)
+ serviceId = UriUtils.encode(serviceId,"UTF-8")
+ execution.setVariable("serviceInstanceId", serviceId)
+ execution.setVariable("operationId", operationId)
+ execution.setVariable("operationType", operationType)
+
+ def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
+ utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
+
+ String payload =
+ """
+
+
+
+ ${serviceId}
+ ${operationId}
+ ${operationType}
+ ${userId}
+ ${result}
+ ${operationContent}
+
+ ${reason}
+
+
+ """
+
+ payload = utils.formatXml(payload)
+ execution.setVariable("CVFMI_updateServiceOperStatusRequest", payload)
+ utils.log("DEBUG", "Outgoing updateServiceOperStatusRequest: \n" + payload, isDebugEnabled)
+ utils.logAudit("CreateVfModuleInfra Outgoing updateServiceOperStatusRequest Request: " + payload)
+
+ }catch(Exception e){
+ utils.log("ERROR", "Exception Occured Processing prepareInitServiceOperationStatus. Exception is:\n" + e, isDebugEnabled)
+ execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during prepareInitServiceOperationStatus Method:\n" + e.getMessage())
+ }
+ utils.log("DEBUG", "======== COMPLETED prepareInitServiceOperationStatus Process ======== ", isDebugEnabled)
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
index 80d714893d..0de28f77ce 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
@@ -25,7 +25,7 @@ import groovy.xml.XmlUtil
import groovy.json.*
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
-import org.openecomp.mso.bpmn.common.scripts.VidUtils
+import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
import org.openecomp.mso.bpmn.core.WorkflowException
import org.openecomp.mso.bpmn.core.json.JsonUtils
import org.openecomp.mso.rest.APIResponse
@@ -33,7 +33,7 @@ import org.openecomp.mso.rest.APIResponse
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
@@ -48,13 +48,12 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String Prefix="CRESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- VidUtils vidUtils = new VidUtils()
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
- utils.log("DEBUG", " *** preProcessRequest() *** ", isDebugEnabled)
+ utils.log("DEBUG", " *** preProcessRequest() of CreateGenericALaCarteServiceInstance *** ", isDebugEnabled)
try {
@@ -68,8 +67,11 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
String serviceInstanceId = execution.getVariable("serviceInstanceId")
if (isBlank(serviceInstanceId)) {
serviceInstanceId = UUID.randomUUID().toString()
+ utils.log("DEBUG", "Generated new Service Instance ID:" + serviceInstanceId, isDebugEnabled)
+ } else {
+ utils.log("DEBUG", "Using provided Service Instance ID:" + serviceInstanceId, isDebugEnabled)
}
- utils.log("DEBUG", "Generated new Service Instance:" + serviceInstanceId, isDebugEnabled)
+
serviceInstanceId = UriUtils.encode(serviceInstanceId,"UTF-8")
execution.setVariable("serviceInstanceId", serviceInstanceId)
@@ -113,7 +115,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
}
utils.log("DEBUG", "modelInfo" + serviceModelInfo, isDebugEnabled)
-
+
//requestParameters
String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.subscriptionServiceType")
if (isBlank(subscriptionServiceType)) {
@@ -139,7 +141,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
Map inputMap = [:]
if (userParams) {
userParams.each {
- userParam -> inputMap.put(userParam.name, userParam.value)
+ userParam -> inputMap.put(userParam.name, userParam.value.toString())
}
}
@@ -156,10 +158,10 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
utils.log("DEBUG", msg, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
- utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
+ utils.log("DEBUG"," ***** Exit preProcessRequest of CreateGenericALaCarteServiceInstance *****", isDebugEnabled)
}
- public void sendSyncResponse (Execution execution) {
+ public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
@@ -181,7 +183,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
}
- public void sendSyncError (Execution execution) {
+ public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " *** sendSyncError *** ", isDebugEnabled)
@@ -209,7 +211,75 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
}
- public void prepareCompletionRequest (Execution execution) {
+ // *******************************
+ //
+ // *******************************
+ public void prepareDecomposeService(DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " ***** Inside prepareDecomposeService of CreateGenericALaCarteServiceInstance ***** ", isDebugEnabled)
+ try {
+ String siRequest = execution.getVariable("bpmnRequest")
+ String serviceModelInfo = jsonUtil.getJsonValue(siRequest, "requestDetails.modelInfo")
+ execution.setVariable("serviceModelInfo", serviceModelInfo)
+ } catch (Exception ex) {
+ // try error in method block
+ String exceptionMessage = "Bpmn error encountered in CreateGenericALaCarteServiceInstance flow. Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+ }
+ utils.log("DEBUG", " ***** Completed prepareDecomposeService of CreateGenericALaCarteServiceInstance ***** ", isDebugEnabled)
+ }
+
+
+ // *******************************
+ //
+ // *******************************
+ public void prepareCreateServiceInstance(DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+
+ try {
+ utils.log("DEBUG", " ***** Inside prepareCreateServiceInstance of CreateGenericALaCarteServiceInstance ***** ", isDebugEnabled)
+
+ /*
+ * Extracting User Parameters from incoming Request and converting into a Map
+ */
+ def jsonSlurper = new JsonSlurper()
+ def jsonOutput = new JsonOutput()
+ def siRequest = execution.getVariable("bpmnRequest")
+ Map reqMap = jsonSlurper.parseText(siRequest)
+ //InputParams
+ def userParams = reqMap.requestDetails?.requestParameters?.userParams
+ Map inputMap = [:]
+ if (userParams != null) {
+ userParams.each {
+ userParam -> inputMap.put(userParam.name, userParam.value)
+ }
+ }
+
+ utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
+ execution.setVariable("serviceInputParams", inputMap)
+
+ ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ serviceDecomposition.getServiceInstance().setInstanceId(serviceInstanceId)
+
+ String serviceInstanceName = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.instanceName")
+ serviceDecomposition.getServiceInstance().setInstanceName(serviceInstanceName)
+ execution.setVariable("serviceInstanceName", serviceInstanceName)
+ execution.setVariable("serviceDecomposition", serviceDecomposition)
+ execution.setVariable("serviceDecompositionString", serviceDecomposition.toJsonString())
+ utils.log("DEBUG", "serviceDecomposition.serviceInstanceName: " + serviceDecomposition.getServiceInstance().getInstanceName(), isDebugEnabled)
+
+ utils.log("DEBUG", " ***** Completed prepareCreateServiceInstance of CreateGenericALaCarteServiceInstance ***** ", isDebugEnabled)
+ } catch (Exception ex) {
+ // try error in method block
+ String exceptionMessage = "Bpmn error encountered in CreateGenericALaCarteServiceInstance flow. Unexpected Error from method prepareCreateServiceInstance() - " + ex.getMessage()
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
+ }
+ }
+
+
+ public void prepareCompletionRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " *** prepareCompletion *** ", isDebugEnabled)
@@ -245,7 +315,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
utils.log("DEBUG", "*** Exit prepareCompletionRequest ***", isDebugEnabled)
}
- public void prepareFalloutRequest(Execution execution){
+ public void prepareFalloutRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " *** prepareFalloutRequest *** ", isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy
index c37355ef3d..5f7d1e3452 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateNetworkInstance.groovy
@@ -31,7 +31,7 @@ import org.openecomp.mso.rest.APIResponse
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
@@ -45,7 +45,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- public InitializeProcessVariables(Execution execution){
+ public InitializeProcessVariables(DelegateExecution execution){
execution.setVariable(Prefix + "source", "")
execution.setVariable(Prefix + "Success", false)
@@ -69,7 +69,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
* This method is executed during the preProcessRequest task of the CreateNetworkInstance.bpmn process.
* @param execution
*/
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -154,7 +154,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
}
}
- public void sendSyncResponse (Execution execution) {
+ public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -178,7 +178,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void getNetworkModelInfo (Execution execution) {
+ public void getNetworkModelInfo (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -203,7 +203,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void sendSyncError (Execution execution) {
+ public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -224,7 +224,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareDBRequestError (Execution execution) {
+ public void prepareDBRequestError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -272,7 +272,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareCompletion (Execution execution) {
+ public void prepareCompletion (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -320,7 +320,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
// Post or Validate Response Section
// **************************************************
- public void postProcessResponse (Execution execution) {
+ public void postProcessResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -354,7 +354,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
// Build Error Section
// *******************************
- public void processRollbackData (Execution execution) {
+ public void processRollbackData (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -375,7 +375,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
}
// Prepare for FalloutHandler
- public void buildErrorResponse (Execution execution) {
+ public void buildErrorResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -436,7 +436,7 @@ public class CreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void processJavaException(Execution execution){
+ public void processJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
try{
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
index 400b0d40d5..d2d93d5568 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
@@ -32,7 +32,7 @@ import org.openecomp.mso.rest.APIResponse
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
@@ -60,7 +60,7 @@ public class CreateSDNCCNetworkResource extends AbstractServiceTaskProcessor {
* generate the nsOperationKey
* generate the nsParameters
*/
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String msg = ""
utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)
@@ -120,7 +120,7 @@ public class CreateSDNCCNetworkResource extends AbstractServiceTaskProcessor {
* url: the url of the request
* requestBody: the body of the request
*/
- private APIResponse postRequest(Execution execution, String url, String requestBody){
+ private APIResponse postRequest(DelegateExecution execution, String url, String requestBody){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** Started Execute VFC adapter Post Process *****", isDebugEnabled)
utils.log("INFO","url:"+url +"\nrequestBody:"+ requestBody, isDebugEnabled)
@@ -138,7 +138,7 @@ public class CreateSDNCCNetworkResource extends AbstractServiceTaskProcessor {
return apiResponse
}
- public void postCreateSDNCCall(Execution execution){
+ public void postCreateSDNCCall(DelegateExecution execution){
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
index 970a4f7d07..0279c2cbc8 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVFCNSResource.groovy
@@ -32,7 +32,7 @@ import org.openecomp.mso.rest.APIResponse
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
@@ -47,20 +47,21 @@ import org.openecomp.mso.rest.APIResponse;
public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
String vfcUrl = "/vfc/rest/v1/vfcadapter"
-
+
String host = "http://mso.mso.testlab.openecomp.org:8080"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
-
- /**CreateVFCNSResource
+
+ /**
+ * CreateVFCNSResource
* Pre Process the BPMN Flow Request
* Inclouds:
* generate the nsOperationKey
* generate the nsParameters
*/
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String msg = ""
utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)
@@ -117,7 +118,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
/**
* create NS task
*/
- public void createNetworkService(Execution execution) {
+ public void createNetworkService(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** createNetworkService *****", isDebugEnabled)
String nsOperationKey = execution.getVariable("nsOperationKey");
@@ -144,8 +145,8 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
/**
* instantiate NS task
*/
- public void instantiateNetworkService(Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ public void instantiateNetworkService(DelegateExecution execution) {
+ def isDebugEnabled= execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** instantiateNetworkService *****", isDebugEnabled)
String nsOperationKey = execution.getVariable("nsOperationKey");
String nsParameters = execution.getVariable("nsParameters");
@@ -173,7 +174,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
/**
* query NS task
*/
- public void queryNSProgress(Execution execution) {
+ public void queryNSProgress(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** queryNSProgress *****", isDebugEnabled)
String jobId = execution.getVariable("jobId")
@@ -193,8 +194,8 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
/**
* delay 5 sec
*/
- public void timeDelay(Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ public void timeDelay(DelegateExecution execution) {
+ def isDebugEnabled= execution.getVariable("isDebugLogEnabled")
try {
Thread.sleep(5000);
} catch(InterruptedException e) {
@@ -205,7 +206,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
/**
* finish NS task
*/
- public void addNSRelationship(Execution execution) {
+ public void addNSRelationship(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** addNSRelationship *****", isDebugEnabled)
String nsInstanceId = execution.getVariable("nsInstanceId")
@@ -241,7 +242,7 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
utils.log("INFO"," *****Exit addNSRelationship *****", isDebugEnabled)
}
- public APIResponse executeAAIPutCall(Execution execution, String url, String payload){
+ public APIResponse executeAAIPutCall(DelegateExecution execution, String url, String payload){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " ======== Started Execute AAI Put Process ======== ", isDebugEnabled)
APIResponse apiResponse = null
@@ -265,13 +266,13 @@ public class CreateVFCNSResource extends AbstractServiceTaskProcessor {
}
return apiResponse
}
-
+
/**
* post request
* url: the url of the request
* requestBody: the body of the request
*/
- private APIResponse postRequest(Execution execution, String url, String requestBody){
+ private APIResponse postRequest(DelegateExecution execution, String url, String requestBody){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** Started Execute VFC adapter Post Process *****", isDebugEnabled)
utils.log("INFO","url:"+url +"\nrequestBody:"+ requestBody, isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
index 37ff4944ff..3b2c4ea2f8 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleInfra.groovy
@@ -24,7 +24,7 @@ import groovy.json.JsonSlurper
import groovy.json.JsonOutput
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor;
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
@@ -44,7 +44,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
* Validates the request message and sets up the workflow.
* @param execution the execution
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessRequest(' +
'execution=' + execution.getId() +
')'
@@ -127,7 +127,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
Map userParamsMap = [:]
if (userParams != null) {
userParams.each { userParam ->
- userParamsMap.put(userParam.name, userParam.value)
+ userParamsMap.put(userParam.name, jsonOutput.toJson(userParam.value).toString())
}
}
@@ -171,6 +171,9 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
def usePreload = reqMap.requestDetails?.requestParameters?.usePreload
execution.setVariable(prefix + 'usePreload', usePreload)
+ // This is aLaCarte flow, so aLaCarte flag is always on
+ execution.setVariable(prefix + 'aLaCarte', true)
+
def cloudConfiguration = reqMap.requestDetails?.cloudConfiguration
def lcpCloudRegionId = cloudConfiguration.lcpCloudRegionId
execution.setVariable(prefix + 'lcpCloudRegionId', lcpCloudRegionId)
@@ -239,7 +242,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
* @param responseCodeVar the execution variable in which the response code is stored
* @param errorResponseVar the execution variable in which the error response is stored
*/
- public void validateWorkflowResponse(Execution execution, String responseVar,
+ public void validateWorkflowResponse(DelegateExecution execution, String responseVar,
String responseCodeVar, String errorResponseVar) {
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, responseVar, responseCodeVar, errorResponseVar)
@@ -250,7 +253,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
* Sends the empty, synchronous response back to the API Handler.
* @param execution the execution
*/
- public void sendResponse(Execution execution) {
+ public void sendResponse(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.sendResponse(' +
'execution=' + execution.getId() +
')'
@@ -283,7 +286,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
*
* @param execution the execution
*/
- public void postProcessResponse(Execution execution){
+ public void postProcessResponse(DelegateExecution execution){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " ======== STARTED PostProcessResponse Process ======== ", isDebugEnabled)
@@ -329,7 +332,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
* @param execution the execution
* @return the validated request
*/
- public String validateInfraRequest(Execution execution) {
+ public String validateInfraRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.validateInfraRequest(' +
'execution=' + execution.getId() +
')'
@@ -392,7 +395,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
}
}
- public void prepareUpdateInfraRequest(Execution execution){
+ public void prepareUpdateInfraRequest(DelegateExecution execution){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " ======== STARTED prepareUpdateInfraRequest Process ======== ", isDebugEnabled)
@@ -449,7 +452,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
* @param execution the execution
* @param resultVar the execution variable in which the result will be stored
*/
- public void falloutHandlerPrep(Execution execution, String resultVar) {
+ public void falloutHandlerPrep(DelegateExecution execution, String resultVar) {
def method = getClass().getSimpleName() + '.falloutHandlerPrep(' +
'execution=' + execution.getId() +
', resultVar=' + resultVar +
@@ -496,7 +499,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
}
}
- public void logAndSaveOriginalException(Execution execution) {
+ public void logAndSaveOriginalException(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.validateRollbackResponse(' +
'execution=' + execution.getId() +
')'
@@ -507,7 +510,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
saveWorkflowException(execution, 'CVFMI_originalWorkflowException')
}
- public void validateRollbackResponse(Execution execution) {
+ public void validateRollbackResponse(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.validateRollbackResponse(' +
'execution=' + execution.getId() +
')'
@@ -521,7 +524,7 @@ public class CreateVfModuleInfra extends AbstractServiceTaskProcessor {
}
- public void sendErrorResponse(Execution execution){
+ public void sendErrorResponse(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " *** STARTED CreateVfModulenfra sendErrorResponse Process *** ", isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1.groovy
index a881ed228b..49d67cb097 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVfModuleVolumeInfraV1.groovy
@@ -32,7 +32,7 @@ import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.apache.commons.lang3.*
class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
@@ -43,7 +43,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* Perform initial processing, such as request validation, initialization of variables, etc.
* * @param execution
*/
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
setBasicDBAuthHeader(execution, isDebugEnabled)
preProcessRequest(execution, isDebugEnabled)
@@ -55,7 +55,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugEnabled
*/
- public void preProcessRequest (Execution execution, isDebugEnabled) {
+ public void preProcessRequest (DelegateExecution execution, isDebugEnabled) {
execution.setVariable("prefix",prefix)
setSuccessIndicator(execution, false)
@@ -87,7 +87,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* @param serviceInstanceId
* @param isDebugLogEnabled
*/
- public void setupVariables(Execution execution, Map requestMap, isDebugLogEnabled) {
+ public void setupVariables(DelegateExecution execution, Map requestMap, isDebugLogEnabled) {
def jsonOutput = new JsonOutput()
@@ -142,7 +142,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
Map vfModuleInputMap = [:]
userParams.each { userParam ->
- vfModuleInputMap.put(userParam.name, userParam.value)
+ vfModuleInputMap.put(userParam.name, userParam.value.toString())
}
execution.setVariable('vfModuleInputParams', vfModuleInputMap)
@@ -155,7 +155,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
- public void sendSyncResponse (Execution execution, isDebugEnabled) {
+ public void sendSyncResponse (DelegateExecution execution, isDebugEnabled) {
def volumeGroupId = execution.getVariable('volumeGroupId')
def requestId = execution.getVariable("mso-request-id")
def serviceInstanceId = execution.getVariable("serviceInstanceId")
@@ -169,7 +169,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
}
- public void sendSyncError (Execution execution, isDebugEnabled) {
+ public void sendSyncError (DelegateExecution execution, isDebugEnabled) {
WorkflowException we = execution.getVariable('WorkflowException')
def errorCode = we?.getErrorCode()
def errorMessage = we?.getErrorMessage()
@@ -183,7 +183,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugEnabled
*/
- public void buildWorkflowException(Execution execution, int errorCode, errorMessage, isDebugEnabled) {
+ public void buildWorkflowException(DelegateExecution execution, int errorCode, errorMessage, isDebugEnabled) {
utils.log("DEBUG", errorMessage, isDebugEnabled)
(new ExceptionUtil()).buildWorkflowException(execution, 2500, errorMessage)
}
@@ -194,7 +194,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugEnabled
*/
- public void prepareDbInfraSuccessRequest(Execution execution, isDebugEnabled) {
+ public void prepareDbInfraSuccessRequest(DelegateExecution execution, isDebugEnabled) {
def dbVnfOutputs = execution.getVariable(prefix+'volumeOutputs')
def requestId = execution.getVariable('mso-request-id')
def statusMessage = "VolumeGroup successfully created."
@@ -237,7 +237,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugEnabled
*/
- public void postProcessResponse (Execution execution, isDebugEnabled) {
+ public void postProcessResponse (DelegateExecution execution, isDebugEnabled) {
def dbReturnCode = execution.getVariable(prefix+'dbReturnCode')
def createDBResponse = execution.getVariable(prefix+'createDBResponse')
@@ -270,7 +270,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
}
- public void prepareFalloutHandlerRequest(Execution execution, isDebugEnabled) {
+ public void prepareFalloutHandlerRequest(DelegateExecution execution, isDebugEnabled) {
WorkflowException we = execution.getVariable('WorkflowException')
def errorCode = we?.getErrorCode()
@@ -309,7 +309,7 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugEnabled
*/
- public void callRESTQueryAAIServiceInstance(Execution execution, isDebugEnabled) {
+ public void callRESTQueryAAIServiceInstance(DelegateExecution execution, isDebugEnabled) {
def request = execution.getVariable(prefix+"Request")
def serviceInstanceId = utils.getNodeText1(request, "service-instance-id")
@@ -348,12 +348,12 @@ class CreateVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
}
}
- public void logAndSaveOriginalException(Execution execution, isDebugLogEnabled) {
+ public void logAndSaveOriginalException(DelegateExecution execution, isDebugLogEnabled) {
logWorkflowException(execution, 'CreateVfModuleVolumeInfraV1 caught an event')
saveWorkflowException(execution, 'CVMVINFRAV1_originalWorkflowException')
}
- public void validateRollbackResponse(Execution execution, isDebugLogEnabled) {
+ public void validateRollbackResponse(DelegateExecution execution, isDebugLogEnabled) {
def originalException = execution.getVariable("CVMVINFRAV1_originalWorkflowException")
execution.setVariable("WorkflowException", originalException)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVnfInfra.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVnfInfra.groovy
index 1c98b87027..24487d5013 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVnfInfra.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateVnfInfra.groovy
@@ -23,7 +23,7 @@ package org.openecomp.mso.bpmn.infrastructure.scripts
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
import static org.apache.commons.lang3.StringUtils.*;
import org.openecomp.mso.bpmn.common.scripts.CatalogDbUtils;
@@ -38,6 +38,7 @@ import org.openecomp.mso.bpmn.common.scripts.VidUtils;
import org.openecomp.mso.bpmn.core.WorkflowException
import org.openecomp.mso.bpmn.core.domain.VnfResource
import org.openecomp.mso.bpmn.core.json.JsonUtils;
+import org.openecomp.mso.bpmn.infrastructure.aai.AAICreateResources;
/**
@@ -52,6 +53,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils(this)
CatalogDbUtils cutils = new CatalogDbUtils()
+ AAICreateResources aaiCR = new AAICreateResources()
/**
* This method gets and validates the incoming
@@ -60,7 +62,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
* @param - execution
*
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " *** STARTED CreateVnfInfra PreProcessRequest Process*** ", isDebugEnabled)
@@ -191,7 +193,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "*** COMPLETED CreateVnfInfra PreProcessRequest Process ***", isDebugEnabled)
}
- public void sendSyncResponse (Execution execution) {
+ public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -218,7 +220,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
}
- public void preProcessSDNCAssignRequest(Execution execution){
+ public void preProcessSDNCAssignRequest(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
@@ -244,7 +246,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
}
- public void preProcessSDNCActivateRequest(Execution execution) {
+ public void preProcessSDNCActivateRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessSDNCActivateRequest(' +
'execution=' + execution.getId() +
')'
@@ -269,7 +271,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED preProcessSDNCActivateRequest Process ======== ", isDebugLogEnabled)
}
- public String buildSDNCRequest(Execution execution, String svcInstId, String action){
+ public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
String uuid = execution.getVariable('testReqId') // for junits
if(uuid==null){
@@ -332,7 +334,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
return sdncRequest
}
- public void validateSDNCResponse(Execution execution, String response, String method){
+ public void validateSDNCResponse(DelegateExecution execution, String response, String method){
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
logDebug(" *** STARTED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
@@ -358,7 +360,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
logDebug(" *** COMPLETED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
}
- public void prepareCompletionHandlerRequest(Execution execution){
+ public void prepareCompletionHandlerRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -391,7 +393,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "*** COMPLETED CreateVnfInfra PrepareCompletionHandlerRequest Process ***", isDebugEnabled)
}
- public void sendErrorResponse(Execution execution){
+ public void sendErrorResponse(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -416,7 +418,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "*** COMPLETED CreateVnfInfra sendErrorResponse Process ***", isDebugEnabled)
}
- public void prepareFalloutRequest(Execution execution){
+ public void prepareFalloutRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -442,7 +444,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
}
- public void queryCatalogDB (Execution execution) {
+ public void queryCatalogDB (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -455,8 +457,7 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
JSONArray vnfs = cutils.getAllVnfsByVnfModelCustomizationUuid(execution,
vnfModelCustomizationUuid, "v2")
- utils.log("DEBUG", "obtained VNF list: " + vnfs, isDebugEnabled)
- execution.setVariable("CREVI_vnfs", vnfs)
+ utils.log("DEBUG", "obtained VNF list: " + vnfs, isDebugEnabled)
if (vnfs == null) {
utils.log("ERROR", "No matching VNFs in Catalog DB for vnfModelCustomizationUuid=" + vnfModelCustomizationUuid, isDebugEnabled)
@@ -493,4 +494,58 @@ class CreateVnfInfra extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "*** COMPLETED CreateVnfInfra QueryCatalogDb Process ***", isDebugEnabled)
}
+ public void createPlatform (DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG"," ***** START createPlatform *****", isDebugEnabled)
+
+ String request = execution.getVariable("bpmnRequest")
+ String platformName = jsonUtil.getJsonValue(request, "requestDetails.platform.platformName")
+ String vnfId = execution.getVariable("CREVI_vnfId")
+
+ utils.log("DEBUG","Platform NAME: " + platformName, isDebugEnabled)
+ utils.log("DEBUG","VnfID: " + vnfId, isDebugEnabled)
+
+ if(platformName == null||platformName.equals("")){
+ String msg = "Exception in createPlatform. platformName was not found in the request.";
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }else{
+ utils.log("DEBUG", "platformName was found.", isDebugEnabled)
+ try{
+ AAICreateResources aaiCR = new AAICreateResources()
+ aaiCR.createAAIPlatform(platformName, vnfId)
+ }catch(Exception ex){
+ String msg = "Exception in createPlatform. " + ex.getMessage();
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+ utils.log("DEBUG"," *** Exit createPlatform *** ", isDebugEnabled)
+ }
+ public void createLineOfBusiness (DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG"," ***** START createLineOfBusiness *****", isDebugEnabled)
+
+ String request = execution.getVariable("bpmnRequest")
+ String lineOfBusiness = jsonUtil.getJsonValue(request, "requestDetails.lineOfBusiness.lineOfBusinessName")
+ String vnfId = execution.getVariable("CREVI_vnfId")
+
+ utils.log("DEBUG","LineOfBusiness NAME: " + lineOfBusiness, isDebugEnabled)
+ utils.log("DEBUG","VnfID: " + vnfId, isDebugEnabled)
+
+ if(lineOfBusiness == null || lineOfBusiness.equals("")){
+ utils.log("DEBUG", "LineOfBusiness was not found. Continuing on with flow...", isDebugEnabled)
+ }else{
+ utils.log("DEBUG", "LineOfBusiness was found.", isDebugEnabled)
+ try{
+ AAICreateResources aaiCR = new AAICreateResources()
+ aaiCR.createAAILineOfBusiness(lineOfBusiness, vnfId)
+ }catch(Exception ex){
+ String msg = "Exception in LineOfBusiness. " + ex.getMessage();
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+ utils.log("DEBUG"," *** Exit createLineOfBusiness *** ", isDebugEnabled)
+ }
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
index 49e4cc9257..d4b853179c 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
@@ -35,7 +35,7 @@ import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONObject;
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
@@ -59,7 +59,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils()
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
@@ -81,17 +81,36 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
msg = "Input serviceInstanceId' is null"
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
-
- String serviceType = execution.getVariable("serviceType")
- if (isBlank(serviceType)) {
- msg = "Input serviceType' is null"
+
+ //String xmlRequestDetails = vidUtils.getJsonRequestDetailstoXml(siRequest)
+ //execution.setVariable("requestDetails", xmlRequestDetails)
+
+ //modelInfo
+ String serviceModelInfo = jsonUtil.getJsonValue(siRequest, "requestDetails.modelInfo")
+ if (isBlank(serviceModelInfo)) {
+ msg = "Input serviceModelInfo is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ } else
+ {
+ execution.setVariable("serviceModelInfo", serviceModelInfo)
+ //utils.log("DEBUG", "modelInfo" + serviceModelInfo, isDebugEnabled)
+ }
+
+ //requestInfo
+ String productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId")
+ if (isBlank(productFamilyId))
+ {
+ msg = "Input productFamilyId is null"
utils.log("INFO", msg, isDebugEnabled)
+ //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
} else {
- execution.setVariable("serviceType", serviceType)
+ execution.setVariable("productFamilyId", productFamilyId)
}
+ String source = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.source")
+ execution.setVariable("source", source)
//subscriberInfo
- String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "globalSubscriberId")
+ String globalSubscriberId = jsonUtil.getJsonValue(siRequest, "requestDetails.subscriberInfo.globalSubscriberId")
if (isBlank(globalSubscriberId)) {
msg = "Input globalSubscriberId' is null"
utils.log("INFO", msg, isDebugEnabled)
@@ -99,16 +118,38 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
execution.setVariable("globalSubscriberId", globalSubscriberId)
}
- //operationId
- String operationId = jsonUtil.getJsonValue(siRequest, "operationId")
- if (isBlank(operationId)) {
- operationId = UUID.randomUUID().toString()
- }
- execution.setVariable("operationId", operationId)
- execution.setVariable("operationType", "DELETE")
+ //requestParameters
+ String subscriptionServiceType = jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.subscriptionServiceType")
+ if (isBlank(subscriptionServiceType)) {
+ msg = "Input subscriptionServiceType is null"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ //exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ } else {
+ execution.setVariable("subscriptionServiceType", subscriptionServiceType)
+ }
- execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
+ /*
+ * Extracting User Parameters from incoming Request and converting into a Map
+ */
+ def jsonSlurper = new JsonSlurper()
+ def jsonOutput = new JsonOutput()
+
+ Map reqMap = jsonSlurper.parseText(siRequest)
+
+ //InputParams
+ def userParams = reqMap.requestDetails?.requestParameters?.userParams
+
+ Map inputMap = [:]
+ if (userParams) {
+ userParams.each {
+ userParam -> inputMap.put(userParam.name, userParam.value.toString())
+ }
+ }
+ execution.setVariable("operationType", "DELETE")
+ utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
+ execution.setVariable("serviceInputParams", inputMap)
+
} catch (BpmnError e) {
throw e;
} catch (Exception ex){
@@ -119,15 +160,16 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
utils.log("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled)
}
- public void sendSyncResponse (Execution execution) {
+ public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " *** sendSyncResponse *** ", isDebugEnabled)
try {
- String operationId = execution.getVariable("operationId")
-
- // RESTResponse (for API Handler (APIH) Reply Task) : :
- String syncResponse = """{"operationId":"${operationId}"}""".trim()
+ String requestId = execution.getVariable("msoRequestId")
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+
+ // RESTResponse (for API Handler (APIH) Reply Task)
+ String syncResponse = """{"requestReferences":{"instanceId":"${serviceInstanceId}","requestId":"${requestId}"}}""".trim()
utils.log("INFO", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)
sendWorkflowResponse(execution, 202, syncResponse)
@@ -138,7 +180,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
utils.log("INFO"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
}
- public void sendSyncError (Execution execution) {
+ public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " *** sendSyncError *** ", isDebugEnabled)
@@ -166,7 +208,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
}
- public void prepareCompletionRequest (Execution execution) {
+ public void prepareCompletionRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " *** prepareCompletion *** ", isDebugEnabled)
@@ -199,7 +241,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
utils.log("INFO", "*** Exit prepareCompletionRequest ***", isDebugEnabled)
}
- public void prepareFalloutRequest(Execution execution){
+ public void prepareFalloutRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " *** prepareFalloutRequest *** ", isDebugEnabled)
@@ -245,7 +287,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
// *******************************
// Build DB request Section
// *******************************
- public void prepareDBRequest (Execution execution) {
+ public void prepareDBRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -287,7 +329,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
// *******************************
// Build Error Section
// *******************************
- public void prepareDBRequestError (Execution execution) {
+ public void prepareDBRequestError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -332,7 +374,7 @@ public class DeleteCustomE2EServiceInstance extends AbstractServiceTaskProcessor
}
- public void processJavaException(Execution execution) {
+ public void processJavaException(DelegateExecution execution) {
//TODO:
}
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy
index abf949e8e8..c731a613cc 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteGenericALaCarteServiceInstance.groovy
@@ -34,7 +34,7 @@ import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONObject;
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
@@ -58,7 +58,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils()
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
@@ -141,7 +141,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
Map inputMap = [:]
if (userParams) {
userParams.each {
- userParam -> inputMap.put(userParam.name, userParam.value)
+ userParam -> inputMap.put(userParam.name, userParam.value.toString())
}
}
@@ -158,7 +158,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
}
- public void sendSyncResponse (Execution execution) {
+ public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " *** sendSyncResponse *** ", isDebugEnabled)
@@ -178,7 +178,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
utils.log("DEBUG"," ***** Exit sendSyncResopnse *****", isDebugEnabled)
}
- public void sendSyncError (Execution execution) {
+ public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " *** sendSyncError *** ", isDebugEnabled)
@@ -206,7 +206,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
}
- public void prepareCompletionRequest (Execution execution) {
+ public void prepareCompletionRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " *** prepareCompletion *** ", isDebugEnabled)
@@ -239,7 +239,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
utils.log("DEBUG", "*** Exit prepareCompletionRequest ***", isDebugEnabled)
}
- public void prepareFalloutRequest(Execution execution){
+ public void prepareFalloutRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " *** prepareFalloutRequest *** ", isDebugEnabled)
@@ -285,7 +285,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
// *******************************
// Build DB request Section
// *******************************
- public void prepareDBRequest (Execution execution) {
+ public void prepareDBRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -327,7 +327,7 @@ public class DeleteGenericALaCarteServiceInstance extends AbstractServiceTaskPro
// *******************************
// Build Error Section
// *******************************
- public void prepareDBRequestError (Execution execution) {
+ public void prepareDBRequestError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstance.groovy
index dab189241c..a9aef7f3ee 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteNetworkInstance.groovy
@@ -29,7 +29,7 @@ import org.openecomp.mso.bpmn.core.json.JsonUtils;
import org.openecomp.mso.rest.APIResponse
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
@@ -45,7 +45,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
NetworkUtils networkUtils = new NetworkUtils()
- public InitializeProcessVariables(Execution execution){
+ public InitializeProcessVariables(DelegateExecution execution){
execution.setVariable(Prefix + "Success", false)
@@ -59,7 +59,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
// Pre or Prepare Request Section
// **************************************************
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -145,7 +145,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void getNetworkModelInfo (Execution execution) {
+ public void getNetworkModelInfo (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -169,7 +169,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void sendSyncResponse (Execution execution) {
+ public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -196,7 +196,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareCompletion (Execution execution) {
+ public void prepareCompletion (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -236,7 +236,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareDBRequestError (Execution execution) {
+ public void prepareDBRequestError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -284,7 +284,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
// Post or Validate Response Section
// **************************************************
- public void postProcessResponse (Execution execution) {
+ public void postProcessResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -318,7 +318,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
// *******************************
// Prepare for FalloutHandler
- public void buildErrorResponse (Execution execution) {
+ public void buildErrorResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -380,7 +380,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void sendSyncError (Execution execution) {
+ public void sendSyncError (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -400,7 +400,7 @@ public class DeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
}
- public void processJavaException(Execution execution){
+ public void processJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
try{
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleInfra.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleInfra.groovy
index c4c151f01f..0aef81770f 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleInfra.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleInfra.groovy
@@ -27,7 +27,7 @@ import groovy.xml.QName
import java.io.Serializable;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import groovy.json.JsonSlurper
@@ -49,7 +49,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
*
* @param execution The flow's execution instance.
*/
- public void initProcessVariables(Execution execution) {
+ public void initProcessVariables(DelegateExecution execution) {
execution.setVariable('prefix', 'DELVfModI_')
execution.setVariable('DELVfModI_requestInfo', null)
execution.setVariable('DELVfModI_requestId', null)
@@ -70,7 +70,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
*
* @param execution The flow's execution instance.
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessRequest(' +
'execution=' + execution.getId() +
')'
@@ -103,7 +103,10 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
execution.setVariable("vfModuleModelInfo", vfModuleModelInfo)
utils.log("DEBUG", "VfModuleModelInfo is: " + vfModuleModelInfo, isDebugLogEnabled)
-
+
+ // This is aLaCarte flow, so aLaCarte flag is always on
+ execution.setVariable('aLaCarte', true)
+
def vidUtils = new VidUtils(this)
String requestInXmlFormat = vidUtils.createXmlVfModuleRequest(execution, reqMap, 'DELETE_VF_MODULE', serviceInstanceId)
@@ -165,7 +168,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
*
* @param execution The flow's execution instance.
*/
- public void sendSynchResponse(Execution execution) {
+ public void sendSynchResponse(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.sendResponse(' +
'execution=' + execution.getId() +
')'
@@ -208,7 +211,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
*
* @param execution The flow's execution instance.
*/
- public void prepDoDeleteVfModule(Execution execution) {
+ public void prepDoDeleteVfModule(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.prepDoDeleteVfModule(' +
'execution=' + execution.getId() +
')'
@@ -231,7 +234,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
*
* @param execution The flow's execution instance.
*/
- public void prepUpdateInfraRequest(Execution execution) {
+ public void prepUpdateInfraRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.prepUpdateInfraRequest(' +
'execution=' + execution.getId() +
')'
@@ -280,7 +283,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
* @param execution the execution
* @param resultVar the execution variable in which the result will be stored
*/
- public void completionHandlerPrep(Execution execution, String resultVar) {
+ public void completionHandlerPrep(DelegateExecution execution, String resultVar) {
def method = getClass().getSimpleName() + '.completionHandlerPrep(' +
'execution=' + execution.getId() +
', resultVar=' + resultVar +
@@ -324,7 +327,7 @@ public class DeleteVfModuleInfra extends AbstractServiceTaskProcessor {
* @param execution the execution
* @param resultVar the execution variable in which the result will be stored
*/
- public void falloutHandlerPrep(Execution execution, String resultVar) {
+ public void falloutHandlerPrep(DelegateExecution execution, String resultVar) {
def method = getClass().getSimpleName() + '.falloutHandlerPrep(' +
'execution=' + execution.getId() +
', resultVar=' + resultVar +
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy
index 77a8f8e9c0..5a38d9f011 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVfModuleVolumeInfraV1.groovy
@@ -26,7 +26,7 @@ import java.util.concurrent.ExecutionException;
import org.springframework.web.util.UriUtils
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.openecomp.mso.bpmn.common.scripts.AaiUtil;
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor;
@@ -45,7 +45,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* This method is executed during the preProcessRequest task of the DeleteVfModuleVolume.bpmn process.
* @param execution
*/
- public InitializeProcessVariables(Execution execution){
+ public InitializeProcessVariables(DelegateExecution execution){
execution.setVariable('prefix', 'DELVfModVol_')
execution.setVariable("DELVfModVol_volumeRequest", null)
execution.setVariable('DELVfModVol_requestInfo', null)
@@ -76,7 +76,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* Perform initial processing, such as request validation, initialization of variables, etc.
* * @param execution
*/
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
preProcessRequest(execution, isDebugEnabled)
}
@@ -85,7 +85,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* This method is executed during the preProcessRequest task of the DeleteVfModuleVolume.bpmn process.
* @param execution
*/
- public void preProcessRequest (Execution execution, isDebugLogEnabled) {
+ public void preProcessRequest (DelegateExecution execution, isDebugLogEnabled) {
InitializeProcessVariables(execution)
@@ -137,7 +137,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
logDebug('Request: ' + createVolumeIncoming, isDebugLogEnabled)
}
- public void sendSyncResponse (Execution execution, isDebugEnabled) {
+ public void sendSyncResponse (DelegateExecution execution, isDebugEnabled) {
String volumeRequest = execution.getVariable("DELVfModVol_volumeRequest")
utils.log("DEBUG", " DELVfModVol_volumeRequest - " + "\n" + volumeRequest, isDebugEnabled)
@@ -169,7 +169,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
}
- public void sendSyncError (Execution execution, isDebugEnabled) {
+ public void sendSyncError (DelegateExecution execution, isDebugEnabled) {
WorkflowException we = execution.getVariable('WorkflowException')
def errorCode = we?.getErrorCode()
def errorMessage = we?.getErrorMessage()
@@ -178,7 +178,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
}
- public void callRESTQueryAAICloudRegion (Execution execution, isDebugEnabled) {
+ public void callRESTQueryAAICloudRegion (DelegateExecution execution, isDebugEnabled) {
String cloudRegion = execution.getVariable('DELVfModVol_cloudRegion')
@@ -216,7 +216,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
* Query volume group by id
* @param execution
*/
- public void queryAAIForVolumeGroup(Execution execution, isDebugLogEnabled) {
+ public void queryAAIForVolumeGroup(DelegateExecution execution, isDebugLogEnabled) {
ExceptionUtil exceptionUtil = new ExceptionUtil()
@@ -343,7 +343,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
return false
}
- public void prepareVnfAdapterDeleteRequest(Execution execution, isDebugLogEnabled) {
+ public void prepareVnfAdapterDeleteRequest(DelegateExecution execution, isDebugLogEnabled) {
def cloudRegion = execution.getVariable('DELVfModVol_cloudRegion')
def tenantId = execution.getVariable('DELVfModVol_tenantId')
def volumeGroupId = execution.getVariable('DELVfModVol_volumeGroupId')
@@ -379,7 +379,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
}
- public void deleteVolGrpId(Execution execution, isDebugEnabled) {
+ public void deleteVolGrpId(DelegateExecution execution, isDebugEnabled) {
// get variables
String queryAAIVolGrpIdResponse = execution.getVariable("DELVfModVol_queryAAIVolGrpResponse")
@@ -422,7 +422,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
}
- public void prepareDBRequest (Execution execution, isDebugLogEnabled) {
+ public void prepareDBRequest (DelegateExecution execution, isDebugLogEnabled) {
WorkflowException workflowExceptionObj = execution.getVariable("WorkflowException")
ExceptionUtil exceptionUtil = new ExceptionUtil();
@@ -464,7 +464,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
}
- public void prepareCompletionHandlerRequest (Execution execution, isDebugLogEnabled) {
+ public void prepareCompletionHandlerRequest (DelegateExecution execution, isDebugLogEnabled) {
def requestId = execution.getVariable("mso-request-id")
def source = execution.getVariable("DELVfModVol_source")
@@ -488,7 +488,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
- public void prepareFalloutHandler (Execution execution, isDebugEnabled) {
+ public void prepareFalloutHandler (DelegateExecution execution, isDebugEnabled) {
execution.setVariable("DELVfModVol_Success", false)
String requestId = execution.getVariable("DELVfModVol_requestId")
@@ -529,7 +529,7 @@ public class DeleteVfModuleVolumeInfraV1 extends AbstractServiceTaskProcessor {
*
* @param execution The flow's execution instance.
*/
- public void handleTenantIdMismatch(Execution execution, isDebugLogEnabled) {
+ public void handleTenantIdMismatch(DelegateExecution execution, isDebugLogEnabled) {
def volumeGroupId = execution.getVariable('DELVfModVol_volumeGroupId')
def aicCloudRegion = execution.getVariable('DELVfModVol_aicCloudRegion')
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVnfInfra.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVnfInfra.groovy
index f1911accd7..c789769131 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVnfInfra.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DeleteVnfInfra.groovy
@@ -26,7 +26,7 @@ import javax.xml.parsers.DocumentBuilderFactory
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.w3c.dom.Document
import org.w3c.dom.Element
import org.w3c.dom.Node
@@ -59,7 +59,7 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
*
* @param - execution
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " *** STARTED DeleteVnfInfra PreProcessRequest Process*** ", isDebugEnabled)
@@ -129,7 +129,7 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "*** COMPLETED DeleteVnfInfra PreProcessRequest Process ***", isDebugEnabled)
}
- public void sendSyncResponse (Execution execution) {
+ public void sendSyncResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -154,7 +154,7 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "*** COMPLETED DeleteVnfInfra SendSyncResponse Process ***", isDebugEnabled)
}
- public void prepareCompletionHandlerRequest(Execution execution){
+ public void prepareCompletionHandlerRequest(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -187,7 +187,7 @@ class DeleteVnfInfra extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "*** COMPLETED DeleteVnfInfra PrepareCompletionHandlerRequest Process ***", isDebugEnabled)
}
- public void sendErrorResponse(Execution execution){
+ public void sendErrorResponse(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
index fd9b6d42e8..1f632162ff 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
@@ -51,7 +51,7 @@ import java.util.UUID;
import javax.mail.Quota.Resource;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONObject;
import org.json.JSONArray;
import org.apache.commons.lang3.*
@@ -90,7 +90,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
JsonUtils jsonUtil = new JsonUtils()
CatalogDbUtils cutils = new CatalogDbUtils()
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
utils.log("INFO"," ***** preProcessRequest *****", isDebugEnabled)
@@ -185,7 +185,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
utils.log("INFO"," ***** Exit preProcessRequest *****", isDebugEnabled)
}
- public void prepareDecomposeService(Execution execution) {
+ public void prepareDecomposeService(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
try {
@@ -208,7 +208,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
}
- public void processDecomposition (Execution execution) {
+ public void processDecomposition(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG", " ***** Inside processDecomposition() of create generic e2e service flow ***** ", isDebugEnabled)
@@ -221,11 +221,11 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
}
- public void doServiceHoming(Execution execution) {
+ public void doServiceHoming(DelegateExecution execution) {
//Now Homing is not clear. So to be implemented.
}
- public void postProcessAAIGET(Execution execution) {
+ public void postProcessAAIGET(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** postProcessAAIGET ***** ", isDebugEnabled)
String msg = ""
@@ -267,7 +267,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
utils.log("INFO"," *** Exit postProcessAAIGET *** ", isDebugEnabled)
}
- public void postProcessAAIPUT(Execution execution) {
+ public void postProcessAAIPUT(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** postProcessAAIPUT ***** ", isDebugEnabled)
String msg = ""
@@ -305,7 +305,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
utils.log("INFO"," *** Exit postProcessAAIPUT *** ", isDebugEnabled)
}
- public void postProcessAAIGET2(Execution execution) {
+ public void postProcessAAIGET2(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** postProcessAAIGET2 ***** ", isDebugEnabled)
String msg = ""
@@ -348,7 +348,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
utils.log("INFO"," *** Exit postProcessAAIGET2 *** ", isDebugEnabled)
}
- public void preProcessRollback (Execution execution) {
+ public void preProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** preProcessRollback ***** ", isDebugEnabled)
try {
@@ -369,7 +369,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
utils.log("INFO"," *** Exit preProcessRollback *** ", isDebugEnabled)
}
- public void postProcessRollback (Execution execution) {
+ public void postProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** postProcessRollback ***** ", isDebugEnabled)
String msg = ""
@@ -390,7 +390,7 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
utils.log("INFO"," *** Exit postProcessRollback *** ", isDebugEnabled)
}
- public void preInitResourcesOperStatus(Execution execution){
+ public void preInitResourcesOperStatus(DelegateExecution execution){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy
index 743eb1a46e..84dd0e4d73 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceRollback.groovy
@@ -37,7 +37,7 @@ import org.openecomp.mso.rest.RESTConfig
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONObject;
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
@@ -66,7 +66,7 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
String Prefix="DCRESIRB_"
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
@@ -136,7 +136,7 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
}
- public void validateSDNCResponse(Execution execution, String response, String method) {
+ public void validateSDNCResponse(DelegateExecution execution, String response, String method) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** validateSDNCResponse ***** ", isDebugEnabled)
String msg = ""
@@ -169,7 +169,7 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
utils.log("DEBUG"," ***** Exit validateSDNCResponse ***** ", isDebugEnabled)
}
- public void postProcessRequest(Execution execution) {
+ public void postProcessRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessRequest ***** ", isDebugEnabled)
String msg = ""
@@ -203,7 +203,7 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
}
- public void processRollbackException(Execution execution){
+ public void processRollbackException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** processRollbackException ***** ", isDebugEnabled)
try{
@@ -221,7 +221,7 @@ public class DoCreateE2EServiceInstanceRollback extends AbstractServiceTaskProce
utils.log("DEBUG", " Exit processRollbackException", isDebugEnabled)
}
- public void processRollbackJavaException(Execution execution){
+ public void processRollbackJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** processRollbackJavaException ***** ", isDebugEnabled)
try{
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceV2.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceV2.groovy
index ea29de94d7..2d96ac771a 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceV2.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateE2EServiceInstanceV2.groovy
@@ -21,33 +21,22 @@
package org.openecomp.mso.bpmn.infrastructure.scripts;
import static org.apache.commons.lang3.StringUtils.*;
-import groovy.xml.XmlUtil
-import groovy.json.*
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
-import org.openecomp.mso.bpmn.core.domain.ServiceInstance
-import org.openecomp.mso.bpmn.core.domain.ModelInfo
-import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.apache.commons.lang3.*
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.json.JSONArray;
+import org.json.JSONObject;
import org.openecomp.mso.bpmn.common.scripts.AaiUtil
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
-import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
import org.openecomp.mso.bpmn.core.RollbackData
import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.rest.APIResponse;
-import org.openecomp.mso.rest.RESTClient
-import org.openecomp.mso.rest.RESTConfig
-
-import java.util.UUID;
-
-import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
-import org.json.JSONObject;
-import org.json.JSONArray;
-import org.apache.commons.lang3.*
-import org.apache.commons.codec.binary.Base64;
+import org.openecomp.mso.bpmn.core.json.JsonUtils
import org.springframework.web.util.UriUtils;
+import groovy.json.*
+
/**
* This groovy class supports the DoCreateServiceInstance.bpmn process.
*
@@ -81,7 +70,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
//only for dug
execution.setVariable("isDebugLogEnabled","true")
execution.setVariable("unit_test", "true")
@@ -217,7 +206,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void postProcessAAIGET(Execution execution) {
+ public void postProcessAAIGET(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessAAIGET(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -261,7 +250,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void postProcessAAIPUT(Execution execution) {
+ public void postProcessAAIPUT(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessAAIPUT(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -301,7 +290,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void postProcessAAIGET2(Execution execution) {
+ public void postProcessAAIGET2(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessAAIGET2(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -346,7 +335,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void preProcessRollback (Execution execution) {
+ public void preProcessRollback (DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessRollback(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -369,7 +358,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void postProcessRollback (Execution execution) {
+ public void postProcessRollback (DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessRollback(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -395,7 +384,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
/**
* Init the service Operation Status
*/
- public void preUpdateServiceOperationStatus(Execution execution){
+ public void preUpdateServiceOperationStatus(DelegateExecution execution){
def method = getClass().getSimpleName() + '.preUpdateServiceOperationStatus(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -460,7 +449,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
}
- public void preInitResourcesOperStatus(Execution execution){
+ public void preInitResourcesOperStatus(DelegateExecution execution){
def method = getClass().getSimpleName() + '.preInitResourcesOperStatus(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -576,7 +565,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
/***********************************************************************************************/
- private void loadResourcesProperties(Execution execution) {
+ private void loadResourcesProperties(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.loadResourcesProperties(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -610,7 +599,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
}
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- private sortCreateResource(Execution execution) {
+ private sortCreateResource(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.sortCreateResource(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -714,7 +703,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
/**
* get service resources
*/
- public void getServiceResources(Execution execution){
+ public void getServiceResources(DelegateExecution execution){
def method = getClass().getSimpleName() + '.getServiceResources(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -758,7 +747,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
/**
* prepare Decompose next resource to create request
*/
- public void preProcessDecomposeNextResource(Execution execution){
+ public void preProcessDecomposeNextResource(DelegateExecution execution){
def method = getClass().getSimpleName() + '.preProcessDecomposeNextResource(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -808,7 +797,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
/**
* post Decompose next resource to create request
*/
- public void postProcessDecomposeNextResource(Execution execution){
+ public void postProcessDecomposeNextResource(DelegateExecution execution){
def method = getClass().getSimpleName() + '.postProcessDecomposeNextResource(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -849,7 +838,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
/**
* prepare check Resource Type
*/
- public void checkResourceType(Execution execution){
+ public void checkResourceType(DelegateExecution execution){
def method = getClass().getSimpleName() + '.checkResourceType(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -966,7 +955,7 @@ public class DoCreateE2EServiceInstanceV2 extends AbstractServiceTaskProcessor {
/**
* prepare post Unkown Resource Type
*/
- public void postOtherControllerType(Execution execution){
+ public void postOtherControllerType(DelegateExecution execution){
def method = getClass().getSimpleName() + '.postOtherControllerType(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy
index e2bd1ddf04..7d21a06971 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstance.groovy
@@ -38,7 +38,7 @@ import java.util.Map;
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
@@ -61,7 +61,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
* This method is executed during the preProcessRequest task of the DoCreateNetworkInstance.bpmn process.
* @param execution
*/
- public InitializeProcessVariables(Execution execution){
+ public InitializeProcessVariables(DelegateExecution execution){
/* Initialize all the process variables in this block */
execution.setVariable(Prefix + "networkRequest", "")
@@ -174,7 +174,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
* This method is executed during the preProcessRequest task of the DoCreateNetworkInstance.bpmn process.
* @param execution
*/
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -312,7 +312,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void callRESTQueryAAINetworkName (Execution execution) {
+ public void callRESTQueryAAINetworkName (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -388,7 +388,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void callRESTQueryAAICloudRegion (Execution execution) {
+ public void callRESTQueryAAICloudRegion (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -438,7 +438,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void callRESTQueryAAINetworkId(Execution execution) {
+ public void callRESTQueryAAINetworkId(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -481,7 +481,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String aai_endpoint = execution.getVariable("URN_aai_endpoint")
AaiUtil aaiUriUtil = new AaiUtil(this)
String aai_uri = aaiUriUtil.getNetworkL3NetworkUri(execution)
- String queryIdAAIRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=1"
+ String queryIdAAIRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=all"
utils.logAudit(queryIdAAIRequest)
execution.setVariable(Prefix + "queryIdAAIRequest", queryIdAAIRequest)
utils.log("DEBUG", Prefix + "queryIdAAIRequest - " + "\n" + queryIdAAIRequest, isDebugEnabled)
@@ -538,7 +538,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void callRESTReQueryAAINetworkId(Execution execution) {
+ public void callRESTReQueryAAINetworkId(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -554,7 +554,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String aai_endpoint = execution.getVariable("URN_aai_endpoint")
AaiUtil aaiUriUtil = new AaiUtil(this)
String aai_uri = aaiUriUtil.getNetworkL3NetworkUri(execution)
- String requeryIdAAIRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=1"
+ String requeryIdAAIRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=all"
utils.logAudit(requeryIdAAIRequest)
execution.setVariable(Prefix + "requeryIdAAIRequest", requeryIdAAIRequest)
utils.log("DEBUG", Prefix + "requeryIdAAIRequest - " + "\n" + requeryIdAAIRequest, isDebugEnabled)
@@ -614,7 +614,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void callRESTQueryAAINetworkVpnBinding(Execution execution) {
+ public void callRESTQueryAAINetworkVpnBinding(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -686,9 +686,19 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG", " AAI Query Vpn Binding Success REST Response, , vpnBinding #" + counting + " : " + "\n" + aaiResponseAsString, isDebugEnabled)
String routeTarget = ""
- if (utils.nodeExists(aaiResponseAsString, "global-route-target")) {
- routeTarget = utils.getNodeText1(aaiResponseAsString, "global-route-target")
- routeTargets += "" + routeTarget + "" + '\n'
+ String routeRole = ""
+ if (utils.nodeExists(aaiResponseAsString, "route-targets")) {
+ String aaiRouteTargets = utils.getNodeXml(aaiResponseAsString, "route-targets", false)
+ def aaiRouteTargetsXml = new XmlSlurper().parseText(aaiRouteTargets)
+ def aaiRouteTarget = aaiRouteTargetsXml.'**'.findAll {it.name() == "route-target"}
+ for (j in 0..aaiRouteTarget.size()-1) {
+ routeTarget = utils.getNodeText1(XmlUtil.serialize(aaiRouteTarget[j]), "global-route-target")
+ routeRole = utils.getNodeText1(XmlUtil.serialize(aaiRouteTarget[j]), "route-target-role")
+ routeTargets += "" + '\n' +
+ " " + routeTarget + "" + '\n' +
+ " " + routeRole + "" + '\n' +
+ "" + '\n'
+ }
}
} else {
@@ -748,7 +758,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void callRESTQueryAAINetworkPolicy(Execution execution) {
+ public void callRESTQueryAAINetworkPolicy(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -884,7 +894,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void callRESTQueryAAINetworkTableRef(Execution execution) {
+ public void callRESTQueryAAINetworkTableRef(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1021,7 +1031,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void callRESTUpdateContrailAAINetwork(Execution execution) {
+ public void callRESTUpdateContrailAAINetwork(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1038,7 +1048,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
String aai_endpoint = execution.getVariable("URN_aai_endpoint")
AaiUtil aaiUriUtil = new AaiUtil(this)
String aai_uri = aaiUriUtil.getNetworkL3NetworkUri(execution)
- String updateContrailAAIUrlRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=1"
+ String updateContrailAAIUrlRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=all"
utils.logAudit(updateContrailAAIUrlRequest)
execution.setVariable(Prefix + "updateContrailAAIUrlRequest", updateContrailAAIUrlRequest)
@@ -1103,7 +1113,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareCreateNetworkRequest (Execution execution) {
+ public void prepareCreateNetworkRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1146,7 +1156,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareSDNCRequest (Execution execution) {
+ public void prepareSDNCRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1188,7 +1198,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareRpcSDNCRequest (Execution execution) {
+ public void prepareRpcSDNCRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1221,7 +1231,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareRpcSDNCActivateRequest (Execution execution) {
+ public void prepareRpcSDNCActivateRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1260,7 +1270,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
// Post or Validate Response Section
// **************************************************
- public void validateCreateNetworkResponse (Execution execution) {
+ public void validateCreateNetworkResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1333,7 +1343,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void validateSDNCResponse (Execution execution) {
+ public void validateSDNCResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1361,7 +1371,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void validateRpcSDNCActivateResponse (Execution execution) {
+ public void validateRpcSDNCActivateResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1390,7 +1400,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareSDNCRollbackRequest (Execution execution) {
+ public void prepareSDNCRollbackRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1422,7 +1432,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareRpcSDNCRollbackRequest (Execution execution) {
+ public void prepareRpcSDNCRollbackRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1454,7 +1464,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareRpcSDNCActivateRollback(Execution execution) {
+ public void prepareRpcSDNCActivateRollback(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1487,7 +1497,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareRollbackData(Execution execution) {
+ public void prepareRollbackData(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1529,7 +1539,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void postProcessResponse(Execution execution) {
+ public void postProcessResponse(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1590,7 +1600,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareSuccessRollbackData(Execution execution) {
+ public void prepareSuccessRollbackData(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1639,7 +1649,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void setExceptionFlag(Execution execution){
+ public void setExceptionFlag(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1671,7 +1681,7 @@ public class DoCreateNetworkInstance extends AbstractServiceTaskProcessor {
- public void processJavaException(Execution execution){
+ public void processJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
index 0bd5893cf5..760389ef43 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateNetworkInstanceRollback.groovy
@@ -36,7 +36,7 @@ import org.openecomp.mso.rest.RESTConfig
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
@@ -59,7 +59,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
* This method is executed during the preProcessRequest task of the DoCreateNetworkInstanceRollback.bpmn process.
* @param execution
*/
- public InitializeProcessVariables(Execution execution){
+ public InitializeProcessVariables(DelegateExecution execution){
/* Initialize all the process variables in this block */
execution.setVariable(Prefix + "rollbackNetworkRequest", null)
@@ -93,7 +93,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
* This method is executed during the preProcessRequest task of the DoCreateNetworkInstanceRollback.bpmn process.
* @param execution
*/
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -180,7 +180,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
}
- public void callPONetworkAdapter (Execution execution) {
+ public void callPONetworkAdapter (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -222,7 +222,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
}
- public void validateRollbackResponses (Execution execution) {
+ public void validateRollbackResponses (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -365,7 +365,7 @@ public class DoCreateNetworkInstanceRollback extends AbstractServiceTaskProcesso
- public void processJavaException(Execution execution){
+ public void processJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
index 91ecabcec3..5789e710e7 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstance.groovy
@@ -19,28 +19,38 @@
*/
package org.openecomp.mso.bpmn.infrastructure.scripts;
-import static org.apache.commons.lang3.StringUtils.*;
-import groovy.xml.XmlUtil
-import groovy.json.*
-
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
-import org.openecomp.mso.bpmn.core.domain.ServiceInstance
-import org.openecomp.mso.bpmn.core.domain.ModelInfo
-import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.openecomp.mso.bpmn.common.scripts.AaiUtil
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.openecomp.mso.bpmn.common.scripts.CatalogDbUtils
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
import org.openecomp.mso.bpmn.core.RollbackData
import org.openecomp.mso.bpmn.core.WorkflowException
-import org.openecomp.mso.rest.APIResponse;
+import org.openecomp.mso.bpmn.core.domain.ModelInfo
+import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
+import org.openecomp.mso.bpmn.core.domain.ServiceInstance
+import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.openecomp.mso.bpmn.infrastructure.aai.AAICreateResources
+import org.openecomp.mso.rest.APIResponse
+import org.springframework.web.util.UriUtils
+
+import static org.apache.commons.lang3.StringUtils.*;
+import groovy.xml.XmlUtil
+import groovy.json.*
+
import org.openecomp.mso.rest.RESTClient
import org.openecomp.mso.rest.RESTConfig
+import org.openecomp.mso.client.aai.AAIResourcesClient
+
+import java.util.logging.Logger;
+import java.net.URI;
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONObject;
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
@@ -70,14 +80,16 @@ import org.springframework.web.util.UriUtils;
* @param - WorkflowException
* @param - serviceInstanceName - (GET from AAI if null in input)
*
+ * This BB processes Macros(except TRANSPORT all sent to sdnc) and Alacartes(sdncSvcs && nonSdncSvcs)
*/
public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
String Prefix="DCRESI_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
+ CatalogDbUtils cutils = new CatalogDbUtils()
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
utils.log("DEBUG"," ***** preProcessRequest *****", isDebugEnabled)
@@ -131,31 +143,19 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
String serviceInstanceId = ""
String serviceType = ""
String serviceRole = ""
-
+
ServiceDecomposition serviceDecomp = (ServiceDecomposition) execution.getVariable("serviceDecomposition")
if (serviceDecomp != null)
{
- serviceType = serviceDecomp.getServiceType()
- if (serviceType == null)
- {
- utils.log("DEBUG", "null serviceType", isDebugEnabled)
- serviceType = ""
- }
- else
- {
- utils.log("DEBUG", "serviceType:" + serviceType, isDebugEnabled)
- }
- serviceRole = serviceDecomp.getServiceRole()
- if (serviceRole == null)
- {
- serviceRole = ""
- }
+ serviceType = serviceDecomp.getServiceType() ?: ""
+ utils.log("DEBUG", "serviceType:" + serviceType, isDebugEnabled)
+ serviceRole = serviceDecomp.getServiceRole() ?: ""
ServiceInstance serviceInstance = serviceDecomp.getServiceInstance()
if (serviceInstance != null)
{
- serviceInstanceId = serviceInstance.getInstanceId()
- serviceInstanceName = serviceInstance.getInstanceName()
+ serviceInstanceId = serviceInstance.getInstanceId() ?: ""
+ serviceInstanceName = serviceInstance.getInstanceName() ?: ""
execution.setVariable("serviceInstanceId", serviceInstanceId)
execution.setVariable("serviceInstanceName", serviceInstanceName)
}
@@ -163,10 +163,10 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
ModelInfo modelInfo = serviceDecomp.getModelInfo()
if (modelInfo != null)
{
- modelInvariantUuid = modelInfo.getModelInvariantUuid()
- modelVersion = modelInfo.getModelVersion()
- modelUuid = modelInfo.getModelUuid()
- modelName = modelInfo.getModelName()
+ modelInvariantUuid = modelInfo.getModelInvariantUuid() ?: ""
+ modelVersion = modelInfo.getModelVersion() ?: ""
+ modelUuid = modelInfo.getModelUuid() ?: ""
+ modelName = modelInfo.getModelName() ?: ""
}
else
{
@@ -178,52 +178,78 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
else
{
//requestDetails.requestInfo. for AAI GET/PUT serviceInstanceData & SDNC assignToplology
- serviceInstanceName = execution.getVariable("serviceInstanceName")
- serviceInstanceId = execution.getVariable("serviceInstanceId")
+ serviceInstanceName = execution.getVariable("serviceInstanceName") ?: ""
+ serviceInstanceId = execution.getVariable("serviceInstanceId") ?: ""
String serviceModelInfo = execution.getVariable("serviceModelInfo")
if (isBlank(serviceModelInfo)) {
msg = "Input serviceModelInfo is null"
utils.log("DEBUG", msg, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
- }
- modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid")
- modelVersion = jsonUtil.getJsonValue(serviceModelInfo, "modelVersion")
- modelUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelUuid")
- modelName = jsonUtil.getJsonValue(serviceModelInfo, "modelName")
+ }
+ modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid") ?: ""
+ modelVersion = jsonUtil.getJsonValue(serviceModelInfo, "modelVersion") ?: ""
+ modelUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelUuid") ?: ""
+ modelName = jsonUtil.getJsonValue(serviceModelInfo, "modelName") ?: ""
//modelCustomizationUuid NA for SI
}
+
execution.setVariable("serviceType", serviceType)
execution.setVariable("serviceRole", serviceRole)
+ execution.setVariable("serviceInstanceName", serviceInstanceName)
+
+ execution.setVariable("modelInvariantUuid", modelInvariantUuid)
+ execution.setVariable("modelVersion", modelVersion)
+ execution.setVariable("modelUuid", modelUuid)
+ execution.setVariable("modelName", modelName)
- if (serviceInstanceName == null) {
- execution.setVariable("serviceInstanceName", "")
- serviceInstanceName = ""
+ //alacarte SIs are NOT sent to sdnc. exceptions are listed in config variable
+ String svcTypes = execution.getVariable("URN_sdnc_si_svc_types") ?: ""
+ utils.log("DEBUG", "SDNC SI serviceTypes:" + svcTypes, isDebugEnabled)
+ List svcList = Arrays.asList(svcTypes.split("\\s*,\\s*"));
+ boolean isSdncService= false
+ for (String listEntry : svcList){
+ if (listEntry.equalsIgnoreCase(serviceType)){
+ isSdncService = true
+ break;
+ }
}
+
+ //All Macros are sent to SDNC, TRANSPORT(Macro) is sent to SDNW
+ //Alacartes are sent to SDNC if they are listed in config variable above
+ execution.setVariable("sendToSDNC", true)
+ if(execution.getVariable("sdncVersion").equals("1610")) //alacarte
+ {
+ if(!isSdncService){
+ execution.setVariable("sendToSDNC", false)
+ //alacarte non-sdnc svcs must provide name (sdnc provides name for rest)
+ if (isBlank(execution.getVariable("serviceInstanceName" )))
+ {
+ msg = "Input serviceInstanceName must be provided for alacarte"
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
+ }
+ }
+ }
+
+ utils.log("DEBUG", "isSdncService: " + isSdncService, isDebugEnabled)
+ utils.log("DEBUG", "Send To SDNC: " + execution.getVariable("sendToSDNC"), isDebugEnabled)
+ utils.log("DEBUG", "Service Type: " + execution.getVariable("serviceType"), isDebugEnabled)
+
+ //macro may provide name and alacarte-portm may provide name
+ execution.setVariable("checkAAI", false)
+ if (!isBlank(execution.getVariable("serviceInstanceName" )))
+ {
+ execution.setVariable("checkAAI", true)
+ }
+
if (isBlank(serviceInstanceId)){
msg = "Input serviceInstanceId is null"
utils.log("DEBUG", msg, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
}
- if (modelInvariantUuid == null) {
- modelInvariantUuid = ""
- }
- if (modelUuid == null) {
- modelUuid = ""
- }
- if (modelVersion == null) {
- modelVersion = ""
- }
- if (modelName == null) {
- modelName = ""
- }
-
- execution.setVariable("modelInvariantUuid", modelInvariantUuid)
- execution.setVariable("modelVersion", modelVersion)
- execution.setVariable("modelUuid", modelUuid)
- execution.setVariable("modelName", modelName)
StringBuilder sbParams = new StringBuilder()
Map paramsMap = execution.getVariable("serviceInputParams")
@@ -250,7 +276,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
execution.setVariable("siParamsXml", siParamsXml)
//AAI PUT
- String oStatus = execution.getVariable("initialStatus") ?: ""
+ String oStatus = execution.getVariable("initialStatus") ?: "Active"
if ("TRANSPORT".equalsIgnoreCase(serviceType))
{
oStatus = "Created"
@@ -260,6 +286,28 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
String serviceTypeLine = isBlank(serviceType) ? "" : "${serviceType}"
String serviceRoleLine = isBlank(serviceRole) ? "" : "${serviceRole}"
+ //QUERY CATALOG DB AND GET WORKLOAD / ENVIRONMENT CONTEXT
+ String environmentContext = ""
+ String workloadContext =""
+
+ try{
+ String json = cutils.getServiceResourcesByServiceModelInvariantUuidString(execution,modelInvariantUuid )
+
+ utils.log("DEBUG", "JSON IS: "+json, isDebugEnabled)
+
+ environmentContext = jsonUtil.getJsonValue(json, "serviceResources.environmentContext") ?: ""
+ workloadContext = jsonUtil.getJsonValue(json, "serviceResources.workloadContext") ?: ""
+ utils.log("DEBUG", "Env Context is: "+ environmentContext, isDebugEnabled)
+ utils.log("DEBUG", "Workload Context is: "+ workloadContext, isDebugEnabled)
+ }catch(BpmnError e){
+ throw e
+ } catch (Exception ex){
+ msg = "Exception in preProcessRequest " + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+
+ //Create AAI Payload
AaiUtil aaiUriUtil = new AaiUtil(this)
String aai_uri = aaiUriUtil.getBusinessCustomerUri(execution)
String namespace = aaiUriUtil.getNamespaceFromUri(aai_uri)
@@ -271,12 +319,14 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
${statusLine}
${modelInvariantUuid}
${modelUuid}
+ ${environmentContext}
+ ${workloadContext}
""".trim()
execution.setVariable("serviceInstanceData", serviceInstanceData)
utils.logAudit(serviceInstanceData)
utils.log("DEBUG", " 'payload' to create Service Instance in AAI - " + "\n" + serviceInstanceData, isDebugEnabled)
-
+
} catch (BpmnError e) {
throw e;
} catch (Exception ex){
@@ -288,7 +338,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
}
//TODO: Will be able to replace with call to GenericGetService
- public void getAAICustomerById (Execution execution) {
+ public void getAAICustomerById (DelegateExecution execution) {
// https://{aaiEP}/aai/v8/business/customers/customer/{globalCustomerId}
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
@@ -360,7 +410,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
}
- public void postProcessAAIGET(Execution execution) {
+ public void postProcessAAIGET(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessAAIGET ***** ", isDebugEnabled)
String msg = ""
@@ -402,7 +452,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," *** Exit postProcessAAIGET *** ", isDebugEnabled)
}
- public void postProcessAAIPUT(Execution execution) {
+ public void postProcessAAIPUT(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessAAIPUT ***** ", isDebugEnabled)
String msg = ""
@@ -440,7 +490,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," *** Exit postProcessAAIPUT *** ", isDebugEnabled)
}
- public void preProcessSDNCAssignRequest(Execution execution) {
+ public void preProcessSDNCAssignRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
String msg = ""
utils.log("DEBUG"," ***** preProcessSDNCAssignRequest *****", isDebugEnabled)
@@ -453,7 +503,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
def serviceId = execution.getVariable("productFamilyId")
def subscriptionServiceType = execution.getVariable("subscriptionServiceType")
def globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
- def serviceType = execution.getVariable("serviceType")
+ def msoAction = ""
def modelInvariantUuid = execution.getVariable("modelInvariantUuid")
def modelVersion = execution.getVariable("modelVersion")
@@ -464,6 +514,12 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
def siParamsXml = execution.getVariable("siParamsXml")
+ // special URL for SDNW, msoAction helps set diff url in SDNCA
+ if("TRANSPORT".equalsIgnoreCase(execution.getVariable("serviceType")))
+ {
+ msoAction = "TRANSPORT"
+ }
+
String sdncAssignRequest =
"""assign
service-topology-operation
${callbackURL}
- ${serviceType}
+ ${msoAction}
@@ -488,12 +544,12 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
${serviceId}
${subscriptionServiceType}
-
+
${modelInvariantUuid}
${modelUuid}
${modelVersion}
${modelName}
-
+
${serviceInstanceId}
${globalSubscriberId}
@@ -531,7 +587,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," *****Exit preProcessSDNCAssignRequest *****", isDebugEnabled)
}
- public void postProcessSDNCAssign (Execution execution) {
+ public void postProcessSDNCAssign (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessSDNCAssign ***** ", isDebugEnabled)
try {
@@ -568,7 +624,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," *** Exit postProcessSDNCAssign *** ", isDebugEnabled)
}
- public void postProcessAAIGET2(Execution execution) {
+ public void postProcessAAIGET2(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessAAIGET2 ***** ", isDebugEnabled)
String msg = ""
@@ -611,7 +667,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," *** Exit postProcessAAIGET2 *** ", isDebugEnabled)
}
- public void preProcessRollback (Execution execution) {
+ public void preProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugEnabled)
try {
@@ -632,7 +688,7 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," *** Exit preProcessRollback *** ", isDebugEnabled)
}
- public void postProcessRollback (Execution execution) {
+ public void postProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugEnabled)
String msg = ""
@@ -652,5 +708,91 @@ public class DoCreateServiceInstance extends AbstractServiceTaskProcessor {
}
utils.log("DEBUG"," *** Exit postProcessRollback *** ", isDebugEnabled)
}
+
+ public void createProject(DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " ***** createProject ***** ", isDebugEnabled)
+
+ String bpmnRequest = execution.getVariable("requestJson")
+ String projectName = jsonUtil.getJsonValue(bpmnRequest, "requestDetails.project.projectName")
+ String serviceInstance = execution.getVariable("serviceInstanceId")
+
+ utils.log("DEBUG", "BPMN REQUEST IS: "+ bpmnRequest, isDebugEnabled)
+ utils.log("DEBUG","PROJECT NAME: " + projectName, isDebugEnabled)
+ utils.log("DEBUG","Service Instance: " + serviceInstance, isDebugEnabled)
+
+ if(projectName == null||projectName.equals("")){
+ utils.log("DEBUG", "Project Name was not found in input. Skipping task...", isDebugEnabled)
+ }else{
+ try{
+ AAICreateResources aaiCR = new AAICreateResources()
+ aaiCR.createAAIProject(projectName, serviceInstance)
+ }catch(Exception ex){
+ String msg = "Exception in createProject. " + ex.getMessage();
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ }
+ utils.log("DEBUG"," *** Exit createProject *** ", isDebugEnabled)
+ }
+
+ public void createOwningEntity(DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG", " ***** createOwningEntity ***** ", isDebugEnabled)
+ String msg = "";
+ String bpmnRequest = execution.getVariable("requestJson")
+ String owningEntityId = jsonUtil.getJsonValue(bpmnRequest, "requestDetails.owningEntity.owningEntityId")
+ String owningEntityName = jsonUtil.getJsonValue(bpmnRequest,"requestDetails.owningEntity.owningEntityName");
+ String serviceInstance = execution.getVariable("serviceInstanceId")
+
+ utils.log("DEBUG","owningEntity: " + owningEntityId, isDebugEnabled)
+ utils.log("DEBUG", "OwningEntityName: "+ owningEntityName, isDebugEnabled)
+ utils.log("DEBUG","Service Instance: " + serviceInstance, isDebugEnabled)
+
+ try{
+ AAICreateResources aaiCR = new AAICreateResources()
+ if(owningEntityId==null||owningEntityId.equals("")){
+ msg = "Exception in createOwningEntity. OwningEntityId is null in input.";
+ throw new IllegalStateException();
+ }else{
+ if(aaiCR.existsOwningEntity(owningEntityId)){
+ aaiCR.connectOwningEntityandServiceInstance(owningEntityId,serviceInstance)
+ }else{
+ if(owningEntityName==null||owningEntityName.equals("")){
+ msg = "Exception in createOwningEntity. Can't create an owningEntity without an owningEntityName in input.";
+ throw new IllegalStateException();
+ }else{
+ aaiCR.createAAIOwningEntity(owningEntityId, owningEntityName, serviceInstance)
+ }
+ }
+ }
+ }catch(Exception ex){
+ utils.log("DEBUG", msg, isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+ utils.log("DEBUG"," *** Exit createOwningEntity *** ", isDebugEnabled)
+ }
+
+ // *******************************
+ // Build Error Section
+ // *******************************
+
+ public void processJavaException(DelegateExecution execution){
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+
+ try{
+ utils.log("DEBUG", "Caught a Java Exception in DoCreateServiceInstance", isDebugEnabled)
+ utils.log("DEBUG", "Started processJavaException Method", isDebugEnabled)
+ utils.log("DEBUG", "Variables List: " + execution.getVariables(), isDebugEnabled)
+ execution.setVariable("UnexpectedError", "Caught a Java Lang Exception in DoCreateServiceInstance") // Adding this line temporarily until this flows error handling gets updated
+ exceptionUtil.buildWorkflowException(execution, 500, "Caught a Java Lang Exception in DoCreateServiceInstance")
+
+ }catch(Exception e){
+ utils.log("DEBUG", "Caught Exception during processJavaException Method: " + e, isDebugEnabled)
+ execution.setVariable("UnexpectedError", "Exception in processJavaException") // Adding this line temporarily until this flows error handling gets updated
+ exceptionUtil.buildWorkflowException(execution, 500, "Exception in processJavaException method")
+ }
+ utils.log("DEBUG", "Completed processJavaException Method in DoCreateServiceInstance", isDebugEnabled)
+ }
}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
index 9a84c6b7b8..cb69121e4e 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollback.groovy
@@ -36,7 +36,7 @@ import org.openecomp.mso.rest.RESTConfig
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONObject;
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
@@ -65,7 +65,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
String Prefix="DCRESIRB_"
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
String msg = ""
@@ -135,7 +135,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
}
- public void validateSDNCResponse(Execution execution, String response, String method) {
+ public void validateSDNCResponse(DelegateExecution execution, String response, String method) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** validateSDNCResponse ***** ", isDebugEnabled)
String msg = ""
@@ -168,7 +168,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
utils.log("DEBUG"," ***** Exit validateSDNCResponse ***** ", isDebugEnabled)
}
- public void postProcessRequest(Execution execution) {
+ public void postProcessRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessRequest ***** ", isDebugEnabled)
String msg = ""
@@ -202,7 +202,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
}
- public void processRollbackException(Execution execution){
+ public void processRollbackException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** processRollbackException ***** ", isDebugEnabled)
try{
@@ -220,7 +220,7 @@ public class DoCreateServiceInstanceRollback extends AbstractServiceTaskProcesso
utils.log("DEBUG", " Exit processRollbackException", isDebugEnabled)
}
- public void processRollbackJavaException(Execution execution){
+ public void processRollbackJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** processRollbackJavaException ***** ", isDebugEnabled)
try{
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollbackV2.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollbackV2.groovy
new file mode 100644
index 0000000000..fa4250df13
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceRollbackV2.groovy
@@ -0,0 +1,51 @@
+package org.openecomp.mso.bpmn.infrastructure.scripts
+
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
+import org.openecomp.mso.client.orchestration.AAIOrchestrator
+import org.openecomp.mso.client.orchestration.SDNCOrchestrator
+
+public class DoCreateServiceInstanceRollbackV2 extends AbstractServiceTaskProcessor{
+
+ @Override
+ public void preProcessRequest(DelegateExecution execution) {
+
+ }
+
+ public void aaiServiceInstanceRollback (DelegateExecution execution) {
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ def aaiServiceInstanceRollback = execution.getVariable("aaiServiceInstanceRollback")
+ if(aaiServiceInstanceRollback){
+ utils.log("DEBUG"," ***** Started aaiServiceInstanceRollback *****", isDebugEnabled)
+ try{
+ ServiceDecomposition serviceDecomp = execution.getVariable("ServiceDecomposition")
+ AAIOrchestrator aaiO = new AAIOrchestrator()
+ aaiO.deleteServiceInstance(serviceDecomp)
+ }catch (Exception ex) {
+ String msg = "Error Response from AAI for aaiServiceInstanceRollback"
+ execution.setVariable("rollbackError", msg)
+ utils.log("DEBUG", msg, isDebugEnabled)
+ throw new BpmnError("MSOWorkflowException")
+ }
+ utils.log("DEBUG"," ***** Completed aaiServiceInstanceRollback *****", isDebugEnabled)
+ }else{
+ utils.log("DEBUG", "***** SKIPPING A&AI ROLLBACK *****", isDebugEnabled)
+ }
+ }
+
+ public void rollbackError (DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ utils.log("DEBUG"," ***** rollbackError ***** ", isDebugEnabled)
+ try{
+ utils.log("DEBUG", "Caught an Exception in DoCreateServiceInstanceRollbackV2", isDebugEnabled)
+ }catch(BpmnError b){
+ utils.log("DEBUG", "BPMN Error during rollbackError: " + b.getMessage(), isDebugEnabled)
+ }catch(Exception e){
+ utils.log("DEBUG", "Caught Exception during rollbackError: " + e.getMessage(), isDebugEnabled)
+ }
+ utils.log("DEBUG", " Exit processRollbackException", isDebugEnabled)
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceV2.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceV2.groovy
new file mode 100644
index 0000000000..c55ce547c2
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateServiceInstanceV2.groovy
@@ -0,0 +1,101 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 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.openecomp.mso.bpmn.infrastructure.scripts;
+
+import static org.apache.commons.lang3.StringUtils.*;
+
+import org.apache.commons.lang3.*
+import org.camunda.bpm.engine.delegate.BpmnError
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
+import org.openecomp.mso.client.orchestration.AAIOrchestrator
+import org.openecomp.mso.client.orchestration.SDNCOrchestrator
+
+import groovy.json.*
+
+/**
+ * This groovy class supports the DoCreateServiceInstanceV2.bpmn process.
+ *
+*/
+
+public class DoCreateServiceInstanceV2 extends AbstractServiceTaskProcessor {
+
+ AAIOrchestrator aaiO = new AAIOrchestrator()
+ SDNCOrchestrator sdncO = new SDNCOrchestrator()
+
+ @Override
+ public void preProcessRequest(DelegateExecution execution) {
+ }
+
+ public void createServiceInstance(DelegateExecution execution) {
+ execution.setVariable("callSDNC",true)
+ if(execution.getVariable("serviceType").equalsIgnoreCase("PORT-MIRROR")== false){
+ if(execution.getVariable("sdncVersion").equals("1610")){
+ execution.setVariable("callSDNC",false);
+ }
+ }
+ ServiceDecomposition serviceDecomp = (ServiceDecomposition) execution.getVariable("serviceDecomposition")
+ try{
+ aaiO.createServiceInstance(serviceDecomp)
+ } catch (BpmnError e) {
+ throw e
+ }
+ }
+
+ public void createProject(DelegateExecution execution) {
+ ServiceDecomposition serviceDecomp = (ServiceDecomposition) execution.getVariable("serviceDecomposition")
+ if (serviceDecomp.getServiceInstance() != null && serviceDecomp.getProject() != null) {
+ try{
+ aaiO.createProjectandConnectServiceInstance(serviceDecomp)
+ } catch (BpmnError e) {
+ throw e
+ }
+ }
+ }
+
+ public void createOwningEntity(DelegateExecution execution) {
+ ServiceDecomposition serviceDecomp = (ServiceDecomposition) execution.getVariable("serviceDecomposition")
+ if (serviceDecomp.getServiceInstance() != null && serviceDecomp.getOwningEntity() != null) {
+ try{
+ aaiO.createOwningEntityandConnectServiceInstance(serviceDecomp)
+ } catch (BpmnError e) {
+ throw e
+ }
+ }
+ }
+
+ public void sdncAssignRequest(DelegateExecution execution) {
+ ServiceDecomposition serviceDecomp = (ServiceDecomposition) execution.getVariable("serviceDecomposition")
+ if (serviceDecomp != null) {
+ try {
+ sdncO.sendSyncResponse(serviceDecomp)
+ } catch (BpmnError e) {
+ throw e
+ }
+ }
+
+ }
+
+ public void rollback(DelegateExecution execution) {
+ //TODO
+ }
+
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModule.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
index 7f30fe25c7..b9319466d9 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModule.groovy
@@ -20,20 +20,31 @@
package org.openecomp.mso.bpmn.infrastructure.scripts;
+import java.util.Map
+import java.util.Currency.CurrencyNameGetter
+
import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.json.JSONArray
+import org.json.JSONObject
import org.openecomp.mso.bpmn.common.scripts.AaiUtil
+import org.openecomp.mso.bpmn.common.scripts.CatalogDbUtils
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.common.scripts.NetworkUtils
import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
import org.openecomp.mso.bpmn.common.scripts.VfModuleBase
import org.openecomp.mso.bpmn.core.RollbackData
import org.openecomp.mso.bpmn.core.WorkflowException
+import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
+import org.openecomp.mso.bpmn.core.domain.VnfResource
+import org.openecomp.mso.bpmn.core.json.DecomposeJsonUtil
import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.openecomp.mso.client.aai.entities.AAIResultWrapper
+import org.openecomp.mso.client.aai.entities.uri.AAIUri
import org.openecomp.mso.rest.APIResponse
import org.openecomp.mso.rest.RESTClient
import org.openecomp.mso.rest.RESTConfig
@@ -44,6 +55,13 @@ import org.w3c.dom.NamedNodeMap
import org.w3c.dom.Node
import org.w3c.dom.NodeList
import org.xml.sax.InputSource
+import com.fasterxml.jackson.databind.ObjectMapper
+
+import com.fasterxml.jackson.databind.DeserializationFeature
+import com.fasterxml.jackson.databind.ObjectMapper
+import org.openecomp.mso.client.aai.AAIObjectType;
+import org.openecomp.mso.client.aai.AAIResourcesClient
+import org.openecomp.mso.client.aai.entities.uri.AAIUriFactory;
@@ -53,12 +71,14 @@ public class DoCreateVfModule extends VfModuleBase {
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
+ CatalogDbUtils catalog = new CatalogDbUtils()
+ DecomposeJsonUtil decomposeJsonUtils = new DecomposeJsonUtil()
/**
* Validates the request message and sets up the workflow.
* @param execution the execution
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessRequest(' +
'execution=' + execution.getId() +
')'
@@ -85,8 +105,10 @@ public class DoCreateVfModule extends VfModuleBase {
def serviceModelInfo = execution.getVariable("serviceModelInfo")
logDebug("serviceModelInfo: " + serviceModelInfo, isDebugLogEnabled)
- def vnfModelInfo = execution.getVariable("vnfModelInfo")
+ String modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid")
+ logDebug("modelInvariantUuid: " + modelInvariantUuid, isDebugLogEnabled)
+ def vnfModelInfo = execution.getVariable("vnfModelInfo")
//tenantId
def tenantId = execution.getVariable("tenantId")
@@ -174,7 +196,7 @@ public class DoCreateVfModule extends VfModuleBase {
execution.setVariable("DCVFM_asdcServiceModelVersion", asdcServiceModelVersion)
logDebug("asdcServiceModelVersion: " + asdcServiceModelVersion, isDebugLogEnabled)
//personaModelId
- execution.setVariable("DCVFM_personaModelId", jsonUtil.getJsonValue(vfModuleModelInfo, "modelInvariantUuid"))
+ execution.setVariable("DCVFM_personaModelId", jsonUtil.getJsonValue(vfModuleModelInfo, "modelInvariantUuid"))
//personaModelVersion
execution.setVariable("DCVFM_personaModelVersion", jsonUtil.getJsonValue(vfModuleModelInfo, "modelUuid"))
//vfModuleLabel
@@ -210,7 +232,42 @@ public class DoCreateVfModule extends VfModuleBase {
def usePreload = execution.getVariable("usePreload")
execution.setVariable("DCVFM_usePreload", usePreload)
logDebug("usePreload: " + usePreload, isDebugLogEnabled)
-
+ //aLaCarte
+ def aLaCarte = execution.getVariable("aLaCarte")
+ execution.setVariable("DCVFM_aLaCarte", aLaCarte)
+ logDebug("aLaCarte: " + aLaCarte, isDebugLogEnabled)
+
+ //get workload and environment context from parent SI
+ String environmentContext = ""
+ String workloadContext =""
+ String serviceType =""
+
+ try{
+ String json = catalog.getServiceResourcesByServiceModelInvariantUuidString(execution,modelInvariantUuid )
+ serviceType = jsonUtil.getJsonValue(json, "serviceResources.serviceType")
+ }catch(BpmnError e){
+ throw e
+ } catch (Exception ex){
+ String msg = "Exception in preProcessRequest " + ex.getMessage()
+ utils.log("DEBUG", msg, isDebugLogEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
+
+ try{
+ AAIUri serviceInstanceURI = AAIUriFactory.create(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId,serviceType,serviceInstanceId)
+ AAIResourcesClient aaiRC = new AAIResourcesClient()
+ AAIResultWrapper aaiRW = aaiRC.get(serviceInstanceURI)
+ Map aaiJson = aaiRW.asMap()
+ environmentContext = aaiJson.getOrDefault("environment-context","")
+ workloadContext = aaiJson.getOrDefault("workload-context","")
+
+ }catch (Exception ex) {
+ utils.log("DEBUG","Error retreiving parent service instance information", isDebugLogEnabled)
+ }
+
+ execution.setVariable("DCVFM_environmentContext",environmentContext)
+ execution.setVariable("DCVFM_workloadContext",workloadContext)
+
}
else {
// The info is inside the request - DEAD CODE
@@ -338,8 +395,7 @@ public class DoCreateVfModule extends VfModuleBase {
isBaseVfModule = utils.getNodeText(request, "is-base-vf-module")
}
execution.setVariable("DCVFM_isBaseVfModule", isBaseVfModule)
- logDebug("isBaseVfModule: " + isBaseVfModule, isDebugLogEnabled)
-
+ logDebug("isBaseVfModule: " + isBaseVfModule, isDebugLogEnabled)
//asdcServiceModelVersion
def asdcServiceModelVersion = ""
if (utils.nodeExists(request, "asdc-service-model-version")) {
@@ -426,6 +482,7 @@ public class DoCreateVfModule extends VfModuleBase {
rollbackData.put("VFMODULE", "rollbackCreateAAIVfModule", "false")
rollbackData.put("VFMODULE", "rollbackCreateNetworkPoliciesAAI", "false")
rollbackData.put("VFMODULE", "rollbackUpdateVnfAAI", "false")
+ rollbackData.put("VFMODULE", "heatstackid", "")
String sdncCallbackUrl = (String) execution.getVariable('URN_mso_workflow_sdncadapter_callback')
if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
@@ -455,7 +512,7 @@ public class DoCreateVfModule extends VfModuleBase {
* @param responseCodeVar the execution variable in which the response code is stored
* @param errorResponseVar the execution variable in which the error response is stored
*/
- public void validateWorkflowResponse(Execution execution, String responseVar,
+ public void validateWorkflowResponse(DelegateExecution execution, String responseVar,
String responseCodeVar, String errorResponseVar) {
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
sdncAdapterUtils.validateSDNCResponse(execution, responseVar, responseCodeVar, errorResponseVar)
@@ -466,7 +523,7 @@ public class DoCreateVfModule extends VfModuleBase {
* Sends the empty, synchronous response back to the API Handler.
* @param execution the execution
*/
- public void sendResponse(Execution execution) {
+ public void sendResponse(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.sendResponse(' +
'execution=' + execution.getId() +
')'
@@ -491,7 +548,7 @@ public class DoCreateVfModule extends VfModuleBase {
*
* @param execution The flow's execution instance.
*/
- public void postProcessCreateAAIVfModule(Execution execution) {
+ public void postProcessCreateAAIVfModule(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.getVfModule(' +
'execution=' + execution.getId() +
')'
@@ -538,7 +595,7 @@ public class DoCreateVfModule extends VfModuleBase {
*
* @param execution The flow's execution instance.
*/
- public void queryAAIVfModule(Execution execution) {
+ public void queryAAIVfModule(DelegateExecution execution) {
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
def method = getClass().getSimpleName() + '.getVfModule(' +
'execution=' + execution.getId() +
@@ -618,9 +675,95 @@ public class DoCreateVfModule extends VfModuleBase {
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModule(): ' + e.getMessage())
}
}
+
+ /**
+ * Using the vnfId and vfModuleName provided in the inputs,
+ * query AAI to get the corresponding VF Module info.
+ * A 200 response is expected with the VF Module info in the response body,
+ * or a 404 response if the module does not exist yet. Will determine VF Module's
+ * orchestration status if one exists
+ *
+ * @param execution The flow's execution instance.
+ */
+ public void queryAAIVfModuleForStatus(DelegateExecution execution) {
+ def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
+ def method = getClass().getSimpleName() + '.queryAAIVfModuleForStatus(' +
+ 'execution=' + execution.getId() +
+ ')'
+ logDebug('Entered ' + method, isDebugLogEnabled)
+
+ execution.setVariable('DCVFM_orchestrationStatus', '')
+
+ try {
+ def vnfId = execution.getVariable('DCVFM_vnfId')
+ def vfModuleName = execution.getVariable('DCVFM_vfModuleName')
+
+ AaiUtil aaiUriUtil = new AaiUtil(this)
+ String aai_uri = aaiUriUtil.getNetworkGenericVnfUri(execution)
+ logDebug('AAI URI is: ' + aai_uri, isDebugLogEnabled)
+
+ String endPoint = execution.getVariable("URN_aai_endpoint") + "${aai_uri}/" + UriUtils.encode(vnfId, "UTF-8") +
+ "/vf-modules/vf-module?vf-module-name=" + UriUtils.encode(vfModuleName, "UTF-8")
+ utils.logAudit("AAI endPoint: " + endPoint)
+
+ try {
+ RESTConfig config = new RESTConfig(endPoint);
+ def responseData = ''
+ def aaiRequestId = UUID.randomUUID().toString()
+ RESTClient client = new RESTClient(config).
+ addHeader('X-TransactionId', aaiRequestId).
+ addHeader('X-FromAppId', 'MSO').
+ addHeader('Content-Type', 'application/xml').
+ addHeader('Accept','application/xml');
+ logDebug('sending GET to AAI endpoint \'' + endPoint + '\'', isDebugLogEnabled)
+ APIResponse response = client.httpGet()
+ utils.logAudit("createVfModule - invoking httpGet() to AAI")
+
+ responseData = response.getResponseBodyAsString()
+ if (responseData != null) {
+ logDebug("Received generic VNF data: " + responseData, isDebugLogEnabled)
+
+ }
+
+ utils.logAudit("createVfModule - queryAAIVfModule Response: " + responseData)
+ utils.logAudit("createVfModule - queryAAIVfModule ResponseCode: " + response.getStatusCode())
+
+ execution.setVariable('DCVFM_queryAAIVfModuleForStatusResponseCode', response.getStatusCode())
+ execution.setVariable('DCVFM_queryAAIVfModuleForStatusResponse', responseData)
+ logDebug('Response code:' + response.getStatusCode(), isDebugLogEnabled)
+ logDebug('Response:' + System.lineSeparator() + responseData, isDebugLogEnabled)
+ // Retrieve VF Module info and its orchestration status; if not found, do nothing
+ if (response.getStatusCode() == 200) {
+ // Parse the VNF record from A&AI to find base module info
+ logDebug('Parsing the VNF data to find orchestration status', isDebugLogEnabled)
+ if (responseData != null) {
+ def vfModuleText = utils.getNodeXml(responseData, "vf-module")
+ //def xmlVfModule= new XmlSlurper().parseText(vfModuleText)
+ def orchestrationStatus = utils.getNodeText1(vfModuleText, "orchestration-status")
+ execution.setVariable("DCVFM_orchestrationStatus", orchestrationStatus)
+ // Also retrieve vfModuleId
+ def vfModuleId = utils.getNodeText1(vfModuleText, "vf-module-id")
+ execution.setVariable("DCVFM_vfModuleId", vfModuleId)
+ logDebug("Received orchestration status from A&AI: " + orchestrationStatus, isDebugLogEnabled)
+
+ }
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace()
+ logDebug('Exception occurred while executing AAI GET:' + ex.getMessage(),isDebugLogEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
+ }
+ logDebug('Exited ' + method, isDebugLogEnabled)
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception e) {
+ logError('Caught exception in ' + method, e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModuleForStatus(): ' + e.getMessage())
+ }
+ }
- public void preProcessSDNCAssignRequest(Execution execution){
+ public void preProcessSDNCAssignRequest(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
@@ -656,7 +799,7 @@ public class DoCreateVfModule extends VfModuleBase {
logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
}
- public void preProcessSDNCGetRequest(Execution execution, String element){
+ public void preProcessSDNCGetRequest(DelegateExecution execution, String element){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
String sdncVersion = execution.getVariable("DCVFM_sdncVersion")
execution.setVariable("prefix", Prefix)
@@ -749,7 +892,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
- public void preProcessVNFAdapterRequest(Execution execution) {
+ public void preProcessVNFAdapterRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.VNFAdapterCreateVfModule(' +
'execution=' + execution.getId() +
')'
@@ -798,7 +941,13 @@ public class DoCreateVfModule extends VfModuleBase {
def volumeGroupStackId = execution.getVariable("DCVFM_volumeGroupStackId")
//modelCustomizationUuid
def modelCustomizationUuid = execution.getVariable("DCVFM_modelCustomizationUuid")
-
+ //environmentContext
+ String environmentContext = execution.getVariable("DCVFM_environmentContext")
+ //workloadContext
+ String workloadContext = execution.getVariable("DCVFM_workloadContext")
+ logDebug("workloadContext: " + workloadContext, isDebugLogEnabled)
+ logDebug("environmentContext: " + environmentContext, isDebugLogEnabled)
+
def messageId = execution.getVariable('mso-request-id') + '-' +
System.currentTimeMillis()
@@ -822,7 +971,7 @@ public class DoCreateVfModule extends VfModuleBase {
if (!sdncVersion.equals("1707")) {
vfModuleParams = buildVfModuleParams(vnfParamsMap, vfModuleSdncGetResponse, vnfId, vnfName,
- vfModuleId, vfModuleName, vfModuleIndex)
+ vfModuleId, vfModuleName, vfModuleIndex, environmentContext, workloadContext)
}
else {
//Get SDNC Response Data for Vnf Topology
@@ -830,7 +979,7 @@ public class DoCreateVfModule extends VfModuleBase {
utils.logAudit("vnfSdncGetResponse: " + vnfSdncGetResponse)
vfModuleParams = buildVfModuleParamsFromCombinedTopologies(vnfParamsMap, vnfSdncGetResponse, vfModuleSdncGetResponse, vnfId, vnfName,
- vfModuleId, vfModuleName, vfModuleIndex)
+ vfModuleId, vfModuleName, vfModuleIndex, environmentContext, workloadContext)
}
def svcInstId = ""
@@ -884,7 +1033,7 @@ public class DoCreateVfModule extends VfModuleBase {
* @param execution the execution
* @return the validated request
*/
- public String validateInfraRequest(Execution execution) {
+ public String validateInfraRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.validateInfraRequest(' +
'execution=' + execution.getId() +
')'
@@ -945,7 +1094,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
}
- public boolean isVolumeGroupIdPresent(Execution execution) {
+ public boolean isVolumeGroupIdPresent(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.isVolumeGroupIdPresent(' +
'execution=' + execution.getId() +
@@ -966,7 +1115,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
- public boolean isVolumeGroupNamePresent(Execution execution) {
+ public boolean isVolumeGroupNamePresent(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.isVolumeGroupNamePresent(' +
'execution=' + execution.getId() +
@@ -987,7 +1136,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
- public String buildSDNCRequest(Execution execution, String svcInstId, String action){
+ public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
String uuid = execution.getVariable('testReqId') // for junits
if(uuid==null){
@@ -1176,7 +1325,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
- public void preProcessSDNCActivateRequest(Execution execution) {
+ public void preProcessSDNCActivateRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessSDNCActivateRequest(' +
'execution=' + execution.getId() +
')'
@@ -1209,7 +1358,7 @@ public class DoCreateVfModule extends VfModuleBase {
logDebug("======== COMPLETED preProcessSDNCActivateRequest Process ======== ", isDebugLogEnabled)
}
- public void postProcessVNFAdapterRequest(Execution execution) {
+ public void postProcessVNFAdapterRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessVNFAdapterRequest(' +
'execution=' + execution.getId() +
')'
@@ -1298,7 +1447,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
- public void preProcessUpdateAAIVfModuleRequestOrch(Execution execution) {
+ public void preProcessUpdateAAIVfModuleRequestOrch(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessUpdateAAIVfModuleRequestOrch(' +
'execution=' + execution.getId() +
')'
@@ -1315,6 +1464,8 @@ public class DoCreateVfModule extends VfModuleBase {
if (!contrailServiceInstanceFqdn.equals("")) {
setContrailServiceInstanceFqdn = true
}
+
+ execution.setVariable("DCVFM_orchestrationStatus", "Created")
String updateAAIVfModuleRequest = buildUpdateAAIVfModuleRequest(execution, false, true, true, setContrailServiceInstanceFqdn)
@@ -1330,8 +1481,38 @@ public class DoCreateVfModule extends VfModuleBase {
logDebug("======== COMPLETED preProcessUpdateAAIVfModuleRequestOrch ======== ", isDebugLogEnabled)
}
+
+ public void preProcessUpdateAAIVfModuleRequestStatus(DelegateExecution execution, String status) {
+ def method = getClass().getSimpleName() + '.preProcessUpdateAAIVfModuleStatus(' +
+ 'execution=' + execution.getId() +
+ ')'
+ def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
+ logDebug('Entered ' + method, isDebugLogEnabled)
+ execution.setVariable("prefix", Prefix)
+ logDebug(" ======== STARTED preProcessUpdateAAIVfModuleStatus ======== ", isDebugLogEnabled)
+
+ try{
+
+ //Build UpdateAAIVfModule Request
+ execution.setVariable("DCVFM_orchestrationStatus", status)
+
+ String updateAAIVfModuleRequest = buildUpdateAAIVfModuleRequest(execution, false, true, false, false)
+
+ updateAAIVfModuleRequest = utils.formatXml(updateAAIVfModuleRequest)
+ execution.setVariable("DCVFM_updateAAIVfModuleRequest", updateAAIVfModuleRequest)
+ logDebug("Outgoing UpdateAAIVfModuleRequest is: \n" + updateAAIVfModuleRequest, isDebugLogEnabled)
+ utils.logAudit("Outgoing UpdateAAIVfModuleRequest is: \n" + updateAAIVfModuleRequest)
+
+ }catch(Exception e){
+ utils.log("ERROR", "Exception Occured Processing preProcessUpdateAAIVfModuleStatus. Exception is:\n" + e, isDebugLogEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessUpdateAAIVfModuleStatus Method:\n" + e.getMessage())
+ }
+ logDebug("======== COMPLETED preProcessUpdateAAIVfModuleStatus ======== ", isDebugLogEnabled)
+
+ }
- public void preProcessUpdateAAIVfModuleRequestGroup(Execution execution) {
+
+ public void preProcessUpdateAAIVfModuleRequestGroup(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessUpdateAAIVfModuleRequestGroup(' +
'execution=' + execution.getId() +
')'
@@ -1359,7 +1540,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
- public void validateSDNCResponse(Execution execution, String response, String method){
+ public void validateSDNCResponse(DelegateExecution execution, String response, String method){
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
logDebug(" *** STARTED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
@@ -1394,7 +1575,7 @@ public class DoCreateVfModule extends VfModuleBase {
logDebug(" *** COMPLETED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
}
- public void preProcessUpdateAfterCreateRequest(Execution execution){
+ public void preProcessUpdateAfterCreateRequest(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
utils.log("DEBUG", " ======== STARTED preProcessRequest Process ======== ", isDebugLogEnabled)
@@ -1441,7 +1622,7 @@ public class DoCreateVfModule extends VfModuleBase {
utils.log("DEBUG", "======== COMPLETED preProcessSDNCGetRequest Process ======== ", isDebugLogEnabled)
}
- public String buildUpdateAAIVfModuleRequest(Execution execution, boolean updateVolumeGroupId,
+ public String buildUpdateAAIVfModuleRequest(DelegateExecution execution, boolean updateVolumeGroupId,
boolean updateOrchestrationStatus, boolean updateHeatStackId, boolean updateContrailFqdn){
def vnfId = execution.getVariable("DCVFM_vnfId")
@@ -1453,7 +1634,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
def orchestrationStatusString = ""
if (updateOrchestrationStatus) {
- orchestrationStatusString = "Created"
+ orchestrationStatusString = "" + execution.getVariable("DCVFM_orchestrationStatus") + ""
}
def heatStackIdString = ""
if (updateHeatStackId) {
@@ -1480,7 +1661,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
- public String buildSDNCParamsXml(Execution execution){
+ public String buildSDNCParamsXml(DelegateExecution execution){
String params = ""
StringBuilder sb = new StringBuilder()
@@ -1505,7 +1686,7 @@ public class DoCreateVfModule extends VfModuleBase {
return params
}
- public void queryCloudRegion (Execution execution) {
+ public void queryCloudRegion (DelegateExecution execution) {
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
utils.log("DEBUG", " ======== STARTED queryCloudRegion ======== ", isDebugLogEnabled)
@@ -1557,7 +1738,7 @@ public class DoCreateVfModule extends VfModuleBase {
*variables and ensures that the "WorkflowException" Variable is set.
*
*/
- public void processBPMNException(Execution execution){
+ public void processBPMNException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
try{
@@ -1574,7 +1755,7 @@ public class DoCreateVfModule extends VfModuleBase {
utils.log("DEBUG", "Completed processBPMNException Method", isDebugEnabled)
}
- public void prepareCreateAAIVfModuleVolumeGroupRequest(Execution execution) {
+ public void prepareCreateAAIVfModuleVolumeGroupRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.prepareCreateAAIVfModuleVolumeGroupRequest(' +
'execution=' + execution.getId() +
')'
@@ -1613,7 +1794,7 @@ public class DoCreateVfModule extends VfModuleBase {
}
- public void createNetworkPoliciesInAAI(Execution execution) {
+ public void createNetworkPoliciesInAAI(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.createNetworkPoliciesInAAI(' +
'execution=' + execution.getId() +
')'
@@ -1763,7 +1944,7 @@ public class DoCreateVfModule extends VfModuleBase {
*
* @param execution The flow's execution instance.
*/
- public void prepUpdateAAIGenericVnf(Execution execution) {
+ public void prepUpdateAAIGenericVnf(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.prepUpdateAAIGenericVnf(' +
'execution=' + execution.getId() +
')'
@@ -1816,7 +1997,7 @@ public class DoCreateVfModule extends VfModuleBase {
*
* @param execution The flow's execution instance.
*/
- public void postProcessUpdateAAIGenericVnf(Execution execution) {
+ public void postProcessUpdateAAIGenericVnf(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessUpdateAAIGenericVnf(' +
'execution=' + execution.getId() +
')'
@@ -1824,7 +2005,7 @@ public class DoCreateVfModule extends VfModuleBase {
logDebug('Entered ' + method, isDebugLogEnabled)
try {
- def rollbackData = execution.getVariable("RollbackData")
+ def rollbackData = execution.getVariable("rollbackData")
rollbackData.put("VFMODULE", "rollbackUpdateVnfAAI", "true")
@@ -1842,7 +2023,7 @@ public class DoCreateVfModule extends VfModuleBase {
rollbackData.put("VFMODULE", "oamManagementV6Address", oamManagementV6Address)
}
- execution.setVariable("RollbackData", rollbackData)
+ execution.setVariable("rollbackData", rollbackData)
logDebug('Exited ' + method, isDebugLogEnabled)
} catch (BpmnError e) {
@@ -1853,7 +2034,62 @@ public class DoCreateVfModule extends VfModuleBase {
}
}
- public void preProcessRollback (Execution execution) {
+ public void queryCatalogDB (DelegateExecution execution) {
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ String msg = ""
+ utils.log("DEBUG"," ***** queryCatalogDB *****", isDebugEnabled)
+
+ try {
+ boolean twoPhaseDesign = false
+ // check for input
+
+ String vfModuleModelName = execution.getVariable("DCVFM_vfModuleModelName")
+ utils.log("DEBUG", "vfModuleModelName: " + vfModuleModelName, isDebugEnabled)
+ def vnfModelInfo = execution.getVariable("vnfModelInfo")
+ def vnfModelCustomizationUuid = jsonUtil.getJsonValue(vnfModelInfo, "modelCustomizationUuid")
+
+ utils.log("DEBUG", "vnfModelCustomizationUuid: " + vnfModelCustomizationUuid, isDebugEnabled)
+
+ JSONArray vnfs = catalog.getAllVnfsByVnfModelCustomizationUuid(execution, vnfModelCustomizationUuid, "v2")
+
+ utils.log("DEBUG", "Incoming Query Catalog DB for Vnf Response is: " + vnfModelCustomizationUuid, isDebugEnabled)
+ utils.logAudit("Incoming Query Catalog DB for Vf Module Response is: " + vnfModelCustomizationUuid)
+
+ utils.log("DEBUG", "obtained VNF list")
+ // Only one match here
+ if (vnfs != null) {
+ JSONObject vnfObject = vnfs.get(0)
+ if (vnfObject != null) {
+ String vnfJson = vnfObject.toString()
+ //
+ ObjectMapper om = new ObjectMapper();
+ VnfResource vnf = om.readValue(vnfJson, VnfResource.class);
+
+ // Get multiStageDesign flag
+
+ String multiStageDesignValue = vnf.getMultiStageDesign()
+ utils.log("DEBUG", "multiStageDesign value from Catalog DB is: " + multiStageDesignValue, isDebugEnabled)
+ if (multiStageDesignValue != null) {
+ if (multiStageDesignValue.equalsIgnoreCase("true")) {
+ twoPhaseDesign = true
+ }
+ }
+ }
+ }
+
+ utils.log("DEBUG", "setting twoPhaseDesign flag to: " + twoPhaseDesign, isDebugEnabled)
+
+ execution.setVariable("DCVFM_twoPhaseDesign", twoPhaseDesign)
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception e) {
+ logError('Caught exception in queryCatalogDB()', e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryCatalogDB(): ' + e.getMessage())
+ }
+ }
+
+
+ public void preProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugEnabled)
try {
@@ -1874,7 +2110,7 @@ public class DoCreateVfModule extends VfModuleBase {
utils.log("DEBUG"," *** Exit preProcessRollback *** ", isDebugEnabled)
}
- public void postProcessRollback (Execution execution) {
+ public void postProcessRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugEnabled)
String msg = ""
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy
index 3ed768aa54..f862a00ac2 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleRollback.groovy
@@ -20,7 +20,7 @@
package org.openecomp.mso.bpmn.infrastructure.scripts
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.openecomp.mso.bpmn.common.scripts.AaiUtil
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
@@ -36,13 +36,13 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
def Prefix="DCVFMR_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
- public void initProcessVariables(Execution execution) {
+ public void initProcessVariables(DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
}
// parse the incoming DELETE_VF_MODULE request for the Generic Vnf and Vf Module Ids
// and formulate the outgoing request for PrepareUpdateAAIVfModuleRequest
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
initProcessVariables(execution)
@@ -141,7 +141,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
// build a SDNC vnf-topology-operation request for the specified action
// (note: the action passed is expected to be 'changedelete' or 'delete')
- public void prepSDNCAdapterRequest(Execution execution) {
+ public void prepSDNCAdapterRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String srvInstId = execution.getVariable("DCVFMR_serviceInstanceId")
@@ -232,7 +232,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
execution.setVariable("sdncAdapterWorkflowRequest", request)
}
- public void preProcessSDNCDeactivateRequest(Execution execution){
+ public void preProcessSDNCDeactivateRequest(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED preProcessSDNCDeactivateRequest ======== ", isDebugLogEnabled)
@@ -256,7 +256,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
logDebug("======== COMPLETED preProcessSDNCDeactivateRequest ======== ", isDebugLogEnabled)
}
- public void preProcessSDNCUnassignRequest(Execution execution) {
+ public void preProcessSDNCUnassignRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessSDNCUnassignRequest(' +
'execution=' + execution.getId() +
')'
@@ -280,7 +280,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
logDebug("======== COMPLETED preProcessSDNCUnassignRequest Process ======== ", isDebugLogEnabled)
}
- public String buildSDNCRequest(Execution execution, String svcInstId, String action){
+ public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
String uuid = execution.getVariable('testReqId') // for junits
if(uuid==null){
@@ -340,7 +340,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
// parse the incoming DELETE_VF_MODULE request
// and formulate the outgoing VnfAdapterDeleteV1 request
- public void prepVNFAdapterRequest(Execution execution) {
+ public void prepVNFAdapterRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String requestId = UUID.randomUUID().toString()
String origRequestId = execution.getVariable("DCVFMR_requestId")
@@ -382,7 +382,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
// parse the incoming DELETE_VF_MODULE request
// and formulate the outgoing UpdateAAIVfModuleRequest request
- public void prepUpdateAAIVfModule(Execution execution) {
+ public void prepUpdateAAIVfModule(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String vnfId = execution.getVariable("DCVFMR_vnfId")
String vfModuleId = execution.getVariable("DCVFMR_vfModuleId")
@@ -397,10 +397,28 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
utils.logAudit("UpdateAAIVfModule Request: " + request)
execution.setVariable("UpdateAAIVfModuleRequest", request)
}
+
+ // parse the incoming DELETE_VF_MODULE request
+ // and formulate the outgoing UpdateAAIVfModuleRequest request
+ public void prepUpdateAAIVfModuleToAssigned(DelegateExecution execution) {
+ def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ String vnfId = execution.getVariable("DCVFMR_vnfId")
+ String vfModuleId = execution.getVariable("DCVFMR_vfModuleId")
+ // formulate the request for UpdateAAIVfModule
+ String request = """
+ ${vnfId}
+ ${vfModuleId}
+
+ Assigned
+ """ as String
+ utils.log("DEBUG", "UpdateAAIVfModuleRequest :" + request, isDebugEnabled)
+ utils.logAudit("UpdateAAIVfModule Request: " + request)
+ execution.setVariable("UpdateAAIVfModuleRequest", request)
+ }
// parse the incoming DELETE_VF_MODULE request
// and formulate the outgoing DeleteAAIVfModuleRequest request
- public void prepDeleteAAIVfModule(Execution execution) {
+ public void prepDeleteAAIVfModule(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String vnfId = execution.getVariable("DCVFMR_vnfId")
String vfModuleId = execution.getVariable("DCVFMR_vfModuleId")
@@ -416,7 +434,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
// generates a WorkflowException if
// -
- public void handleDoDeleteVfModuleFailure(Execution execution) {
+ public void handleDoDeleteVfModuleFailure(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("ERROR", "AAI error occurred deleting the Generic Vnf: "
+ execution.getVariable("DoDVfMod_deleteGenericVnfResponse"), isDebugEnabled)
@@ -425,7 +443,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
}
- public void sdncValidateResponse(Execution execution, String response){
+ public void sdncValidateResponse(DelegateExecution execution, String response){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -442,7 +460,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
}
}
- public void deleteNetworkPoliciesFromAAI(Execution execution) {
+ public void deleteNetworkPoliciesFromAAI(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.deleteNetworkPoliciesFromAAI(' +
'execution=' + execution.getId() +
')'
@@ -576,7 +594,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
*
* @param execution The flow's execution instance.
*/
- public void preProcessUpdateAAIGenericVnf(Execution execution) {
+ public void preProcessUpdateAAIGenericVnf(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessUpdateAAIGenericVnf((' +
'execution=' + execution.getId() +
')'
@@ -621,7 +639,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
}
}
- public void setSuccessfulRollbackStatus (Execution execution){
+ public void setSuccessfulRollbackStatus (DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED setSuccessfulRollbackStatus ======== ", isDebugLogEnabled)
@@ -638,7 +656,7 @@ public class DoCreateVfModuleRollback extends AbstractServiceTaskProcessor{
logDebug("======== COMPLETED setSuccessfulRollbackStatus ======== ", isDebugLogEnabled)
}
- public void setFailedRollbackStatus (Execution execution){
+ public void setFailedRollbackStatus (DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED setFailedRollbackStatus ======== ", isDebugLogEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeRollback.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeRollback.groovy
index 0cbcfabddd..e903a547f7 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeRollback.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeRollback.groovy
@@ -26,7 +26,7 @@ import groovy.json.*
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.openecomp.mso.bpmn.common.scripts.AaiUtil
@@ -52,7 +52,7 @@ public class DoCreateVfModuleVolumeRollback extends AbstractServiceTaskProcessor
* This method is executed during the preProcessRequest task of the DoCreateVfModuleVolumeRollback.bpmn process.
* @param execution
*/
- public InitializeProcessVariables(Execution execution){
+ public InitializeProcessVariables(DelegateExecution execution){
/* Initialize all the process variables in this block */
execution.setVariable(Prefix + "volumeGroupName", null)
@@ -68,7 +68,7 @@ public class DoCreateVfModuleVolumeRollback extends AbstractServiceTaskProcessor
* This method is executed during the preProcessRequest task of the DoCreateVfModuleVolumeRollback.bpmn process.
* @param execution
*/
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
InitializeProcessVariables(execution)
@@ -120,7 +120,7 @@ public class DoCreateVfModuleVolumeRollback extends AbstractServiceTaskProcessor
* @param execution
* @param isDebugEnabled
*/
- public void callRESTQueryAAIVolGrpName(Execution execution, isDebugEnabled) {
+ public void callRESTQueryAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
def volumeGroupName = execution.getVariable('DCVFMODVOLRBK_volumeGroupName')
def cloudRegion = execution.getVariable('DCVFMODVOLRBK_lcpCloudRegionId')
@@ -169,7 +169,7 @@ public class DoCreateVfModuleVolumeRollback extends AbstractServiceTaskProcessor
- public void callRESTDeleteAAIVolumeGroup(Execution execution, isDebugEnabled) {
+ public void callRESTDeleteAAIVolumeGroup(DelegateExecution execution, isDebugEnabled) {
callRESTQueryAAIVolGrpName(execution, isDebugEnabled)
@@ -216,7 +216,7 @@ public class DoCreateVfModuleVolumeRollback extends AbstractServiceTaskProcessor
- public void processJavaException(Execution execution){
+ public void processJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2.groovy
index 2d004b88ac..13a7ffa498 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVfModuleVolumeV2.groovy
@@ -21,7 +21,7 @@ import org.springframework.web.util.UriUtils
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
@@ -35,12 +35,12 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* Perform initial processing, such as request validation, initialization of variables, etc.
* * @param execution
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
preProcessRequest(execution, isDebugEnabled)
}
- public void preProcessRequest(Execution execution, isDebugLogEnabled) {
+ public void preProcessRequest(DelegateExecution execution, isDebugLogEnabled) {
execution.setVariable("prefix",prefix)
execution.setVariable(prefix+'SuccessIndicator', false)
@@ -88,7 +88,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugLogEnabled
*/
- public void displayInput(Execution execution, isDebugLogEnabled) {
+ public void displayInput(DelegateExecution execution, isDebugLogEnabled) {
def input = ['mso-request-id', 'msoRequestId', 'isDebugLogEnabled', 'disableRollback', 'failIfExists', 'serviceInstanceId',
'vnfId', 'vnfName', 'tenantId', 'volumeGroupId', 'volumeGroupName', 'lcpCloudRegionId', 'vnfType', 'vfModuleModelInfo', 'asdcServiceModelVersion',
'test-volume-group-name', 'test-volume-group-id', 'vfModuleInputParams']
@@ -106,7 +106,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugEnabled
*/
- public void setRollbackData(Execution execution, isDebugEnabled) {
+ public void setRollbackData(DelegateExecution execution, isDebugEnabled) {
def rollbackData = execution.getVariable("rollbackData")
if (rollbackData == null) {
rollbackData = new RollbackData()
@@ -122,7 +122,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugEnabled
*/
- public void validateGetServiceInstanceCall(Execution execution, isDebugEnabled) {
+ public void validateGetServiceInstanceCall(DelegateExecution execution, isDebugEnabled) {
def found = execution.getVariable('GENGS_FoundIndicator')
def success = execution.getVariable('GENGS_SuccessIndicator')
def serviceInstanceId = execution.getVariable('serviceInstanceId')
@@ -141,7 +141,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugEnabled
*/
- public void callRESTQueryAAICloudRegion (Execution execution, isDebugEnabled) {
+ public void callRESTQueryAAICloudRegion (DelegateExecution execution, isDebugEnabled) {
def cloudRegion = execution.getVariable("lcpCloudRegionId")
utils.log("DEBUG", 'Request cloud region is: ' + cloudRegion, isDebugEnabled)
@@ -184,7 +184,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugEnabled
*/
- public void callRESTQueryAAIVolGrpName(Execution execution, isDebugEnabled) {
+ public void callRESTQueryAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
def volumeGroupName = execution.getVariable('volumeGroupName')
def cloudRegion = execution.getVariable('lcpCloudRegionId')
@@ -235,7 +235,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugEnabled
*/
- public void buildWorkflowException(Execution execution, int errorCode, errorMessage, isDebugEnabled) {
+ public void buildWorkflowException(DelegateExecution execution, int errorCode, errorMessage, isDebugEnabled) {
utils.log("DEBUG", errorMessage, isDebugEnabled)
(new ExceptionUtil()).buildWorkflowException(execution, 2500, errorMessage)
}
@@ -246,7 +246,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugEnabled
*/
- public void handleError(Execution execution, isDebugEnabled) {
+ public void handleError(DelegateExecution execution, isDebugEnabled) {
WorkflowException we = execution.getVariable('WorkflowException')
if (we == null) {
(new ExceptionUtil()).buildWorkflowException(execution, 2500, "Enexpected error encountered!")
@@ -260,7 +260,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugEnabled
*/
- public void callRESTCreateAAIVolGrpName(Execution execution, isDebugEnabled) {
+ public void callRESTCreateAAIVolGrpName(DelegateExecution execution, isDebugEnabled) {
def vnfId = execution.getVariable('vnfId')
def volumeGroupId = execution.getVariable('volumeGroupId')
@@ -329,7 +329,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* Prepare VNF adapter create request XML
* @param execution
*/
- public void prepareVnfAdapterCreateRequest(Execution execution, isDebugEnabled) {
+ public void prepareVnfAdapterCreateRequest(DelegateExecution execution, isDebugEnabled) {
def aaiGenericVnfResponse = execution.getVariable(prefix+'AAIQueryGenericVfnResponse')
def vnfId = utils.getNodeText1(aaiGenericVnfResponse, 'vnf-id')
@@ -448,44 +448,60 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
execution.setVariable(prefix+"createVnfARequest", vnfSubCreateWorkflowRequestAsString)
// build rollback request for use later if needed
-
- String vnfSubRollbackWorkflowRequest =
- """
- ${cloudSiteId}
- ${tenantId}
- ${volumeGroupId}
- true
- true
-
- ${requestId}
- ${serviceId}
-
- ${messageId}
- ${notificationUrl}
- """
+ String vnfSubRollbackWorkflowRequest = buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl)
utils.log("DEBUG", "Sub Vnf flow rollback request: vnfSubRollbackWorkflowRequest " + "\n" + vnfSubRollbackWorkflowRequest, isDebugEnabled)
String vnfSubRollbackWorkflowRequestAsString = utils.formatXml(vnfSubRollbackWorkflowRequest)
execution.setVariable(prefix+"rollbackVnfARequest", vnfSubRollbackWorkflowRequestAsString)
}
+
+ public String buildRollbackVolumeGroupRequestXml(volumeGroupId, cloudSiteId, tenantId, requestId, serviceId, messageId, notificationUrl) {
+
+ def request = """
+
+
+ ${volumeGroupId}
+ {{VOLUMEGROUPSTACKID}}
+ ${tenantId}
+ ${cloudSiteId}
+ true
+
+ ${requestId}
+ ${serviceId}
+
+ ${messageId}
+
+ true
+ ${notificationUrl}
+
+ """
+
+ return request
+ }
+ public String updateRollbackVolumeGroupRequestXml(String rollabackRequest, String heatStackId) {
+ String newRequest = rollabackRequest.replace("{{VOLUMEGROUPSTACKID}}", heatStackId)
+ return newRequest
+ }
/**
* Validate VNF adapter response
* @param execution
*/
- public void validateVnfResponse(Execution execution, isDebugEnabled) {
+ public void validateVnfResponse(DelegateExecution execution, isDebugEnabled) {
def vnfSuccess = execution.getVariable('VNFREST_SuccessIndicator')
utils.log("DEBUG", "vnfAdapterSuccessIndicator: "+ vnfSuccess, isDebugEnabled)
if(vnfSuccess==true) {
- def vnfRollbackRequest = execution.getVariable(prefix+"rollbackVnfARequest")
- utils.log("DEBUG", "vnfAdapter rollback request: "+ vnfRollbackRequest, isDebugEnabled)
+ String createVnfAResponse = execution.getVariable(prefix+"createVnfAResponse")
+ String heatStackID = utils.getNodeText1(createVnfAResponse, "volumeGroupStackId")
+ String vnfRollbackRequest = execution.getVariable(prefix+"rollbackVnfARequest")
+ String updatedVnfRollbackRequest = updateRollbackVolumeGroupRequestXml(vnfRollbackRequest, heatStackID)
+ utils.log("DEBUG", "vnfAdapter rollback request: "+ updatedVnfRollbackRequest, isDebugEnabled)
RollbackData rollbackData = execution.getVariable("rollbackData")
- rollbackData.put("DCVFMODULEVOL", "rollbackVnfARequest", vnfRollbackRequest)
+ rollbackData.put("DCVFMODULEVOL", "rollbackVnfARequest", updatedVnfRollbackRequest)
rollbackData.put("DCVFMODULEVOL", "isCreateVnfRollbackNeeded", "true")
}
-
}
@@ -495,7 +511,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugEnabled
*/
- public void callRESTUpdateCreatedVolGrpName(Execution execution, isDebugEnabled) {
+ public void callRESTUpdateCreatedVolGrpName(DelegateExecution execution, isDebugEnabled) {
String requeryAAIVolGrpNameResponse = execution.getVariable(prefix+"queryAAIVolGrpNameResponse")
String volumeGroupId = utils.getNodeText1(requeryAAIVolGrpNameResponse, "volume-group-id")
@@ -554,7 +570,7 @@ class DoCreateVfModuleVolumeV2 extends VfModuleBase {
* @param execution
* @param isDebugEnabled
*/
- public void callRESTQueryAAIGenericVnf(Execution execution, isDebugEnabled) {
+ public void callRESTQueryAAIGenericVnf(DelegateExecution execution, isDebugEnabled) {
def vnfId = execution.getVariable('vnfId')
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnf.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnf.groovy
index 6b98782527..adc2b695ef 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnf.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnf.groovy
@@ -20,9 +20,10 @@
package org.openecomp.mso.bpmn.infrastructure.scripts
import static org.apache.commons.lang3.StringUtils.*
+
import org.openecomp.mso.bpmn.core.RollbackData
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.springframework.web.util.UriUtils
import org.openecomp.mso.bpmn.common.scripts.AaiUtil
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
@@ -55,7 +56,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
* @param - execution
*
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " *** STARTED DoCreateVnf PreProcessRequest Process*** ", isDebugEnabled)
@@ -201,9 +202,9 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
utils.logAudit("SDNC Callback URL: " + sdncCallbackUrl)
logDebug("SDNC Callback URL is: " + sdncCallbackUrl, isDebugEnabled)
- VnfResource vnfResource = (VnfResource) execution.getVariable("vnfResourceDecomposition")
-
+ VnfResource vnfResource = (VnfResource) execution.getVariable((String)"vnfResourceDecomposition")
String nfRole = vnfResource.getNfRole()
+
execution.setVariable("DoCVNF_nfRole", nfRole)
logDebug("NF Role is: " + nfRole, isDebugEnabled)
@@ -235,37 +236,45 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
}
utils.log("DEBUG", "*** COMPLETED DoCreateVnf PreProcessRequest Process ***", isDebugEnabled)
}
-
- public void prepareCreateGenericVnf (Execution execution) {
+ private Object getVariableEnforced(DelegateExecution execution, String name){
+ Object enforced = execution.getVariable(name)
+ if(!enforced){
+ return "";
+ }
+ return enforced;
+ }
+
+ public void prepareCreateGenericVnf (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " *** STARTED DoCreateVnf PrepareCreateGenericVnf Process *** ", isDebugEnabled)
try {
//Get Vnf Info
- String vnfId = execution.getVariable("DoCVNF_vnfId")
- def vnfName = execution.getVariable("DoCVNF_vnfName")
+ String vnfId = getVariableEnforced(execution, "DoCVNF_vnfId")
+ String vnfName = getVariableEnforced(execution, "DoCVNF_vnfName")
if (vnfName == null) {
vnfName = "sdncGenerated"
utils.log("DEBUG", "Sending a dummy VNF name to AAI - the name will be generated by SDNC: " + vnfName, isDebugEnabled)
}
- def vnfType = execution.getVariable("DoCVNF_vnfType")
- def serviceId = execution.getVariable("DoCVNF_serviceId")
- def orchStatus = execution.getVariable("DoCVNF_orchStatus")
- def modelInvariantId = execution.getVariable("DoCVNF_modelInvariantId")
- def modelVersionId = execution.getVariable("DoCVNF_modelVersionId")
- def modelCustomizationId = execution.getVariable("DoCVNF_modelCustomizationId")
+ String vnfType = getVariableEnforced(execution, "DoCVNF_vnfType")
+ utils.log("DEBUG", "WE ARE HERE:" + vnfType, isDebugEnabled)
+ String serviceId = getVariableEnforced(execution, "DoCVNF_serviceId")
+ String orchStatus = getVariableEnforced(execution, "DoCVNF_orchStatus")
+ String modelInvariantId = getVariableEnforced(execution, "DoCVNF_modelInvariantId")
+ String modelVersionId = getVariableEnforced(execution, "DoCVNF_modelVersionId")
+ String modelCustomizationId = getVariableEnforced(execution, "DoCVNF_modelCustomizationId")
// TODO: 1702 Variable
- def equipmentRole = execution.getVariable("DoCVNF_equipmentRole")
- def nfType = execution.getVariable("DoCVNF_nfType")
- def nfRole = execution.getVariable("DoCVNF_nfRole")
- def nfFunction = execution.getVariable("DoCVNF_nfFunction")
- def nfNamingCode = execution.getVariable("DoCVNF_nfNamingCode")
-
+ String equipmentRole = getVariableEnforced(execution, "DoCVNF_equipmentRole")
+ String nfType = getVariableEnforced(execution, "DoCVNF_nfType")
+ String nfRole = getVariableEnforced(execution, "DoCVNF_nfRole")
+ String nfFunction = getVariableEnforced(execution, "DoCVNF_nfFunction")
+ String nfNamingCode = getVariableEnforced(execution, "DoCVNF_nfNamingCode")
+
//Get Service Instance Info
- def serviceInstanceId = execution.getVariable("DoCVNF_serviceInstanceId")
- String siRelatedLink = execution.getVariable("GENGS_siResourceLink")
+ String serviceInstanceId = getVariableEnforced(execution, "DoCVNF_serviceInstanceId")
+ String siRelatedLink = getVariableEnforced(execution, "GENGS_siResourceLink")
int custStart = siRelatedLink.indexOf("customer/")
int custEnd = siRelatedLink.indexOf("/service-subscriptions")
@@ -324,7 +333,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "*** COMPLETED DoCreateVnf PrepareCreateGenericVnf Process ***", isDebugEnabled)
}
- public void postProcessCreateGenericVnf (Execution execution) {
+ public void postProcessCreateGenericVnf (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -344,7 +353,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
}
- public void preProcessSDNCAssignRequest(Execution execution){
+ public void preProcessSDNCAssignRequest(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
@@ -370,7 +379,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED preProcessSDNCAssignRequest ======== ", isDebugLogEnabled)
}
- public void preProcessSDNCActivateRequest(Execution execution) {
+ public void preProcessSDNCActivateRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessSDNCActivateRequest(' +
'execution=' + execution.getId() +
')'
@@ -395,7 +404,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED preProcessSDNCActivateRequest Process ======== ", isDebugLogEnabled)
}
- public String buildSDNCRequest(Execution execution, String svcInstId, String action){
+ public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
String uuid = execution.getVariable('testReqId') // for junits
if(uuid==null){
@@ -477,7 +486,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
return sdncRequest
}
- public void validateSDNCResponse(Execution execution, String response, String method){
+ public void validateSDNCResponse(DelegateExecution execution, String response, String method){
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
logDebug(" *** STARTED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
@@ -523,7 +532,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
logDebug(" *** COMPLETED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
}
- public void preProcessSDNCGetRequest(Execution execution){
+ public void preProcessSDNCGetRequest(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
utils.log("DEBUG", " ======== STARTED preProcessSDNCGetRequest Process ======== ", isDebugLogEnabled)
@@ -596,7 +605,7 @@ class DoCreateVnf extends AbstractServiceTaskProcessor {
*
* @param execution The flow's execution instance.
*/
- public void prepUpdateAAIGenericVnf(Execution execution) {
+ public void prepUpdateAAIGenericVnf(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.prepUpdateAAIGenericVnf(' +
'execution=' + execution.getId() +
')'
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy
index 308834038e..4e570f87a9 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModules.groovy
@@ -37,7 +37,7 @@ import org.openecomp.mso.bpmn.core.domain.VnfResource
import org.openecomp.mso.bpmn.core.json.DecomposeJsonUtil
import org.openecomp.mso.bpmn.core.json.JsonUtils
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
import static org.apache.commons.lang3.StringUtils.*;
@@ -61,7 +61,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
*
* @param - execution
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " *** STARTED DoCreateVnfAndModules PreProcessRequest Process*** ", isDebugLogEnabled)
@@ -114,6 +114,9 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
}
}
execution.setVariable("vnfId", vnfId)
+
+ // Set aLaCarte to false
+ execution.setVariable("aLaCarte", false)
def rollbackData = execution.getVariable("rollbackData")
if (rollbackData == null) {
@@ -145,7 +148,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
}
- public void queryCatalogDB (Execution execution) {
+ public void queryCatalogDB (DelegateExecution execution) {
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -251,7 +254,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
utils.log("DEBUG", "*** COMPLETED DoCreateVnfAndModules QueryCatalogDB Process ***", isDebugLogEnabled)
}
- public void preProcessAddOnModule(Execution execution){
+ public void preProcessAddOnModule(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED preProcessAddOnModule ======== ", isDebugLogEnabled)
@@ -289,7 +292,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED preProcessAddOnModule ======== ", isDebugLogEnabled)
}
- public void postProcessAddOnModule(Execution execution){
+ public void postProcessAddOnModule(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED postProcessAddOnModule ======== ", isDebugLogEnabled)
@@ -305,7 +308,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED postProcessAddOnModule ======== ", isDebugLogEnabled)
}
- public void validateBaseModule(Execution execution){
+ public void validateBaseModule(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED validateBaseModule ======== ", isDebugLogEnabled)
@@ -333,7 +336,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED validateBaseModule ======== ", isDebugLogEnabled)
}
- public void validateAddOnModule(Execution execution){
+ public void validateAddOnModule(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED validateAddOnModule ======== ", isDebugLogEnabled)
@@ -362,7 +365,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED validateAddOnModule ======== ", isDebugLogEnabled)
}
- public void preProcessRollback (Execution execution) {
+ public void preProcessRollback (DelegateExecution execution) {
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugLogEnabled)
try {
@@ -383,7 +386,7 @@ class DoCreateVnfAndModules extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," *** Exit preProcessRollback *** ", isDebugLogEnabled)
}
- public void postProcessRollback (Execution execution) {
+ public void postProcessRollback (DelegateExecution execution) {
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugLogEnabled)
String msg = ""
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy
index c5d87d817a..e931903ea5 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCreateVnfAndModulesRollback.groovy
@@ -25,7 +25,7 @@ import org.json.JSONObject;
import org.json.JSONArray;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
import static org.apache.commons.lang3.StringUtils.*;
@@ -55,7 +55,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
* @param - execution
*
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " *** STARTED DoCreateVnfAndModulesRollback PreProcessRequest Process*** ", isDebugEnabled)
@@ -117,7 +117,10 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
}
else {
execution.setVariable("DCVAMR_numOfModulesToDelete", numOfAddOnModules + 1)
- }
+ }
+
+ // Set aLaCarte to false
+ execution.setVariable("DCVAMR_aLaCarte", false)
}catch(BpmnError b){
utils.log("DEBUG", "Rethrowing MSOWorkflowException", isDebugEnabled)
@@ -132,7 +135,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
- public void preProcessCreateVfModuleRollback(Execution execution){
+ public void preProcessCreateVfModuleRollback(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED preProcessCreateVfModuleRollback ======== ", isDebugLogEnabled)
@@ -167,7 +170,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
}
- public void postProcessCreateVfModuleRollback(Execution execution){
+ public void postProcessCreateVfModuleRollback(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED postProcessCreateVfModuleRollback ======== ", isDebugLogEnabled)
@@ -190,7 +193,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
}
- public void preProcessSDNCDeactivateRequest(Execution execution){
+ public void preProcessSDNCDeactivateRequest(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED preProcessSDNCDeactivateRequest ======== ", isDebugLogEnabled)
@@ -214,7 +217,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED preProcessSDNCDeactivateRequest ======== ", isDebugLogEnabled)
}
- public void preProcessSDNCUnassignRequest(Execution execution) {
+ public void preProcessSDNCUnassignRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessSDNCUnassignRequest(' +
'execution=' + execution.getId() +
')'
@@ -239,7 +242,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED preProcessSDNCUnassignRequest Process ======== ", isDebugLogEnabled)
}
- public String buildSDNCRequest(Execution execution, String svcInstId, String action){
+ public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
String uuid = execution.getVariable('testReqId') // for junits
if(uuid==null){
@@ -296,7 +299,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
return sdncRequest
}
- public void validateSDNCResponse(Execution execution, String response, String method){
+ public void validateSDNCResponse(DelegateExecution execution, String response, String method){
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
logDebug(" *** STARTED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
@@ -321,7 +324,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
logDebug(" *** COMPLETED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
}
- public void setSuccessfulRollbackStatus (Execution execution){
+ public void setSuccessfulRollbackStatus (DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED setSuccessfulRollbackStatus ======== ", isDebugLogEnabled)
@@ -338,7 +341,7 @@ class DoCreateVnfAndModulesRollback extends AbstractServiceTaskProcessor {
logDebug("======== COMPLETED setSuccessfulRollbackStatus ======== ", isDebugLogEnabled)
}
- public void setFailedRollbackStatus (Execution execution){
+ public void setFailedRollbackStatus (DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED setFailedRollbackStatus ======== ", isDebugLogEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
index 40e2baab7f..a32fd7b538 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstance.groovy
@@ -41,7 +41,7 @@ import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONObject;
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
@@ -79,7 +79,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** preProcessRequest *****", isDebugEnabled)
String msg = ""
@@ -155,13 +155,13 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
}
- public void preProcessVFCDelete (Execution execution) {
+ public void preProcessVFCDelete (DelegateExecution execution) {
}
- public void postProcessVFCDelete(Execution execution, String response, String method) {
+ public void postProcessVFCDelete(DelegateExecution execution, String response, String method) {
}
- public void preProcessSDNCDelete (Execution execution) {
+ public void preProcessSDNCDelete (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** preProcessSDNCDelete *****", isDebugEnabled)
String msg = ""
@@ -275,7 +275,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
utils.log("INFO"," *****Exit preProcessSDNCDelete *****", isDebugEnabled)
}
- public void postProcessSDNCDelete(Execution execution, String response, String method) {
+ public void postProcessSDNCDelete(DelegateExecution execution, String response, String method) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** postProcessSDNC " + method + " *****", isDebugEnabled)
@@ -307,7 +307,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
utils.log("INFO"," *** Exit postProcessSDNC " + method + " ***", isDebugEnabled)
}
- public void postProcessAAIGET(Execution execution) {
+ public void postProcessAAIGET(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** postProcessAAIGET ***** ", isDebugEnabled)
String msg = ""
@@ -439,7 +439,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
utils.log("INFO"," *** Exit postProcessAAIGET *** ", isDebugEnabled)
}
- public void postProcessAAIDEL(Execution execution) {
+ public void postProcessAAIDEL(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO"," ***** postProcessAAIDEL ***** ", isDebugEnabled)
String msg = ""
@@ -469,7 +469,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
utils.log("INFO"," *** Exit postProcessAAIDEL *** ", isDebugEnabled)
}
- public void preInitResourcesOperStatus(Execution execution){
+ public void preInitResourcesOperStatus(DelegateExecution execution){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " ======== STARTED preInitResourcesOperStatus Process ======== ", isDebugEnabled)
@@ -517,7 +517,7 @@ public class DoCustomDeleteE2EServiceInstance extends AbstractServiceTaskProcess
resourceTemplateUUIDs = resourceTemplateUUIDs + it.resourceInstanceId + ":"
}
}
- execution.setVariable("URN_mso_openecomp_adapters_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
+ execution.setVariable("URN_mso_adapters_openecomp_db_endpoint","http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter")
String payload =
"""DoDeleteE2EServiceInstance.bpmn process.
@@ -81,7 +63,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def method = getClass().getSimpleName() + '.buildAPPCRequest(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
@@ -163,7 +145,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
- public void postProcessAAIGET(Execution execution) {
+ public void postProcessAAIGET(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessAAIGET(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -221,7 +203,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- private void loadResourcesProperties(Execution execution) {
+ private void loadResourcesProperties(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.loadResourcesProperties(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -255,7 +237,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
}
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- private void sortDeleteResource(Execution execution) {
+ private void sortDeleteResource(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.sortDeleteResource(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -339,7 +321,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void prepareServiceDeleteResource(Execution execution) {
+ public void prepareServiceDeleteResource(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.prepareServiceDeleteResource(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -624,7 +606,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- private String getAaiAr(Execution execution, String relink) {
+ private String getAaiAr(DelegateExecution execution, String relink) {
def method = getClass().getSimpleName() + '.getAaiAr(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -650,7 +632,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
/**
* prepare Decompose next resource to create request
*/
- public void preProcessDecomposeNextResource(Execution execution){
+ public void preProcessDecomposeNextResource(DelegateExecution execution){
def method = getClass().getSimpleName() + '.getAaiAr(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -708,7 +690,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
/**
* post Decompose next resource to create request
*/
- public void postProcessDecomposeNextResource(Execution execution){
+ public void postProcessDecomposeNextResource(DelegateExecution execution){
def method = getClass().getSimpleName() + '.postProcessDecomposeNextResource(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -750,7 +732,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
/**
* prepare post Unkown Resource Type
*/
- public void postOtherControllerType(Execution execution){
+ public void postOtherControllerType(DelegateExecution execution){
def method = getClass().getSimpleName() + '.postOtherControllerType(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -805,7 +787,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
}
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void preProcessSDNCDelete (Execution execution) {
+ public void preProcessSDNCDelete (DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessSDNCDelete(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -921,7 +903,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void postProcessSDNCDelete(Execution execution, String response, String action) {
+ public void postProcessSDNCDelete(DelegateExecution execution, String response, String action) {
def method = getClass().getSimpleName() + '.postProcessSDNCDelete(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
@@ -955,7 +937,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void postProcessAAIDEL(Execution execution) {
+ public void postProcessAAIDEL(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessAAIDEL(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -989,7 +971,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
/**
* Init the service Operation Status
*/
- public void preUpdateServiceOperationStatus(Execution execution){
+ public void preUpdateServiceOperationStatus(DelegateExecution execution){
def method = getClass().getSimpleName() + '.preUpdateServiceOperationStatus(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -1053,7 +1035,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void preInitResourcesOperStatus(Execution execution){
+ public void preInitResourcesOperStatus(DelegateExecution execution){
def method = getClass().getSimpleName() + '.preInitResourcesOperStatus(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -1166,7 +1148,7 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
- public void postProcessVFCDelete(Execution execution, String response, String action) {
+ public void postProcessVFCDelete(DelegateExecution execution, String response, String action) {
def method = getClass().getSimpleName() + '.postProcessVFCDelete(' +'execution=' + execution.getId() +')'
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO","Entered " + method, isDebugEnabled)
@@ -1184,4 +1166,4 @@ public class DoCustomDeleteE2EServiceInstanceV2 extends AbstractServiceTaskProce
utils.log("INFO", "Exited " + method, isDebugEnabled)
}
}
-
\ No newline at end of file
+
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
index a3407553c8..7ded1946b4 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy
@@ -34,7 +34,7 @@ import org.openecomp.mso.rest.RESTConfig
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
@@ -51,7 +51,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
NetworkUtils networkUtils = new NetworkUtils()
SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
- public InitializeProcessVariables(Execution execution){
+ public InitializeProcessVariables(DelegateExecution execution){
/* Initialize all the process variables in this block */
execution.setVariable(Prefix + "networkRequest", "")
@@ -102,7 +102,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
// Pre or Prepare Request Section
// **************************************************
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -229,7 +229,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void callRESTQueryAAI (Execution execution) {
+ public void callRESTQueryAAI (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -244,7 +244,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
String aai_endpoint = execution.getVariable("URN_aai_endpoint")
AaiUtil aaiUriUtil = new AaiUtil(this)
String aai_uri = aaiUriUtil.getNetworkL3NetworkUri(execution)
- String queryAAIRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=1"
+ String queryAAIRequest = "${aai_endpoint}${aai_uri}/" + networkId + "?depth=all"
utils.logAudit(queryAAIRequest)
execution.setVariable(Prefix + "queryAAIRequest", queryAAIRequest)
utils.log("DEBUG", Prefix + "AAIRequest - " + "\n" + queryAAIRequest, isDebugEnabled)
@@ -328,7 +328,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void callRESTQueryAAICloudRegion (Execution execution) {
+ public void callRESTQueryAAICloudRegion (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -375,7 +375,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareNetworkRequest (Execution execution) {
+ public void prepareNetworkRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -463,7 +463,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
* This method is used instead of an HTTP Connector task because the
* connector does not allow DELETE with a body.
*/
- public void sendRequestToVnfAdapter(Execution execution) {
+ public void sendRequestToVnfAdapter(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.sendRequestToVnfAdapter(' +
'execution=' + execution.getId() +
')'
@@ -498,7 +498,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareSDNCRequest (Execution execution) {
+ public void prepareSDNCRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -548,7 +548,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareRpcSDNCRequest (Execution execution) {
+ public void prepareRpcSDNCRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -588,7 +588,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareRpcSDNCDeactivate(Execution execution) {
+ public void prepareRpcSDNCDeactivate(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -626,7 +626,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
// Post or Validate Response Section
// **************************************************
- public void validateNetworkResponse (Execution execution) {
+ public void validateNetworkResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -700,7 +700,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void validateSDNCResponse (Execution execution) {
+ public void validateSDNCResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -728,7 +728,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void validateRpcSDNCDeactivateResponse (Execution execution) {
+ public void validateRpcSDNCDeactivateResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -756,7 +756,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareRpcSDNCDeactivateRollback(Execution execution) {
+ public void prepareRpcSDNCDeactivateRollback(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -789,7 +789,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareRollbackData(Execution execution) {
+ public void prepareRollbackData(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -825,7 +825,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void postProcessResponse (Execution execution) {
+ public void postProcessResponse (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -886,7 +886,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareSuccessRollbackData(Execution execution) {
+ public void prepareSuccessRollbackData(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -935,7 +935,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareRpcSDNCUnassignRollback(Execution execution) {
+ public void prepareRpcSDNCUnassignRollback(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -972,7 +972,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void prepareSDNCRollback (Execution execution) {
+ public void prepareSDNCRollback (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
@@ -1025,7 +1025,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
}
- public void setExceptionFlag(Execution execution){
+ public void setExceptionFlag(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -1055,7 +1055,7 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor {
// Build Error Section
// *******************************
- public void processJavaException(Execution execution){
+ public void processJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
try{
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy
index 4c455e743f..c45b90f953 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteNetworkInstanceRollback.groovy
@@ -36,7 +36,7 @@ import org.openecomp.mso.rest.RESTConfig
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
@@ -59,7 +59,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
* This method is executed during the preProcessRequest task of the DoDeleteNetworkInstanceRollback.bpmn process.
* @param execution
*/
- public InitializeProcessVariables(Execution execution){
+ public InitializeProcessVariables(DelegateExecution execution){
/* Initialize all the process variables in this block */
execution.setVariable(Prefix + "WorkflowException", null)
@@ -88,7 +88,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
* This method is executed during the preProcessRequest task of the DoDeleteNetworkInstanceRollback.bpmn process.
* @param execution
*/
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -174,7 +174,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
}
- public void validateRollbackResponses (Execution execution) {
+ public void validateRollbackResponses (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -313,7 +313,7 @@ public class DoDeleteNetworkInstanceRollback extends AbstractServiceTaskProcesso
- public void processJavaException(Execution execution){
+ public void processJavaException(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy
index fd4162fa5c..8fc1f41569 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy
@@ -37,7 +37,7 @@ import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONObject;
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
@@ -75,7 +75,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** preProcessRequest *****", isDebugEnabled)
String msg = ""
@@ -83,7 +83,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
try {
String requestId = execution.getVariable("msoRequestId")
execution.setVariable("prefix",Prefix)
-
+
//Inputs
//requestDetails.subscriberInfo. for AAI GET & PUT & SDNC assignToplology
String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
@@ -150,57 +150,40 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," ***** Exit preProcessRequest *****", isDebugEnabled)
}
- public void preProcessSDNCDelete (Execution execution) {
+ public void preProcessSDNCDelete (DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** preProcessSDNCDelete *****", isDebugEnabled)
String msg = ""
try {
- def serviceInstanceId = execution.getVariable("serviceInstanceId")
- def serviceInstanceName = execution.getVariable("serviceInstanceName")
- def callbackURL = execution.getVariable("sdncCallbackUrl")
- def requestId = execution.getVariable("msoRequestId")
- def serviceId = execution.getVariable("productFamilyId")
- def subscriptionServiceType = execution.getVariable("subscriptionServiceType")
- def globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
-
- String serviceModelInfo = execution.getVariable("serviceModelInfo")
+ def serviceInstanceId = execution.getVariable("serviceInstanceId") ?: ""
+ def serviceInstanceName = execution.getVariable("serviceInstanceName") ?: ""
+ def callbackURL = execution.getVariable("sdncCallbackUrl") ?: ""
+ def requestId = execution.getVariable("msoRequestId") ?: ""
+ def serviceId = execution.getVariable("productFamilyId") ?: ""
+ def subscriptionServiceType = execution.getVariable("subscriptionServiceType") ?: ""
+ def globalSubscriberId = execution.getVariable("globalSubscriberId") ?: "" //globalCustomerId
+
+ String serviceModelInfo = execution.getVariable("serviceModelInfo") ?: ""
def modelInvariantUuid = ""
def modelVersion = ""
def modelUuid = ""
def modelName = ""
if (!isBlank(serviceModelInfo))
{
- modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid")
- modelVersion = jsonUtil.getJsonValue(serviceModelInfo, "modelVersion")
- modelUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelUuid")
- modelName = jsonUtil.getJsonValue(serviceModelInfo, "modelName")
+ modelInvariantUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelInvariantUuid") ?: ""
+ modelVersion = jsonUtil.getJsonValue(serviceModelInfo, "modelVersion") ?: ""
+ modelUuid = jsonUtil.getJsonValue(serviceModelInfo, "modelUuid") ?: ""
+ modelName = jsonUtil.getJsonValue(serviceModelInfo, "modelName") ?: ""
- if (modelInvariantUuid == null) {
- modelInvariantUuid = ""
- }
- if (modelVersion == null) {
- modelVersion = ""
- }
- if (modelUuid == null) {
- modelUuid = ""
- }
- if (modelName == null) {
- modelName = ""
- }
- }
- if (serviceInstanceName == null) {
- serviceInstanceName = ""
- }
- if (serviceId == null) {
- serviceId = ""
}
- def siParamsXml = execution.getVariable("siParamsXml")
- def serviceType = execution.getVariable("serviceType")
- if (serviceType == null)
+ def siParamsXml = execution.getVariable("siParamsXml") ?: ""
+ def msoAction = ""
+ // special URL for SDNW, msoAction helps set diff url in SDNCA
+ if("TRANSPORT".equalsIgnoreCase(execution.getVariable("serviceType")))
{
- serviceType = ""
+ msoAction = "TRANSPORT"
}
def sdncRequestId = UUID.randomUUID().toString()
@@ -215,7 +198,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
delete
service-topology-operation
${callbackURL}
- ${serviceType}
+ ${msoAction}
@@ -229,12 +212,12 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
${serviceId}
${subscriptionServiceType}
-
+
${modelInvariantUuid}
${modelUuid}
${modelVersion}
${modelName}
-
+
${serviceInstanceId}
${globalSubscriberId}
@@ -264,7 +247,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," *****Exit preProcessSDNCDelete *****", isDebugEnabled)
}
- public void postProcessSDNCDelete(Execution execution, String response, String method) {
+ public void postProcessSDNCDelete(DelegateExecution execution, String response, String method) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessSDNC " + method + " *****", isDebugEnabled)
@@ -297,7 +280,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," *** Exit postProcessSDNC " + method + " ***", isDebugEnabled)
}
- public void postProcessAAIGET(Execution execution) {
+ public void postProcessAAIGET(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessAAIGET ***** ", isDebugEnabled)
String msg = ""
@@ -406,6 +389,33 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
}
}
+
+ //alacarte SIs are NOT sent to sdnc. exceptions are listed in config variable
+ String svcTypes = execution.getVariable("URN_sdnc_si_svc_types") ?: ""
+ utils.log("DEBUG", "SDNC SI serviceTypes:" + svcTypes, isDebugEnabled)
+ List svcList = Arrays.asList(svcTypes.split("\\s*,\\s*"));
+ boolean isSdncService= false
+ for (String listEntry : svcList){
+ if (listEntry.equalsIgnoreCase(serviceType)){
+ isSdncService = true
+ break;
+ }
+ }
+
+ //All Macros are sent to SDNC, TRANSPORT(Macro) is sent to SDNW
+ //Alacartes are sent to SDNC if they are listed in config variable above
+ execution.setVariable("sendToSDNC", true)
+ if(execution.getVariable("sdncVersion").equals("1610")) //alacarte
+ {
+ if(!isSdncService){
+ execution.setVariable("sendToSDNC", false)
+ }
+ }
+
+ utils.log("DEBUG", "isSdncService: " + isSdncService, isDebugEnabled)
+ utils.log("DEBUG", "Send To SDNC: " + execution.getVariable("sendToSDNC"), isDebugEnabled)
+ utils.log("DEBUG", "Service Type: " + execution.getVariable("serviceType"), isDebugEnabled)
+
}
}else{
boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
@@ -436,7 +446,7 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor {
utils.log("DEBUG"," *** Exit postProcessAAIGET *** ", isDebugEnabled)
}
- public void postProcessAAIDEL(Execution execution) {
+ public void postProcessAAIDEL(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("DEBUG"," ***** postProcessAAIDEL ***** ", isDebugEnabled)
String msg = ""
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
index 7e957be00a..c71cb0521e 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVFCNetworkServiceInstance.groovy
@@ -32,7 +32,7 @@ import org.openecomp.mso.rest.APIResponse
import java.util.UUID;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.util.UriUtils
@@ -46,7 +46,7 @@ import org.openecomp.mso.rest.APIResponse;
*/
public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProcessor {
-
+
String vfcUrl = "/vfc/rest/v1/vfcadapter"
String host = "http://mso.mso.testlab.openecomp.org:8080"
@@ -60,7 +60,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
* Inclouds:
* generate the nsOperationKey
*/
- public void preProcessRequest (Execution execution) {
+ public void preProcessRequest (DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String msg = ""
utils.log("INFO", " *** preProcessRequest() *** ", isDebugEnabled)
@@ -101,7 +101,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* delete NS task
*/
- public void deleteNetworkService(Execution execution) {
+ public void deleteNetworkService(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " *** deleteNetworkService start *** ", isDebugEnabled)
String nsOperationKey = execution.getVariable("nsOperationKey");
@@ -121,7 +121,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* instantiate NS task
*/
- public void terminateNetworkService(Execution execution) {
+ public void terminateNetworkService(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " *** terminateNetworkService start *** ", isDebugEnabled)
String nsOperationKey = execution.getVariable("nsOperationKey")
@@ -140,7 +140,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* query NS task
*/
- public void queryNSProgress(Execution execution) {
+ public void queryNSProgress(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " *** queryNSProgress start *** ", isDebugEnabled)
String jobId = execution.getVariable("jobId")
@@ -160,10 +160,10 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* delay 5 sec
*/
- public void timeDelay(Execution execution) {
+ public void timeDelay(DelegateExecution execution) {
try {
Thread.sleep(5000);
- } catch(InterruptedException e) {
+ } catch(InterruptedException e) {
utils.log("INFO", "Time Delay exception" + e, isDebugEnabled)
}
}
@@ -171,7 +171,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
/**
* finish NS task
*/
- public void finishNSDelete(Execution execution) {
+ public void finishNSDelete(DelegateExecution execution) {
//no need to do anything util now
}
@@ -180,7 +180,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
* url: the url of the request
* requestBody: the body of the request
*/
- private APIResponse postRequest(Execution execution, String url, String requestBody){
+ private APIResponse postRequest(DelegateExecution execution, String url, String requestBody){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " ======== Started Execute VFC adapter Post Process ======== ", isDebugEnabled)
utils.log("INFO", "url:"+url +"\nrequestBody:"+ requestBody, isDebugEnabled)
@@ -202,7 +202,7 @@ public class DoDeleteVFCNetworkServiceInstance extends AbstractServiceTaskProces
* url: the url of the request
* requestBody: the body of the request
*/
- private APIResponse deleteRequest(Execution execution, String url, String requestBody){
+ private APIResponse deleteRequest(DelegateExecution execution, String url, String requestBody){
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
utils.log("INFO", " ======== Started Execute VFC adapter Delete Process ======== ", isDebugEnabled)
utils.log("INFO", "url:"+url +"\nrequestBody:"+ requestBody, isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy
index 70a78f4837..a5c39b6998 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModule.groovy
@@ -23,7 +23,7 @@ import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.openecomp.mso.bpmn.common.scripts.AaiUtil
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
@@ -38,6 +38,8 @@ import org.w3c.dom.Element
import org.xml.sax.InputSource
import org.w3c.dom.Node
import org.w3c.dom.NodeList;
+import org.openecomp.mso.rest.RESTClient
+import org.openecomp.mso.rest.RESTConfig
/* Subflow for Delete VF Module. When no DoDeleteVfModuleRequest is specified on input,
@@ -54,6 +56,7 @@ import org.w3c.dom.NodeList;
* @param - cloudConfiguration*
* @param - sdncVersion ("1610")
* @param - retainResources
+* @param - aLaCarte
*
* Outputs:
* @param - WorkflowException
@@ -66,7 +69,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- public void initProcessVariables(Execution execution) {
+ public void initProcessVariables(DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
execution.setVariable("DoDVfMod_contrailNetworkPolicyFqdnList", null)
execution.setVariable("DoDVfMod_oamManagementV4Address", null)
@@ -76,7 +79,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
// parse the incoming DELETE_VF_MODULE request for the Generic Vnf and Vf Module Ids
// and formulate the outgoing request for PrepareUpdateAAIVfModuleRequest
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
initProcessVariables(execution)
@@ -122,7 +125,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
if (retainResources == null) {
retainResources = false
}
- execution.setVariable("retainResources", retainResources)
+ execution.setVariable("retainResources", retainResources)
}
else {
@@ -184,7 +187,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
// build a SDNC vnf-topology-operation request for the specified action
// (note: the action passed is expected to be 'changedelete' or 'delete')
- public void prepSDNCAdapterRequest(Execution execution, String action) {
+ public void prepSDNCAdapterRequest(DelegateExecution execution, String action) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
String uuid = execution.getVariable('testReqId') // for junits
@@ -262,7 +265,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
// parse the incoming DELETE_VF_MODULE request
// and formulate the outgoing VnfAdapterDeleteV1 request
- public void prepVNFAdapterRequest(Execution execution) {
+ public void prepVNFAdapterRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
def requestId = UUID.randomUUID().toString()
def origRequestId = execution.getVariable('requestId')
@@ -304,7 +307,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
// parse the incoming DELETE_VF_MODULE request
// and formulate the outgoing UpdateAAIVfModuleRequest request
- public void prepUpdateAAIVfModule(Execution execution) {
+ public void prepUpdateAAIVfModule(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
def vnfId = execution.getVariable("vnfId")
def vfModuleId = execution.getVariable("vfModuleId")
@@ -322,7 +325,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
// parse the incoming DELETE_VF_MODULE request
// and formulate the outgoing DeleteAAIVfModuleRequest request
- public void prepDeleteAAIVfModule(Execution execution) {
+ public void prepDeleteAAIVfModule(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
def vnfId = execution.getVariable("vnfId")
@@ -339,7 +342,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
// generates a WorkflowException if
// -
- public void handleDoDeleteVfModuleFailure(Execution execution) {
+ public void handleDoDeleteVfModuleFailure(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("ERROR", "AAI error occurred deleting the Generic Vnf: "
+ execution.getVariable("DoDVfMod_deleteGenericVnfResponse"), isDebugEnabled)
@@ -349,7 +352,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
execution.setVariable("WorkflowException", exception)
}
- public void sdncValidateResponse(Execution execution, String response){
+ public void sdncValidateResponse(DelegateExecution execution, String response){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
@@ -366,7 +369,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
}
}
- public void postProcessVNFAdapterRequest(Execution execution) {
+ public void postProcessVNFAdapterRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessVNFAdapterRequest(' +
'execution=' + execution.getId() +
')'
@@ -443,7 +446,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
logDebug(" *** COMPLETED postProcessVnfAdapterResponse Process*** ", isDebugLogEnabled)
}
- public void deleteNetworkPoliciesFromAAI(Execution execution) {
+ public void deleteNetworkPoliciesFromAAI(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.deleteNetworkPoliciesFromAAI(' +
'execution=' + execution.getId() +
')'
@@ -571,7 +574,7 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
*
* @param execution The flow's execution instance.
*/
- public void prepUpdateAAIGenericVnf(Execution execution) {
+ public void prepUpdateAAIGenericVnf(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.prepUpdateAAIGenericVnf(' +
'execution=' + execution.getId() +
')'
@@ -615,6 +618,89 @@ public class DoDeleteVfModule extends AbstractServiceTaskProcessor{
exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in prepUpdateAAIGenericVnf(): ' + e.getMessage())
}
}
+
+ /**
+ * Using the vnfId and vfModuleId provided in the inputs,
+ * query AAI to get the corresponding VF Module info.
+ * A 200 response is expected with the VF Module info in the response body,
+ * Will determine VF Module's orchestration status if one exists
+ *
+ * @param execution The flow's execution instance.
+ */
+ public void queryAAIVfModuleForStatus(DelegateExecution execution) {
+ def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
+ def method = getClass().getSimpleName() + '.queryAAIVfModuleForStatus(' +
+ 'execution=' + execution.getId() +
+ ')'
+ logDebug('Entered ' + method, isDebugLogEnabled)
+
+ execution.setVariable(Prefix + 'orchestrationStatus', '')
+
+ try {
+ def vnfId = execution.getVariable('vnfId')
+ def vfModuleId = execution.getVariable('vfModuleId')
+
+ AaiUtil aaiUriUtil = new AaiUtil(this)
+ String aai_uri = aaiUriUtil.getNetworkGenericVnfUri(execution)
+ logDebug('AAI URI is: ' + aai_uri, isDebugLogEnabled)
+
+ String endPoint = execution.getVariable("URN_aai_endpoint") + "${aai_uri}/" + UriUtils.encode(vnfId, "UTF-8") +
+ "/vf-modules/vf-module/" + UriUtils.encode(vfModuleId, "UTF-8")
+ utils.logAudit("AAI endPoint: " + endPoint)
+
+ try {
+ RESTConfig config = new RESTConfig(endPoint);
+ def responseData = ''
+ def aaiRequestId = UUID.randomUUID().toString()
+ RESTClient client = new RESTClient(config).
+ addHeader('X-TransactionId', aaiRequestId).
+ addHeader('X-FromAppId', 'MSO').
+ addHeader('Content-Type', 'application/xml').
+ addHeader('Accept','application/xml');
+ logDebug('sending GET to AAI endpoint \'' + endPoint + '\'', isDebugLogEnabled)
+ APIResponse response = client.httpGet()
+ utils.logAudit("createVfModule - invoking httpGet() to AAI")
+
+ responseData = response.getResponseBodyAsString()
+ if (responseData != null) {
+ logDebug("Received generic VNF data: " + responseData, isDebugLogEnabled)
+
+ }
+
+ utils.logAudit("deleteVfModule - queryAAIVfModule Response: " + responseData)
+ utils.logAudit("deleteVfModule - queryAAIVfModule ResponseCode: " + response.getStatusCode())
+
+ execution.setVariable(Prefix + 'queryAAIVfModuleForStatusResponseCode', response.getStatusCode())
+ execution.setVariable(Prefix + 'queryAAIVfModuleForStatusResponse', responseData)
+ logDebug('Response code:' + response.getStatusCode(), isDebugLogEnabled)
+ logDebug('Response:' + System.lineSeparator() + responseData, isDebugLogEnabled)
+ // Retrieve VF Module info and its orchestration status; if not found, do nothing
+ if (response.getStatusCode() == 200) {
+ // Parse the VNF record from A&AI to find base module info
+ logDebug('Parsing the VNF data to find orchestration status', isDebugLogEnabled)
+ if (responseData != null) {
+ def vfModuleText = utils.getNodeXml(responseData, "vf-module")
+ //def xmlVfModule= new XmlSlurper().parseText(vfModuleText)
+ def orchestrationStatus = utils.getNodeText1(vfModuleText, "orchestration-status")
+ execution.setVariable(Prefix + "orchestrationStatus", orchestrationStatus)
+ logDebug("Received orchestration status from A&AI: " + orchestrationStatus, isDebugLogEnabled)
+
+ }
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace()
+ logDebug('Exception occurred while executing AAI GET:' + ex.getMessage(),isDebugLogEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'AAI GET Failed:' + ex.getMessage())
+ }
+ logDebug('Exited ' + method, isDebugLogEnabled)
+ } catch (BpmnError e) {
+ throw e;
+ } catch (Exception e) {
+ logError('Caught exception in ' + method, e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in queryAAIVfModuleForStatus(): ' + e.getMessage())
+ }
+ }
+
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
index 9d9f0bb25a..428f9aa1d9 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleFromVnf.groovy
@@ -4,7 +4,7 @@ import javax.xml.parsers.DocumentBuilder
import javax.xml.parsers.DocumentBuilderFactory
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.openecomp.mso.bpmn.common.scripts.AaiUtil
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
@@ -27,13 +27,13 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
- public void initProcessVariables(Execution execution) {
+ public void initProcessVariables(DelegateExecution execution) {
execution.setVariable("prefix",Prefix)
execution.setVariable("DDVFMV_contrailNetworkPolicyFqdnList", null)
}
// parse the incoming request
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
initProcessVariables(execution)
@@ -100,7 +100,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
}
}
- public void queryAAIForVfModule(Execution execution) {
+ public void queryAAIForVfModule(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.queryAAIForVfModule(' +
'execution=' + execution.getId() +
')'
@@ -155,7 +155,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
*
* @param execution The flow's execution instance.
*/
- public void validateVfModule(Execution execution) {
+ public void validateVfModule(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.validateVfModule(' +
'execution=' + execution.getId() +
')'
@@ -200,7 +200,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
}
- public void preProcessSDNCDeactivateRequest(Execution execution){
+ public void preProcessSDNCDeactivateRequest(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED preProcessSDNCDeactivateRequest ======== ", isDebugLogEnabled)
@@ -224,7 +224,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
logDebug("======== COMPLETED preProcessSDNCDeactivateRequest ======== ", isDebugLogEnabled)
}
- public void preProcessSDNCUnassignRequest(Execution execution) {
+ public void preProcessSDNCUnassignRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.preProcessSDNCUnassignRequest(' +
'execution=' + execution.getId() +
')'
@@ -248,7 +248,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
logDebug("======== COMPLETED preProcessSDNCUnassignRequest Process ======== ", isDebugLogEnabled)
}
- public String buildSDNCRequest(Execution execution, String svcInstId, String action){
+ public String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action){
String uuid = execution.getVariable('testReqId') // for junits
if(uuid==null){
@@ -306,7 +306,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
return sdncRequest
}
- public void validateSDNCResponse(Execution execution, String response, String method){
+ public void validateSDNCResponse(DelegateExecution execution, String response, String method){
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
logDebug(" *** STARTED ValidateSDNCResponse Process*** ", isDebugLogEnabled)
@@ -334,7 +334,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
// parse the incoming DELETE_VF_MODULE request
// and formulate the outgoing VnfAdapterDeleteV1 request
- public void prepVNFAdapterRequest(Execution execution) {
+ public void prepVNFAdapterRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
def requestId = UUID.randomUUID().toString()
def origRequestId = execution.getVariable('requestId')
@@ -377,7 +377,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
// generates a WorkflowException if
// -
- public void handleDoDeleteVfModuleFailure(Execution execution) {
+ public void handleDoDeleteVfModuleFailure(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
utils.log("ERROR", "AAI error occurred deleting the Generic Vnf: "
+ execution.getVariable("DDVFMV_deleteGenericVnfResponse"), isDebugEnabled)
@@ -387,7 +387,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
execution.setVariable("WorkflowException", exception)
}
- public void postProcessVNFAdapterRequest(Execution execution) {
+ public void postProcessVNFAdapterRequest(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.postProcessVNFAdapterRequest(' +
'execution=' + execution.getId() +
')'
@@ -455,7 +455,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
logDebug(" *** COMPLETED postProcessVnfAdapterResponse Process*** ", isDebugLogEnabled)
}
- public void deleteNetworkPoliciesFromAAI(Execution execution) {
+ public void deleteNetworkPoliciesFromAAI(DelegateExecution execution) {
def method = getClass().getSimpleName() + '.deleteNetworkPoliciesFromAAI(' +
'execution=' + execution.getId() +
')'
@@ -579,7 +579,7 @@ public class DoDeleteVfModuleFromVnf extends VfModuleBase {
}
// and formulate the outgoing DeleteAAIVfModuleRequest request
- public void prepDeleteAAIVfModule(Execution execution) {
+ public void prepDeleteAAIVfModule(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
def vnfId = execution.getVariable("vnfId")
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
index c303faafbe..7784e08958 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVfModuleVolumeV2.groovy
@@ -27,7 +27,7 @@ import java.util.concurrent.ExecutionException;
import org.springframework.web.util.UriUtils
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.openecomp.mso.bpmn.common.scripts.AaiUtil
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
@@ -44,7 +44,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor {
JsonUtils jsonUtil = new JsonUtils()
@Override
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
preProcessRequest(execution, isDebugEnabled)
}
@@ -54,7 +54,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugLogEnabled
*/
- public void preProcessRequest (Execution execution, isDebugEnabled) {
+ public void preProcessRequest (DelegateExecution execution, isDebugEnabled) {
//Input:
// msoRequestId
@@ -96,7 +96,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugLogEnabled
*/
- public void postProcess(Execution execution, isDebugLogEnabled) {
+ public void postProcess(DelegateExecution execution, isDebugLogEnabled) {
execution.setVariable('wasDeleted', 'true')
}
@@ -107,7 +107,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugEnabled
*/
- public void callRESTQueryAAICloudRegion(Execution execution, isDebugEnabled) {
+ public void callRESTQueryAAICloudRegion(DelegateExecution execution, isDebugEnabled) {
String cloudRegion = execution.getVariable('lcpCloudRegionId')
String aai_endpoint = execution.getVariable("URN_aai_endpoint")
@@ -140,7 +140,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugLogEnabled
*/
- public void callRESTQueryAAIForVolumeGroup(Execution execution, isDebugLogEnabled) {
+ public void callRESTQueryAAIForVolumeGroup(DelegateExecution execution, isDebugLogEnabled) {
def tenantId = execution.getVariable('tenantId')
def volumeGroupId = execution.getVariable('volumeGroupId')
@@ -215,7 +215,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugLogEnabled
*/
- public void prepareVnfAdapterDeleteRequest(Execution execution, isDebugLogEnabled) {
+ public void prepareVnfAdapterDeleteRequest(DelegateExecution execution, isDebugLogEnabled) {
def cloudRegion = execution.getVariable(prefix+'aicCloudRegion')
def tenantId = execution.getVariable('tenantId') // input parameter (optional) - see preProcessRequest
def volumeGroupId = execution.getVariable('volumeGroupId') // input parameter (required)
@@ -256,7 +256,7 @@ class DoDeleteVfModuleVolumeV2 extends AbstractServiceTaskProcessor {
* @param execution
* @param isDebugEnabled
*/
- public void callRESTDeleteAAIVolumeGroup(Execution execution, isDebugEnabled) {
+ public void callRESTDeleteAAIVolumeGroup(DelegateExecution execution, isDebugEnabled) {
// get variables
String queryAAIVolGrpIdResponse = execution.getVariable(prefix+"queryAAIVolGrpResponse")
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnf.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnf.groovy
index fbbb07ec4d..5e6fff2fd4 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnf.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnf.groovy
@@ -25,7 +25,7 @@ import javax.xml.parsers.DocumentBuilderFactory
import org.apache.commons.lang3.*
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution
+import org.camunda.bpm.engine.delegate.DelegateExecution
import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.common.scripts.VidUtils
@@ -57,7 +57,7 @@ class DoDeleteVnf extends AbstractServiceTaskProcessor {
* @param - execution
*
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " *** STARTED DoDeleteVnf PreProcessRequest Process*** ", isDebugEnabled)
@@ -86,7 +86,7 @@ class DoDeleteVnf extends AbstractServiceTaskProcessor {
}
- public void processGetVnfResponse(Execution execution){
+ public void processGetVnfResponse(DelegateExecution execution){
def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " *** STARTED DoDeleteVnf processGetVnfResponse Process *** ", isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
index 3f7ffbf28c..7074df5a91 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/DoDeleteVnfAndModules.groovy
@@ -19,12 +19,13 @@
*/
package org.openecomp.mso.bpmn.infrastructure.scripts
+import java.awt.Component.BaselineResizeBehavior
import java.util.UUID;
import org.json.JSONObject;
import org.json.JSONArray;
import org.camunda.bpm.engine.delegate.BpmnError
-import org.camunda.bpm.engine.runtime.Execution;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
import static org.apache.commons.lang3.StringUtils.*;
@@ -37,6 +38,10 @@ import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
import org.openecomp.mso.bpmn.common.scripts.VidUtils
+import org.openecomp.mso.bpmn.core.domain.ModelInfo
+import org.openecomp.mso.bpmn.core.domain.ModuleResource
+import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
+import org.openecomp.mso.bpmn.core.domain.VnfResource
import org.openecomp.mso.bpmn.core.RollbackData
import org.openecomp.mso.bpmn.core.WorkflowException
import org.springframework.web.util.UriUtils;
@@ -60,7 +65,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
* @param - execution
*
*/
- public void preProcessRequest(Execution execution) {
+ public void preProcessRequest(DelegateExecution execution) {
def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " *** STARTED DoDeleteVnfAndModules PreProcessRequest Process*** ", isDebugEnabled)
@@ -95,6 +100,9 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
execution.setVariable("DDVAM_sdncVersion", sdncVersion)
utils.log("DEBUG", "Incoming Sdnc Version is: " + sdncVersion, isDebugEnabled)
+ // Set aLaCarte flag to false
+ execution.setVariable("aLaCarte", false)
+
String sdncCallbackUrl = (String) execution.getVariable('URN_mso_workflow_sdncadapter_callback')
if (sdncCallbackUrl == null || sdncCallbackUrl.trim().isEmpty()) {
def msg = 'Required variable \'URN_mso_workflow_sdncadapter_callback\' is missing'
@@ -103,7 +111,8 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
}
execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
utils.logAudit("SDNC Callback URL: " + sdncCallbackUrl)
- logDebug("SDNC Callback URL is: " + sdncCallbackUrl, isDebugEnabled)
+ logDebug("SDNC Callback URL is: " + sdncCallbackUrl, isDebugEnabled)
+
if (!sdncVersion.equals("1702")) {
//String vnfModelInfo = execution.getVariable("vnfModelInfo")
@@ -153,8 +162,32 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
globalSubscriberId = ""
}
execution.setVariable("DDVAM_globalSubscriberId", globalSubscriberId)
- utils.log("DEBUG", "Incoming Global Subscriber Id is: " + globalSubscriberId, isDebugEnabled)
+ utils.log("DEBUG", "Incoming Global Subscriber Id is: " + globalSubscriberId, isDebugEnabled)
+
+ }
+ execution.setVariable("DDVAM_vfModulesFromDecomposition", null)
+ // Retrieve serviceDecomposition if present
+ ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+ if (serviceDecomposition != null) {
+ utils.log("DEBUG", "Getting Catalog DB data from ServiceDecomposition object: " + serviceDecomposition.toJsonString(), isDebugEnabled)
+ List vnfs = serviceDecomposition.getServiceVnfs()
+ utils.log("DEBUG", "Read vnfs", isDebugEnabled)
+ if (vnfs == null) {
+ utils.log("DEBUG", "Error - vnfs are empty in serviceDecomposition object", isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in preProcessRequest - vnfs are empty")
+ }
+ VnfResource vnf = vnfs[0]
+
+ if (vnf == null) {
+ utils.log("DEBUG", "Error - vnf is empty in serviceDecomposition object", isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in preProcessRequest - vnf is empty")
+ }
+
+ List vfModules = vnf.getAllVfModuleObjects()
+
+ execution.setVariable("DDVAM_vfModulesFromDecomposition", vfModules)
}
+
execution.setVariable("DDVAM_moduleCount", 0)
execution.setVariable("DDVAM_nextModule", 0)
@@ -172,7 +205,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
- public void preProcessAddOnModule(Execution execution){
+ public void preProcessAddOnModule(DelegateExecution execution){
def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled")
execution.setVariable("prefix", Prefix)
logDebug(" ======== STARTED preProcessAddOnModule ======== ", isDebugLogEnabled)
@@ -212,7 +245,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
*
* @param execution The flow's execution instance.
*/
- public void queryAAIVfModule(Execution execution) {
+ public void queryAAIVfModule(DelegateExecution execution) {
def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled")
def method = getClass().getSimpleName() + '.queryAAIVfModule(' +
'execution=' + execution.getId() +
@@ -247,6 +280,7 @@ class DoDeleteVnfAndModules extends AbstractServiceTaskProcessor {
logDebug('Response code:' + response.getStatusCode(), isDebugLogEnabled)
logDebug('Response:' + System.lineSeparator() + responseData, isDebugLogEnabled)
//Map[] vfModules = new HashMap[]
+ List vfModulesFromDecomposition = execution.getVariable("DDVAM_vfModulesFromDecomposition")
def vfModulesList = new ArrayList
-
- JBWEB000071: root cause
-
java.lang.NullPointerException
- org.openecomp.mso.adapters.network.NetworkAdapterRest$CreateNetworkVolumesTask.run(NetworkAdapterRest.java:128)
- org.openecomp.mso.adapters.network.NetworkAdapterRest.createNetwork(NetworkAdapterRest.java:64)
- sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
- sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- java.lang.reflect.Method.invoke(Method.java:606)
- org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)
- org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269)
- org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227)
- org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216)
- org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
- org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
- org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
- org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
- org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
- org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
- javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
- org.openecomp.mso.logger.LogFilter.doFilter(LogFilter.java:35)
-
-
-
- JBWEB000072: note
- JBWEB000073: The full stack trace of the root cause is available
- in the JBoss Web/7.2.2.Final-redhat-1 logs.
-
-
- JBoss Web/7.2.2.Final-redhat-1
+
+
+ JBWEB000309: type
+ JBWEB000066: Exception report
+
+
+ JBWEB000068: message
+ java.lang.NullPointerException
+
+
+ JBWEB000069: description
+ JBWEB000145: The server encountered an internal error that
+ prevented it from fulfilling this request.
+
+
+
+ JBWEB000070: exception
+
org.jboss.resteasy.spi.UnhandledException:
+ java.lang.NullPointerException
+ org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:365)
+ org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:233)
+ org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:209)
+ org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:557)
+ org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
+ org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
+ org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
+ org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
+ org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
+ javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
+ org.openecomp.mso.logger.LogFilter.doFilter(LogFilter.java:35)
+
+
+
+ JBWEB000071: root cause
+
java.lang.NullPointerException
+ org.openecomp.mso.adapters.network.NetworkAdapterRest$CreateNetworkVolumesTask.run(NetworkAdapterRest.java:128)
+ org.openecomp.mso.adapters.network.NetworkAdapterRest.createNetwork(NetworkAdapterRest.java:64)
+ sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+ sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
+ sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+ java.lang.reflect.Method.invoke(Method.java:606)
+ org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)
+ org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269)
+ org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227)
+ org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216)
+ org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
+ org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
+ org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
+ org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
+ org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
+ org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
+ javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
+ org.openecomp.mso.logger.LogFilter.doFilter(LogFilter.java:35)
+
+
+
+ JBWEB000072: note
+ JBWEB000073: The full stack trace of the root cause is available
+ in the JBoss Web/7.2.2.Final-redhat-1 logs.
+
+
+
+ JBoss Web/7.2.2.Final-redhat-1