diff options
author | Jim Hahn <jrh3@att.com> | 2017-10-11 11:49:51 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2017-10-11 11:49:51 -0400 |
commit | 015b92c3d96fb42f80b018fdf8f639f1cf3298c3 (patch) | |
tree | f96f2e944d456809702041bc9f9ef653ba061216 /bpmn/MSOInfrastructureBPMN/src/main/groovy/org | |
parent | f86960874497f005079c9e595b5e9e2eb0a815d1 (diff) |
Add junit test coverage and fix bugs in VCPE
Added additional junit tests for VCPE and fixed bugs that were found while
testing.
Change-Id: Icb6a0c936a16b775ff553c11cb07a4348bd9ebfc
Issue-ID: SO-210
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy/org')
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy (renamed from bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/CreateVcpeResCustService.groovy) | 294 | ||||
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy (renamed from bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DeleteVcpeResCustService.groovy) | 206 | ||||
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy (renamed from bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceBRG.groovy) | 46 | ||||
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy (renamed from bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy) | 40 | ||||
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy (renamed from bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceTXC.groovy) | 55 | ||||
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy (renamed from bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy) | 40 | ||||
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy (renamed from bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy) | 42 | ||||
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy (renamed from bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy) | 42 |
8 files changed, 330 insertions, 435 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy index 3b24ebf544..87cf6fbd0f 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/CreateVcpeResCustService.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy @@ -1,5 +1,21 @@ /*
- * © 2016 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
+ * ============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.vcpe.scripts;
@@ -33,6 +49,8 @@ import org.springframework.web.util.UriUtils; */
public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
+ private static final String DebugFlag = "isDebugLogEnabled"
+
String Prefix="CVRCS_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
@@ -50,8 +68,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { execution.setVariable("globalSubscriberId", "")
execution.setVariable("serviceInstanceName", "")
execution.setVariable("msoRequestId", "")
- execution.setVariable("CVRCS_NetworksCreatedCount", 0)
- execution.setVariable("CVRCS_VnfsCreatedCount", 0)
+ execution.setVariable(Prefix+"VnfsCreatedCount", 0)
execution.setVariable("productFamilyId", "")
execution.setVariable("brgWanMacAddress", "")
@@ -67,7 +84,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { * @param execution
*/
public void preProcessRequest (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " ***** Inside preProcessRequest CreateVcpeResCustService Request ***** ", isDebugEnabled)
@@ -105,10 +122,9 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { String source = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.requestInfo.source")
if ((source == null) || (source.isEmpty())) {
- execution.setVariable("source", "VID")
- } else {
- execution.setVariable("source", source)
+ source = "VID"
}
+ execution.setVariable("source", source)
// extract globalSubscriberId
String globalSubscriberId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.subscriberInfo.globalSubscriberId")
@@ -173,7 +189,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { <source>${source}</source>
</request-info>"""
- execution.setVariable("CVRCS_requestInfo", requestInfo)
+ execution.setVariable(Prefix+"requestInfo", requestInfo)
utils.log("DEBUG", " ***** Completed preProcessRequest CreateVcpeResCustService Request ***** ", isDebugEnabled)
@@ -186,8 +202,8 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { }
}
- public void sendSyncResponse (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ public void sendSyncResponse(Execution execution) {
+ def isDebugEnabled=execution.getVariable(DebugFlag)
utils.log("DEBUG", " ***** Inside sendSyncResponse of CreateVcpeResCustService ***** ", isDebugEnabled)
@@ -211,7 +227,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { //
// *******************************
public void prepareDecomposeService(Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
try {
utils.log("DEBUG", " ***** Inside prepareDecomposeService of CreateVcpeResCustService ***** ", isDebugEnabled)
@@ -234,7 +250,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { //
// *******************************
public void prepareCreateServiceInstance(Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
try {
utils.log("DEBUG", " ***** Inside prepareCreateServiceInstance of CreateVcpeResCustService ***** ", isDebugEnabled)
@@ -266,10 +282,9 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { public void postProcessServiceInstanceCreate (Execution execution){
def method = getClass().getSimpleName() + '.postProcessServiceInstanceCreate(' +'execution=' + execution.getId() +')'
- def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled')
+ def isDebugLogEnabled = execution.getVariable(DebugFlag)
logDebug('Entered ' + method, isDebugLogEnabled)
- String source = execution.getVariable("source")
String requestId = execution.getVariable("mso-request-id")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
String serviceInstanceName = execution.getVariable("serviceInstanceName")
@@ -289,8 +304,8 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { </soapenv:Body>
</soapenv:Envelope>
"""
- execution.setVariable("CVRCS_setUpdateDbInstancePayload", payload)
- utils.logAudit("CVRCS_setUpdateDbInstancePayload: " + payload)
+ execution.setVariable(Prefix+"setUpdateDbInstancePayload", payload)
+ utils.logAudit(Prefix+"setUpdateDbInstancePayload: " + payload)
logDebug('Exited ' + method, isDebugLogEnabled)
} catch (BpmnError e) {
@@ -303,28 +318,13 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { public void processDecomposition (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
- utils.log("DEBUG", " ***** Inside getDataFromDecomposition() of CreateVcpeResCustService ***** ", isDebugEnabled)
+ utils.log("DEBUG", " ***** Inside processDecomposition() of CreateVcpeResCustService ***** ", isDebugEnabled)
try {
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
- List<NetworkResource> networkList = serviceDecomposition.getServiceNetworks()
-
-
- execution.setVariable("networkList", networkList)
- execution.setVariable("networkListString", networkList.toString())
-
- utils.log("DEBUG", "networkList: "+ networkList, isDebugEnabled)
-
- if (networkList != null && networkList.size() > 0) {
- execution.setVariable("CVRCS_NetworksCount", networkList.size())
- utils.log("DEBUG", "networks to create: "+ networkList.size(), isDebugEnabled)
- } else {
- execution.setVariable("CVRCS_NetworksCount", 0)
- utils.log("DEBUG", "no networks to create based upon serviceDecomposition content", isDebugEnabled)
- }
// VNFs
List<VnfResource> vnfList = serviceDecomposition.getServiceVnfs()
@@ -333,7 +333,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { String vnfModelInfoString = ""
if (vnfList != null && vnfList.size() > 0) {
- execution.setVariable("CVRCS_VNFsCount", vnfList.size())
+ execution.setVariable(Prefix+"VNFsCount", vnfList.size())
utils.log("DEBUG", "vnfs to create: "+ vnfList.size(), isDebugEnabled)
ModelInfo vnfModelInfo = vnfList[0].getModelInfo()
@@ -341,7 +341,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { String vnfModelInfoWithRoot = vnfModelInfo.toString()
vnfModelInfoString = jsonUtil.getJsonValue(vnfModelInfoWithRoot, "modelInfo")
} else {
- execution.setVariable("CVRCS_VNFsCount", 0)
+ execution.setVariable(Prefix+"VNFsCount", 0)
utils.log("DEBUG", "no vnfs to create based upon serviceDecomposition content", isDebugEnabled)
}
@@ -349,111 +349,18 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { execution.setVariable("vnfModelInfoString", vnfModelInfoString)
utils.log("DEBUG", " vnfModelInfoString :" + vnfModelInfoString, isDebugEnabled)
- utils.log("DEBUG", " ***** Completed getDataFromDecomposition() of CreateVcpeResCustService ***** ", isDebugEnabled)
+ utils.log("DEBUG", " ***** Completed processDecomposition() of CreateVcpeResCustService ***** ", isDebugEnabled)
} catch (Exception ex) {
sendSyncError(execution)
- String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. getDataFromDecomposition() - " + ex.getMessage()
+ String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. processDecomposition() - " + ex.getMessage()
utils.log("DEBUG", exceptionMessage, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
- // *******************************
- // Generate Network request Section
- // *******************************
- public void prepareNetworkCreate (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-
- try {
- utils.log("DEBUG", " ***** Inside preparenNetworkCreate of CreateVcpeResCustService ***** ", isDebugEnabled)
-
-
- String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
-
- List<NetworkResource> networkList = execution.getVariable("networkList")
- utils.log("DEBUG", "networkList: "+ networkList, isDebugEnabled)
-
- Integer networksCreatedCount = execution.getVariable("CVRCS_NetworksCreatedCount")
- String networkModelInfoString = ""
-
- if (networkList != null) {
- utils.log("DEBUG", " getting model info for network # :" + networksCreatedCount, isDebugEnabled)
- ModelInfo networkModelInfo = networkList[networksCreatedCount.intValue()].getModelInfo()
- //Currently use String representation in JSON format as an input
- //execution.setVariable("networkModelInfo", networkModelInfo)
- networkModelInfoString = networkModelInfo.toJsonStringNoRootName()
- } else {
- String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected number of networks to create - " + ex.getMessage()
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
- }
-
- //Currently use String representation in JSON format as an input
- execution.setVariable("networkModelInfo", networkModelInfoString)
- utils.log("DEBUG", " networkModelInfoString :" + networkModelInfoString, isDebugEnabled)
-
- // extract cloud configuration
- String lcpCloudRegionId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.cloudConfiguration.lcpCloudRegionId")
- execution.setVariable("lcpCloudRegionId", lcpCloudRegionId)
- utils.log("DEBUG","lcpCloudRegionId: "+ lcpCloudRegionId, isDebugEnabled)
- String tenantId = jsonUtil.getJsonValue(createVcpeServiceRequest, "requestDetails.cloudConfiguration.tenantId")
- execution.setVariable("tenantId", tenantId)
- utils.log("DEBUG","tenantId: "+ tenantId, isDebugEnabled)
-
- String sdncVersion = execution.getVariable("sdncVersion")
- utils.log("DEBUG","sdncVersion: "+ sdncVersion, isDebugEnabled)
-
-// List<VnfResource> vnfList = execution.getVariable("vnfList")
-// utils.log("DEBUG", "vnfList: "+ vnfList.toString(), isDebugEnabled)
-//
-// String vnfModelInfo = execution.getVariable("vnfModelInfo")
-// utils.log("DEBUG", "vnfModelInfo: "+ vnfModelInfo, isDebugEnabled)
-
- utils.log("DEBUG", " ***** Completed preparenNetworkCreate of CreateVcpeResCustService ***** ", isDebugEnabled)
- } catch (Exception ex) {
- // try error in method block
- String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method prepareNetworkCreate() - " + ex.getMessage()
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
- }
- }
-
- // *******************************
- // Validate Network request Section -> increment count
- // *******************************
- public void validateNetworkCreate (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-
- try {
- utils.log("DEBUG", " ***** Inside validateNetworkCreate of CreateVcpeResCustService ***** ", isDebugEnabled)
-
- Integer networksCreatedCount = execution.getVariable("CVRCS_NetworksCreatedCount")
- networksCreatedCount++
- execution.setVariable("CVRCS_NetworksCreatedCount", networksCreatedCount)
-
- execution.setVariable("DCRENI_rollbackData"+networksCreatedCount, execution.getVariable("DCRENI_rollbackData"))
-
- utils.log("DEBUG", "networksCreatedCount: "+ networksCreatedCount, isDebugEnabled)
- utils.log("DEBUG", "DCRENI_rollbackData N : "+ execution.getVariable("DCRENI_rollbackData"+networksCreatedCount), isDebugEnabled)
-
-// JSONArray vnfList = execution.getVariable("vnfList")
-// utils.log("DEBUG", "vnfList: "+ vnfList, isDebugEnabled)
-
- String vnfModelInfo = execution.getVariable("vnfModelInfo")
- utils.log("DEBUG", "vnfModelInfo: "+ vnfModelInfo, isDebugEnabled)
-
- List<NetworkResource> networkList = execution.getVariable("networkList")
- utils.log("DEBUG", "networkList: "+ networkList, isDebugEnabled)
-
- utils.log("DEBUG", " ***** Completed validateNetworkCreate of CreateVcpeResCustService ***** "+" network # "+networksCreatedCount, isDebugEnabled)
- } catch (Exception ex) {
- // try error in method block
- String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method validateNetworkCreate() - " + ex.getMessage()
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
- }
- }
-
public void prepareCreateAllottedResourceTXC(Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
try {
utils.log("DEBUG", " ***** Inside prepareCreateAllottedResourceTXC of CreateVcpeResCustService ***** ", isDebugEnabled)
@@ -467,13 +374,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
- //parentServiceInstanceId
- //The parentServiceInstanceId will be a Landing Network service. This value will have been provided to the calling flow by SNIRO query (homing solution).
- //serviceDecomposition.getServiceNetworks()
-
- //For 1707, the vIPR Tenant OAM flow will use the BRG allotted resource parent service ID (since it is known that the security zone also comes from the vIPR FW).
- //Beyond 1707, this would need to be captured somehow in TOSCA model and also provided by SNIRO.
-
//allottedResourceModelInfo
//allottedResourceRole
//The model Info parameters are a JSON structure as defined in the Service Instantiation API.
@@ -486,34 +386,20 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { utils.log("DEBUG", " getting model info for AllottedResource # :" + allottedResource.toJsonString(), isDebugEnabled)
utils.log("DEBUG", " allottedResource.getAllottedResourceType() :" + allottedResource.getAllottedResourceType(), isDebugEnabled)
- if(allottedResource.getAllottedResourceType() != null && allottedResource.getAllottedResourceType().equalsIgnoreCase("TunnelXConn")){
+ if("TunnelXConn".equalsIgnoreCase(allottedResource.getAllottedResourceType())){
//set create flag to true
execution.setVariable("createTXCAR", true)
ModelInfo allottedResourceModelInfo = allottedResource.getModelInfo()
execution.setVariable("allottedResourceModelInfoTXC", allottedResourceModelInfo.toJsonString())
execution.setVariable("allottedResourceRoleTXC", allottedResource.getAllottedResourceRole())
execution.setVariable("allottedResourceTypeTXC", allottedResource.getAllottedResourceType())
-
- //from Homing Solution. This is the infraServiceInstanceId in the BRG Allotted Resource decomposition structure.
+ //After decomposition and homing BBs, there should be an allotted resource object in the decomposition that represents the TXC,
+ //and in its homingSolution section should be found the infraServiceInstanceId (i.e. infraServiceInstanceId in TXC Allotted Resource structure) (which the Homing BB would have populated).
execution.setVariable("parentServiceInstanceIdTXC", allottedResource.getHomingSolution().getServiceInstanceId())
} }
}
- //Populate with the A&AI network ID (l3-network object) for the Tenant OAM network that was created in prior step
- //String sourceNetworkId = execution.getVariable("networkId")
- //execution.setVariable("sourceNetworkId", sourceNetworkId)
- //Populate with the network-role (from A&AI l3-network object) for the Tenant OAM network from prior step
-
- //List<NetworkResource> networkResources = serviceDecomposition.getServiceNetworks()
- //if (networkResources != null) {
- //Iterator iter = networkResources.iterator();
- //while (iter.hasNext()){
- //NetworkResource networkResource = (NetworkResource)iter.next();
- //execution.setVariable("sourceNetworkRole", networkResource.getNetworkRole())
- //}
- //}
-
//unit test only
String allottedResourceId = execution.getVariable("allottedResourceId")
execution.setVariable("allottedResourceIdTXC", allottedResourceId)
@@ -527,7 +413,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { }
}
public void prepareCreateAllottedResourceBRG(Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
try {
utils.log("DEBUG", " ***** Inside prepareCreateAllottedResourceBRG of CreateVcpeResCustService ***** ", isDebugEnabled)
@@ -541,13 +427,6 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { String createVcpeServiceRequest = execution.getVariable("createVcpeServiceRequest")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
- //parentServiceInstanceId
- //The parentServiceInstanceId will be a Landing Network service. This value will have been provided to the calling flow by SNIRO query (homing solution).
- //serviceDecomposition.getServiceNetworks()
-
- //For 1707, the vIPR Tenant OAM flow will use the BRG allotted resource parent service ID (since it is known that the security zone also comes from the vIPR FW).
- //Beyond 1707, this would need to be captured somehow in TOSCA model and also provided by SNIRO.
-
//allottedResourceModelInfo
//allottedResourceRole
//The model Info parameters are a JSON structure as defined in the Service Instantiation API.
@@ -560,38 +439,20 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { utils.log("DEBUG", " getting model info for AllottedResource # :" + allottedResource.toJsonString(), isDebugEnabled)
utils.log("DEBUG", " allottedResource.getAllottedResourceType() :" + allottedResource.getAllottedResourceType(), isDebugEnabled)
- if (allottedResource.getAllottedResourceType() != null && allottedResource.getAllottedResourceType().equalsIgnoreCase("BRG")) {
+ if("BRG".equalsIgnoreCase(allottedResource.getAllottedResourceType())){
//set create flag to true
execution.setVariable("createBRGAR", true)
ModelInfo allottedResourceModelInfo = allottedResource.getModelInfo()
execution.setVariable("allottedResourceModelInfoBRG", allottedResourceModelInfo.toJsonString())
execution.setVariable("allottedResourceRoleBRG", allottedResource.getAllottedResourceRole())
execution.setVariable("allottedResourceTypeBRG", allottedResource.getAllottedResourceType())
- //For 1707, the vIPR Tenant OAM flow will use the BRG allotted resource parent service ID (since it is known that the security zone also comes from the vIPR FW).
- //This Id should be taken from the homing solution for the BRG resource.
- //After decomposition and homing BBs, there should be an allotted resource object in the decomposition that represents the BRG,
+ //After decomposition and homing BBs, there should be an allotted resource object in the decomposition that represents the BRG,
//and in its homingSolution section should be found the infraServiceInstanceId (i.e. infraServiceInstanceId in BRG Allotted Resource structure) (which the Homing BB would have populated).
-
- //from Homing Solution. This is the infraServiceInstanceId in the BRG Allotted Resource decomposition structure.
execution.setVariable("parentServiceInstanceIdBRG", allottedResource.getHomingSolution().getServiceInstanceId())
}
}
}
- //Populate with the A&AI network ID (l3-network object) for the Tenant OAM network that was created in prior step
- //String sourceNetworkId = execution.getVariable("networkId")
- //execution.setVariable("sourceNetworkId", sourceNetworkId)
- //Populate with the network-role (from A&AI l3-network object) for the Tenant OAM network from prior step
-
- //List<NetworkResource> networkResources = serviceDecomposition.getServiceNetworks()
- //if (networkResources != null) {
- //Iterator iter = networkResources.iterator();
- //while (iter.hasNext()){
- //NetworkResource networkResource = (NetworkResource)iter.next();
- //execution.setVariable("sourceNetworkRole", networkResource.getNetworkRole())
- //}
- //}
-
//unit test only
String allottedResourceId = execution.getVariable("allottedResourceId")
execution.setVariable("allottedResourceIdBRG", allottedResourceId)
@@ -611,7 +472,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { // Generate Network request Section
// *******************************
public void prepareVnfAndModulesCreate (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
try {
utils.log("DEBUG", " ***** Inside prepareVnfAndModulesCreate of CreateVcpeResCustService ***** ", isDebugEnabled)
@@ -634,7 +495,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { List<VnfResource> vnfList = execution.getVariable("vnfList")
- Integer vnfsCreatedCount = execution.getVariable("CVRCS_VnfsCreatedCount")
+ Integer vnfsCreatedCount = execution.getVariable(Prefix+"VnfsCreatedCount")
String vnfModelInfoString = null;
if (vnfList != null && vnfList.size() > 0 ) {
@@ -673,15 +534,15 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { // Validate Vnf request Section -> increment count
// *******************************
public void validateVnfCreate (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
try {
utils.log("DEBUG", " ***** Inside validateVnfCreate of CreateVcpeResCustService ***** ", isDebugEnabled)
- Integer vnfsCreatedCount = execution.getVariable("CVRCS_VnfsCreatedCount")
+ Integer vnfsCreatedCount = execution.getVariable(Prefix+"VnfsCreatedCount")
vnfsCreatedCount++
- execution.setVariable("CVRCS_VnfsCreatedCount", vnfsCreatedCount)
+ execution.setVariable(Prefix+"VnfsCreatedCount", vnfsCreatedCount)
utils.log("DEBUG", " ***** Completed validateVnfCreate of CreateVcpeResCustService ***** "+" vnf # "+vnfsCreatedCount, isDebugEnabled)
} catch (Exception ex) {
@@ -691,38 +552,11 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { }
}
- // *******************************
- // Validate Network request Section -> decrement count
- // *******************************
- public void validateNetworkRollback (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-
- try {
- utils.log("DEBUG", " ***** Inside validateNetworkRollback of CreateVcpeResCustService ***** ", isDebugEnabled)
-
- Integer networksCreatedCount = execution.getVariable("CVRCS_NetworksCreatedCount")
- networksCreatedCount--
-
- execution.setVariable("CVRCS_NetworksCreatedCount", networksCreatedCount)
-
- execution.setVariable("DCRENI_rollbackData", execution.getVariable("DCRENI_rollbackData"+networksCreatedCount))
-
- utils.log("DEBUG", " ***** Completed validateNetworkRollback of CreateVcpeResCustService ***** "+" network # "+networksCreatedCount, isDebugEnabled)
- } catch (Exception ex) {
- // try error in method block
- String exceptionMessage = "Bpmn error encountered in CreateVcpeResCustService flow. Unexpected Error from method validateNetworkRollback() - " + ex.getMessage()
- //exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
- utils.log("DEBUG", exceptionMessage, isDebugEnabled)
- execution.setVariable("CVRCS_NetworksCreatedCount", 0)
- utils.log("ERROR", exceptionMessage, true)
- }
- }
-
// *****************************************
// Prepare Completion request Section
// *****************************************
public void postProcessResponse (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
utils.log("DEBUG", " ***** Inside postProcessResponse of CreateVcpeResCustService ***** ", isDebugEnabled)
@@ -748,8 +582,8 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
utils.logAudit(xmlMsoCompletionRequest)
- execution.setVariable("CVRCS_Success", true)
- execution.setVariable("CVRCS_CompleteMsoProcessRequest", xmlMsoCompletionRequest)
+ execution.setVariable(Prefix+"Success", true)
+ execution.setVariable(Prefix+"CompleteMsoProcessRequest", xmlMsoCompletionRequest)
utils.log("DEBUG", " SUCCESS flow, going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
} catch (BpmnError e) {
throw e;
@@ -761,7 +595,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { }
public void preProcessRollback (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
utils.log("DEBUG"," ***** preProcessRollback of CreateVcpeResCustService ***** ", isDebugEnabled)
try {
@@ -782,7 +616,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { }
public void postProcessRollback (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
utils.log("DEBUG"," ***** postProcessRollback of CreateVcpeResCustService ***** ", isDebugEnabled)
String msg = ""
try {
@@ -802,19 +636,19 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { }
public void prepareFalloutRequest(Execution execution){
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
utils.log("DEBUG", " *** STARTED CreateVcpeResCustService prepareFalloutRequest Process *** ", isDebugEnabled)
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
utils.log("DEBUG", " Incoming Workflow Exception: " + wfex.toString(), isDebugEnabled)
- String requestInfo = execution.getVariable("CVRCS_requestInfo")
+ String requestInfo = execution.getVariable(Prefix+"requestInfo")
utils.log("DEBUG", " Incoming Request Info: " + requestInfo, isDebugEnabled)
//TODO. hmmm. there is no way to UPDATE error message.
// String errorMessage = wfex.getErrorMessage()
-// boolean successIndicator = execution.getVariable("DCRESI_rollbackSuccessful")
+// boolean successIndicator = execution.getVariable("DCRESI_rolledBack")
// if (successIndicator){
// errorMessage = errorMessage + ". Rollback successful."
// } else {
@@ -823,7 +657,7 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
- execution.setVariable("CVRCS_falloutRequest", falloutRequest)
+ execution.setVariable(Prefix+"falloutRequest", falloutRequest)
} catch (Exception ex) {
utils.log("DEBUG", "Error Occured in CreateVcpeResCustService prepareFalloutRequest Process " + ex.getMessage(), isDebugEnabled)
@@ -834,15 +668,15 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { public void sendSyncError (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
execution.setVariable("prefix", Prefix)
utils.log("DEBUG", " ***** Inside sendSyncError() of CreateVcpeResCustService ***** ", isDebugEnabled)
try {
String errorMessage = ""
- if (execution.getVariable("WorkflowException") instanceof WorkflowException) {
- WorkflowException wfe = execution.getVariable("WorkflowException")
+ def wfe = execution.getVariable("WorkflowException")
+ if (wfe instanceof WorkflowException) {
errorMessage = wfe.getErrorMessage()
} else {
errorMessage = "Sending Sync Error."
@@ -862,20 +696,20 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor { }
public void processJavaException(Execution execution){
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
execution.setVariable("prefix",Prefix)
try{
utils.log("DEBUG", "Caught a Java Exception", isDebugEnabled)
utils.log("DEBUG", "Started processJavaException Method", isDebugEnabled)
utils.log("DEBUG", "Variables List: " + execution.getVariables(), isDebugEnabled)
- execution.setVariable("CRESI_unexpectedError", "Caught a Java Lang Exception") // Adding this line temporarily until this flows error handling gets updated
+ execution.setVariable(Prefix+"unexpectedError", "Caught a Java Lang Exception") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(BpmnError b){
utils.log("ERROR", "Rethrowing MSOWorkflowException", isDebugEnabled)
throw b
}catch(Exception e){
utils.log("DEBUG", "Caught Exception during processJavaException Method: " + e, isDebugEnabled)
- execution.setVariable("CRESI_unexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated
+ execution.setVariable(Prefix+"unexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception in processJavaException method")
}
utils.log("DEBUG", "Completed processJavaException Method", isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DeleteVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy index 960bb5cc7f..04eb4c7d7e 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DeleteVcpeResCustService.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DeleteVcpeResCustService.groovy @@ -1,5 +1,21 @@ /*
- * © 2016 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property.
+ * ============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.vcpe.scripts
@@ -33,7 +49,9 @@ import org.springframework.web.util.UriUtils; */
public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor {
- String Prefix="DELVAS_"
+ private static final String DebugFlag = "isDebugLogEnabled"
+
+ String Prefix = "DVRCS_"
ExceptionUtil exceptionUtil = new ExceptionUtil()
JsonUtils jsonUtil = new JsonUtils()
VidUtils vidUtils = new VidUtils()
@@ -49,10 +67,8 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { execution.setVariable("DeleteVcpeResCustServiceRequest", "")
execution.setVariable("msoRequestId", "")
- execution.setVariable("DELVAS_vnfsDeletedCount", 0)
- execution.setVariable("DELVAS_vnfsCount", 0)
- execution.setVariable("DELVAS_networksCount", 0)
- execution.setVariable("DELVAS_networksDeletedCount", 0)
+ execution.setVariable(Prefix+"vnfsDeletedCount", 0)
+ execution.setVariable(Prefix+"vnfsCount", 0)
}
// **************************************************
@@ -63,7 +79,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { * @param execution
*/
public void preProcessRequest (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
execution.setVariable("prefix",Prefix)
utils.log("DEBUG", " ***** Inside preProcessRequest DeleteVcpeResCustService Request ***** ", isDebugEnabled)
@@ -93,10 +109,9 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { String source = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.requestInfo.source")
if ((source == null) || (source.isEmpty())) {
- execution.setVariable("source", "VID")
- } else {
- execution.setVariable("source", source)
+ source = "VID"
}
+ execution.setVariable("source", source)
// extract globalSubscriberId
String globalSubscriberId = jsonUtil.getJsonValue(DeleteVcpeResCustServiceRequest, "requestDetails.subscriberInfo.globalSubscriberId")
@@ -139,7 +154,7 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { <source>${source}</source>
</request-info>"""
- execution.setVariable("DELVAS_requestInfo", requestInfo)
+ execution.setVariable(Prefix+"requestInfo", requestInfo)
//Setting for Generic Sub Flows
execution.setVariable("GENGS_type", "service-instance")
@@ -154,8 +169,8 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { }
}
- public void sendSyncResponse (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ public void sendSyncResponse(Execution execution) {
+ def isDebugEnabled=execution.getVariable(DebugFlag)
utils.log("DEBUG", " ***** Inside sendSyncResponse of DeleteVcpeResCustService ***** ", isDebugEnabled)
@@ -169,13 +184,13 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { utils.log("DEBUG", " sendSynchResponse: xmlSyncResponse - " + "\n" + syncResponse, isDebugEnabled)
sendWorkflowResponse(execution, 202, syncResponse)
} catch (Exception ex) {
- String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. Unexpected from method preProcessRequest() - " + ex.getMessage()^M + String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. Unexpected from method preProcessRequest() - " + ex.getMessage() exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
- public void prepareServiceDelete (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ public void prepareServiceDelete(Execution execution) {
+ def isDebugEnabled=execution.getVariable(DebugFlag)
utils.log("DEBUG", " ***** Inside prepareServiceInstanceDelete() of DeleteVcpeResCustService ***** ", isDebugEnabled)
try {
@@ -198,8 +213,8 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { utils.log("DEBUG", "serviceInstanceAaiRecord: "+serviceInstanceAaiRecord, isDebugEnabled)
// determine if AR needs to be deleted
- boolean DELVAS_TunnelXConn = false
- boolean DELVAS_BRG = false
+ boolean DVRCS_TunnelXConn = false
+ boolean DVRCS_BRG = false
String TXC_allottedResourceId
String BRG_allottedResourceId
XmlParser xmlParser = new XmlParser()
@@ -208,32 +223,31 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { if (arList != null) {
def groovy.util.NodeList ars = utils.getIdenticalChildren(arList, 'allotted-resource')
for (groovy.util.Node ar in ars) {
- def groovy.util.Node type = utils.getChildNode(ar, 'type')
- if ((type != null) && (type.text().equals('TunnelXConn'))) {
+ def type = utils.getChildNodeText(ar, 'type')
+ if ("TunnelXConn".equals(type)) {
utils.log("DEBUG","TunnelXConn AR found", isDebugEnabled)
- def groovy.util.Node id = utils.getChildNode(ar, 'id')
+ def id = utils.getChildNodeText(ar, 'id')
if (id != null){
- DELVAS_TunnelXConn = true
+ DVRCS_TunnelXConn = true
TXC_allottedResourceId = id
}
- }
- if ((type != null) && (type.text().equals('BRG'))) {
+ } else if ("BRG".equals(type)) {
utils.log("DEBUG","FW AR found", isDebugEnabled)
- def groovy.util.Node id = utils.getChildNode(ar, 'id')
+ def id = utils.getChildNodeText(ar, 'id')
if (id != null){
- DELVAS_BRG = true
+ DVRCS_BRG = true
BRG_allottedResourceId = id
}
}
}
}
- execution.setVariable("DELVAS_TunnelXConn", DELVAS_TunnelXConn)
- utils.log("DEBUG", "DELVAS_TunnelXConn : " + DELVAS_TunnelXConn, isDebugEnabled)
+ execution.setVariable(Prefix+"TunnelXConn", DVRCS_TunnelXConn)
+ utils.log("DEBUG", Prefix+"TunnelXConn : " + DVRCS_TunnelXConn, isDebugEnabled)
execution.setVariable("TXC_allottedResourceId", TXC_allottedResourceId)
utils.log("DEBUG", "TXC_allottedResourceId : " + TXC_allottedResourceId, isDebugEnabled)
- execution.setVariable("DELVAS_BRG", DELVAS_BRG)
- utils.log("DEBUG", "DELVAS_BRG : " + DELVAS_BRG, isDebugEnabled)
+ execution.setVariable(Prefix+"BRG", DVRCS_BRG)
+ utils.log("DEBUG", Prefix+"BRG : " + DVRCS_BRG, isDebugEnabled)
execution.setVariable("BRG_allottedResourceId", BRG_allottedResourceId)
utils.log("DEBUG", "BRG_allottedResourceId : " + BRG_allottedResourceId, isDebugEnabled)
@@ -246,7 +260,6 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { utils.log("DEBUG", " relationship string - " + relationship, isDebugEnabled)
int vnfsCount = 0
- int networksCount = 0
if (relationship != null && relationship.length() > 0){
relationship = relationship.trim().replace("tag0:","").replace(":tag0","")
@@ -254,29 +267,20 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { // Check if Network TableREf is present, then build a List of network policy
List relatedVnfIdList = networkUtils.getRelatedVnfIdList(relationship)
vnfsCount = relatedVnfIdList.size()
- execution.setVariable("DELVAS_vnfsCount", vnfsCount)
- utils.log("DEBUG", " DELVAS_vnfsCount : " + vnfsCount, isDebugEnabled)
- execution.setVariable("DELVAS_relatedVnfIdList", relatedVnfIdList)
-
- // Check if Network TableREf is present, then build a List of network policy
- List relatedNetworkIdList = networkUtils.getRelatedNetworkIdList(relationship)
- networksCount = relatedNetworkIdList.size()
- execution.setVariable("DELVAS_networksCount", networksCount)
- utils.log("DEBUG", " DELVAS_networksCount : " + networksCount, isDebugEnabled)
- execution.setVariable("DELVAS_relatedNetworkIdList", relatedNetworkIdList)
+ execution.setVariable(Prefix+"vnfsCount", vnfsCount)
+ utils.log("DEBUG", " "+Prefix+"vnfsCount : " + vnfsCount, isDebugEnabled)
+ execution.setVariable(Prefix+"relatedVnfIdList", relatedVnfIdList)
} else {
- execution.setVariable("DELVAS_vnfsCount", 0)
- utils.log("DEBUG", " DELVAS_vnfsCount : " + vnfsCount, isDebugEnabled)
- execution.setVariable("DELVAS_networksCount", 0)
- utils.log("DEBUG", " DELVAS_networksCount : " + networksCount, isDebugEnabled)
+ execution.setVariable(Prefix+"vnfsCount", 0)
+ utils.log("DEBUG", " "+Prefix+"vnfsCount : " + vnfsCount, isDebugEnabled)
}
- utils.log("DEBUG", " ***** Completed prepareServiceInstanceDelete() of DeleteVcpeCusRestService ***** ", isDebugEnabled)
+ utils.log("DEBUG", " ***** Completed prepareServiceInstanceDelete() of DeleteVcpeResCustService ***** ", isDebugEnabled)
} catch (BpmnError e){
throw e;
} catch (Exception ex) {
sendSyncError(execution)
- String exceptionMessage = "Bpmn error encountered in DeleteVcpeCusRestService flow. prepareServiceInstanceDelete() - " + ex.getMessage()
+ String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. prepareServiceInstanceDelete() - " + ex.getMessage()
utils.log("DEBUG", exceptionMessage, isDebugEnabled)
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
@@ -287,13 +291,12 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { //
// *******************************
public void prepareVnfAndModulesDelete (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
+ utils.log("DEBUG", " ***** Inside prepareVnfAndModulesDelete of DeleteVcpeResCustService ***** ", isDebugEnabled)
try {
- utils.log("DEBUG", " ***** Inside prepareVnfAndModulesDelete of DeleteServiceInstanceMacro ***** ", isDebugEnabled)
-
- List vnfList = execution.getVariable("DELVAS_relatedVnfIdList")
- Integer vnfsDeletedCount = execution.getVariable("DELVAS_vnfsDeletedCount")
+ List vnfList = execution.getVariable(Prefix+"relatedVnfIdList")
+ int vnfsDeletedCount = execution.getVariable(Prefix+"vnfsDeletedCount")
String vnfModelInfoString = ""
String vnfId = ""
if (vnfList.size() > 0 ) {
@@ -303,10 +306,10 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { execution.setVariable("vnfId", vnfId)
utils.log("DEBUG", "need to delete vnfId:" + vnfId, isDebugEnabled)
- utils.log("DEBUG", " ***** Completed prepareVnfAndModulesDelete of DeleteServiceInstanceMacro ***** ", isDebugEnabled)
+ utils.log("DEBUG", " ***** Completed prepareVnfAndModulesDelete of DeleteVcpeResCustService ***** ", isDebugEnabled)
} catch (Exception ex) {
// try error in method block
- String exceptionMessage = "Bpmn error encountered in DeleteServiceInstanceMacro flow. Unexpected Error from method prepareVnfAndModulesDelete() - " + ex.getMessage()
+ String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. Unexpected Error from method prepareVnfAndModulesDelete() - " + ex.getMessage()
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
@@ -315,70 +318,19 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { // Validate Vnf request Section -> increment count
// *******************************
public void validateVnfDelete (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
+ utils.log("DEBUG", " ***** Inside validateVnfDelete of DeleteVcpeResCustService ***** ", isDebugEnabled)
try {
- utils.log("DEBUG", " ***** Inside validateVnfDelete of DeleteVcpeCusRestService ***** ", isDebugEnabled)
-
- String vnfsDeletedCount = execution.getVariable("DELVAS_vnfsDeletedCount")
+ int vnfsDeletedCount = execution.getVariable(Prefix+"vnfsDeletedCount")
vnfsDeletedCount++
- execution.setVariable("DELVAS_vnfsDeletedCount", vnfsDeletedCount)
-
- utils.log("DEBUG", " ***** Completed validateVnfDelete of DeleteVcpeCusRestService ***** "+" vnf # "+vnfsDeletedCount, isDebugEnabled)
- } catch (Exception ex) {
- // try error in method block
- String exceptionMessage = "Bpmn error encountered in DeleteVcpeCusRestService flow. Unexpected Error from method validateVnfDelete() - " + ex.getMessage()
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
- }
- }
-
- // *******************************
- // Generate Network request Section
- // *******************************
- public void prepareNetworkDelete (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-
- try {
- utils.log("DEBUG", " ***** Inside prepareNetworkDelete of DeleteVcpeCusRestService ***** ", isDebugEnabled)
-
- List networkList = execution.getVariable("DELVAS_relatedNetworkIdList")
- Integer networksDeletedCount = execution.getVariable("DELVAS_networksDeletedCount")
-
- String networkId = ""
- if (networkList.size() > 0) {
- networkId = networkList.get(networksDeletedCount.intValue())
- }
-
- execution.setVariable("networkId", networkId)
- utils.log("DEBUG", "need to delete networkId:" + networkId, isDebugEnabled)
-
- utils.log("DEBUG", " ***** Completed prepareNetworkDelete of DeleteVcpeCusRestService ***** ", isDebugEnabled)
- } catch (Exception ex) {
- // try error in method block
- String exceptionMessage = q"Bpmn error encountered in DeleteVcpeCusRestService flow. Unexpected Error from method prepareNetworkDelete() - " + ex.getMessage()
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
- }
- }
-
- // *******************************
- // Validate Network request Section
- // *******************************
- public void validateNetworkDelete (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
-
- try {
- utils.log("DEBUG", " ***** Inside validateNetworkDelete of DeleteVcpeCusRestService ***** ", isDebugEnabled)
-
- Integer networksDeletedCount = execution.getVariable("DELVAS_networksDeletedCount")
- networksDeletedCount++
-
- execution.setVariable("DELVAS_networksDeletedCount", networksDeletedCount)
+ execution.setVariable(Prefix+"vnfsDeletedCount", vnfsDeletedCount)
- utils.log("DEBUG", " ***** Completed validateNetworkDelete of DeleteVcpeCusRestService ***** ", isDebugEnabled)
+ utils.log("DEBUG", " ***** Completed validateVnfDelete of DeleteVcpeResCustService ***** "+" vnf # "+vnfsDeletedCount, isDebugEnabled)
} catch (Exception ex) {
// try error in method block
- String exceptionMessage = "Bpmn error encountered in DeleteVcpeCusRestService flow. Unexpected Error from method validateNetworkDelete() - " + ex.getMessage()
+ String exceptionMessage = "Bpmn error encountered in DeleteVcpeResCustService flow. Unexpected Error from method validateVnfDelete() - " + ex.getMessage()
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
}
}
@@ -388,8 +340,8 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { // Prepare Completion request Section
// *****************************************
public void postProcessResponse (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " ***** Inside postProcessResponse of DeleteVcpeCusRestService ***** ", isDebugEnabled)
+ def isDebugEnabled=execution.getVariable(DebugFlag)
+ utils.log("DEBUG", " ***** Inside postProcessResponse of DeleteVcpeResCustService ***** ", isDebugEnabled)
try {
String source = execution.getVariable("source")
@@ -411,8 +363,8 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { String xmlMsoCompletionRequest = utils.formatXml(msoCompletionRequest)
utils.logAudit(xmlMsoCompletionRequest)
- execution.setVariable("DELVAS_Success", true)
- execution.setVariable("DELVAS_CompleteMsoProcessRequest", xmlMsoCompletionRequest)
+ execution.setVariable(Prefix+"Success", true)
+ execution.setVariable(Prefix+"CompleteMsoProcessRequest", xmlMsoCompletionRequest)
utils.log("DEBUG", " SUCCESS flow, going to CompleteMsoProcess - " + "\n" + xmlMsoCompletionRequest, isDebugEnabled)
} catch (BpmnError e) {
throw e;
@@ -425,29 +377,29 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { }
public void prepareFalloutRequest(Execution execution){
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " *** STARTED DeleteVcpeCusRestService prepareFalloutRequest Process *** ", isDebugEnabled)
+ def isDebugEnabled=execution.getVariable(DebugFlag)
+ utils.log("DEBUG", " *** STARTED DeleteVcpeResCustService prepareFalloutRequest Process *** ", isDebugEnabled)
try {
WorkflowException wfex = execution.getVariable("WorkflowException")
utils.log("DEBUG", " Incoming Workflow Exception: " + wfex.toString(), isDebugEnabled)
- String requestInfo = execution.getVariable("DELVAS_requestInfo")
+ String requestInfo = execution.getVariable(Prefix+"requestInfo")
utils.log("DEBUG", " Incoming Request Info: " + requestInfo, isDebugEnabled)
String falloutRequest = exceptionUtil.processMainflowsBPMNException(execution, requestInfo)
- execution.setVariable("DELVAS_falloutRequest", falloutRequest)
+ execution.setVariable(Prefix+"falloutRequest", falloutRequest)
} catch (Exception ex) {
- utils.log("DEBUG", "Error Occured in DeleteVcpeCusRestService prepareFalloutRequest Process " + ex.getMessage(), isDebugEnabled)
- exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DeleteVcpeCusRestService prepareFalloutRequest Process")
+ utils.log("DEBUG", "Error Occured in DeleteVcpeResCustService prepareFalloutRequest Process " + ex.getMessage(), isDebugEnabled)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Internal Error - Occured in DeleteVcpeResCustService prepareFalloutRequest Process")
}
- utils.log("DEBUG", "*** COMPLETED DeleteVcpeCusRestService prepareFalloutRequest Process ***", isDebugEnabled)
+ utils.log("DEBUG", "*** COMPLETED DeleteVcpeResCustService prepareFalloutRequest Process ***", isDebugEnabled)
}
public void sendSyncError (Execution execution) {
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
- utils.log("DEBUG", " ***** Inside sendSyncError() of DeleteServiceInstanceInfra ***** ", isDebugEnabled)
+ def isDebugEnabled=execution.getVariable(DebugFlag)
+ utils.log("DEBUG", " ***** Inside sendSyncError() of DeleteVcpeResCustService ***** ", isDebugEnabled)
try {
String errorMessage = ""
@@ -472,20 +424,20 @@ public class DeleteVcpeResCustService extends AbstractServiceTaskProcessor { }
public void processJavaException(Execution execution){
- def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
+ def isDebugEnabled=execution.getVariable(DebugFlag)
execution.setVariable("prefix",Prefix)
try{
utils.log("DEBUG", "Caught a Java Exception", isDebugEnabled)
utils.log("DEBUG", "Started processJavaException Method", isDebugEnabled)
utils.log("DEBUG", "Variables List: " + execution.getVariables(), isDebugEnabled)
- execution.setVariable("DELVAS_unexpectedError", "Caught a Java Lang Exception") // Adding this line temporarily until this flows error handling gets updated
+ execution.setVariable(Prefix+"unexpectedError", "Caught a Java Lang Exception") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Caught a Java Lang Exception")
}catch(BpmnError b){
utils.log("ERROR", "Rethrowing MSOWorkflowException", isDebugEnabled)
throw b
}catch(Exception e){
utils.log("DEBUG", "Caught Exception during processJavaException Method: " + e, isDebugEnabled)
- execution.setVariable("DELVAS_unexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated
+ execution.setVariable(Prefix+"unexpectedError", "Exception in processJavaException method") // Adding this line temporarily until this flows error handling gets updated
exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Exception in processJavaException method")
}
utils.log("DEBUG", "Completed processJavaException Method", isDebugEnabled)
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceBRG.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy index 528a804b6f..9ddfa1e31c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceBRG.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRG.groovy @@ -1,5 +1,21 @@ /* - * © 2016 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. + * ============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.vcpe.scripts; @@ -48,13 +64,15 @@ import static org.apache.commons.lang3.StringUtils.* */ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ + private static final String DebugFlag = "isDebugLogEnabled" + String Prefix="DCARBRG_" ExceptionUtil exceptionUtil = new ExceptionUtil() JsonUtils jsonUtil = new JsonUtils() public void preProcessRequest (Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessRequest *****", isDebugEnabled) @@ -125,7 +143,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void getAaiAR (Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** getAaiAR ***** ", isDebugEnabled) String arType = execution.getVariable("allottedResourceType") @@ -163,7 +181,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void createAaiAR(Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** createAaiAR ***** ", isDebugEnabled) String msg = "" @@ -285,7 +303,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ public String buildSDNCRequest(Execution execution, String action, String sdncRequestId) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** buildSDNCRequest *****", isDebugEnabled) String sdncReq = null @@ -387,7 +405,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void preProcessSDNCAssign(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCAssign *****", isDebugEnabled) @@ -417,7 +435,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void preProcessSDNCCreate(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCCreate *****", isDebugEnabled) @@ -447,7 +465,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void preProcessSDNCActivate(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCActivate *****", isDebugEnabled) @@ -477,7 +495,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void validateSDNCResp(Execution execution, String response, String method){ - def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG", " *** ValidateSDNCResponse Process*** ", isDebugLogEnabled) String msg = "" @@ -516,7 +534,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ } public void preProcessSDNCGet(Execution execution){ - def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled = execution.getVariable(DebugFlag) utils.log("DEBUG", "*** preProcessSDNCGet *** ", isDebugLogEnabled) try{ @@ -576,7 +594,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ } public void updateAaiAROrchStatus(Execution execution, String status){ - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) utils.log("DEBUG", " *** updateAaiAROrchStatus *** ", isDebugEnabled) String aaiARPath = execution.getVariable("aaiARPath") //set during query (existing AR) or create AllottedResourceUtils arUtils = new AllottedResourceUtils(this) @@ -586,7 +604,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void generateOutputs(Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** generateOutputs ***** ", isDebugEnabled) try { String sdncGetResponse = execution.getVariable("enhancedCallbackRequestData") //unescaped @@ -608,7 +626,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ } public void preProcessRollback (Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugEnabled) try { @@ -629,7 +647,7 @@ public class DoCreateAllottedResourceBRG extends AbstractServiceTaskProcessor{ } public void postProcessRollback (Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugEnabled) String msg = "" try { diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy index 0e0f5c2035..c26b14e57c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceBRGRollback.groovy @@ -1,5 +1,21 @@ /* - * © 2016 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. + * ============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.vcpe.scripts; @@ -37,12 +53,14 @@ import static org.apache.commons.lang3.StringUtils.* */ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProcessor{ + private static final String DebugFlag = "isDebugLogEnabled" + String Prefix="DCARBRGRB_" ExceptionUtil exceptionUtil = new ExceptionUtil() public void preProcessRequest (Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessRequest *****", isDebugEnabled) execution.setVariable("prefix", Prefix) @@ -114,7 +132,7 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc // aaiARPath set during query (existing AR) public void updateAaiAROrchStatus(Execution execution, String status){ - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = null; utils.log("DEBUG", " *** updateAaiAROrchStatus ***", isDebugEnabled) AllottedResourceUtils arUtils = new AllottedResourceUtils(this) @@ -137,7 +155,7 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc public void validateSDNCResp(Execution execution, String response, String method){ - def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG", " *** ValidateSDNCResponse Process*** ", isDebugLogEnabled) String msg = "" @@ -160,24 +178,24 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc throw new BpmnError("MSOWorkflowException") } } catch (BpmnError e) { - if (e.getErrorCode() == 404) + if ("404".contentEquals(e.getErrorCode())) { msg = "SDNC rollback " + method + " returned a 404. Proceding with rollback" - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("DEBUG", msg, isDebugLogEnabled) } else { throw e; } } catch(Exception ex) { msg = "Exception in validateSDNCResp. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("DEBUG", msg, isDebugLogEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } logDebug(" *** Exit ValidateSDNCResp Process*** ", isDebugLogEnabled) } public void deleteAaiAR(Execution execution){ - def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled = execution.getVariable(DebugFlag) try{ utils.log("DEBUG", " *** deleteAaiAR *** ", isDebugLogEnabled) AllottedResourceUtils arUtils = new AllottedResourceUtils(this) @@ -198,7 +216,7 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc } public void postProcessRequest(Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** postProcessRequest ***** ", isDebugEnabled) String msg = "" try { @@ -222,7 +240,7 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc } public void processRollbackException(Execution execution){ - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** processRollbackException ***** ", isDebugEnabled) try{ utils.log("DEBUG", "Caught an Exception in DoCreateAllottedResourceRollback", isDebugEnabled) @@ -241,7 +259,7 @@ public class DoCreateAllottedResourceBRGRollback extends AbstractServiceTaskProc } public void processRollbackJavaException(Execution execution){ - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** processRollbackJavaException ***** ", isDebugEnabled) try{ execution.setVariable("rollbackData", null) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceTXC.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy index 28f3d6a771..8774effff9 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceTXC.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXC.groovy @@ -1,5 +1,21 @@ /* - * © 2016 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. + * ============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.vcpe.scripts; @@ -49,13 +65,15 @@ import static org.apache.commons.lang3.StringUtils.* */ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ + private static final String DebugFlag = "isDebugLogEnabled" + String Prefix="DCARTXC_" ExceptionUtil exceptionUtil = new ExceptionUtil() JsonUtils jsonUtil = new JsonUtils() public void preProcessRequest (Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessRequest *****", isDebugEnabled) @@ -116,7 +134,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void getAaiAR (Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** getAaiAR ***** ", isDebugEnabled) String arType = execution.getVariable("allottedResourceType") @@ -154,7 +172,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void createAaiAR(Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** createAaiAR ***** ", isDebugEnabled) String msg = "" @@ -276,7 +294,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ public String buildSDNCRequest(Execution execution, String action, String sdncRequestId) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** buildSDNCRequest *****", isDebugEnabled) String sdncReq = null @@ -375,7 +393,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void preProcessSDNCAssign(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCAssign *****", isDebugEnabled) @@ -405,7 +423,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void preProcessSDNCCreate(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCCreate *****", isDebugEnabled) @@ -435,7 +453,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void preProcessSDNCActivate(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCActivate *****", isDebugEnabled) @@ -465,7 +483,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void validateSDNCResp(Execution execution, String response, String method){ - def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG", " *** ValidateSDNCResponse Process*** ", isDebugLogEnabled) String msg = "" @@ -497,14 +515,14 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ throw e; } catch(Exception ex) { msg = "Exception in validateSDNCResp. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("DEBUG", msg, isDebugLogEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } logDebug(" *** Exit ValidateSDNCResp Process*** ", isDebugLogEnabled) } public void preProcessSDNCGet(Execution execution){ - def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled = execution.getVariable(DebugFlag) utils.log("DEBUG", "*** preProcessSDNCGet *** ", isDebugLogEnabled) try{ @@ -564,7 +582,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ } public void updateAaiAROrchStatus(Execution execution, String status){ - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) utils.log("DEBUG", " *** updateAaiAROrchStatus *** ", isDebugEnabled) String aaiARPath = execution.getVariable("aaiARPath") //set during query (existing AR) or create AllottedResourceUtils arUtils = new AllottedResourceUtils(this) @@ -574,7 +592,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void generateOutputs(Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** generateOutputs ***** ", isDebugEnabled) try { String sdncGetResponse = execution.getVariable("enhancedCallbackRequestData") //unescaped @@ -583,11 +601,12 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ arData = utils.removeXmlNamespaces(arData) String txca = utils.getNodeXml(arData, "tunnelxconn-assignments") + execution.setVariable("vni", utils.getNodeText1(txca, "vni")) + execution.setVariable("vgmuxBearerIP", utils.getNodeText1(txca, "vgmux_bearer_ip")) + execution.setVariable("vgmuxLanIP", utils.getNodeText1(txca, "vgmux_lan_ip")) + String ari = utils.getNodeXml(arData, "allotted-resource-identifiers") execution.setVariable("allotedResourceName", utils.getNodeText1(ari, "allotted-resource-name")) - execution.setVariable("vni", utils.getNodeText1(ari, "vni")) - execution.setVariable("vgmuxBearerIp", utils.getNodeText1(ari, "vgmux_bearer_ip")) - execution.setVariable("vgmuxLanIP", utils.getNodeText1(ari, "vgmux_lan_ip")) } catch (BpmnError e) { utils.log("DEBUG", "BPMN Error in generateOutputs ", isDebugEnabled) } catch(Exception ex) { @@ -599,7 +618,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ } public void preProcessRollback (Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** preProcessRollback ***** ", isDebugEnabled) try { @@ -620,7 +639,7 @@ public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{ } public void postProcessRollback (Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** postProcessRollback ***** ", isDebugEnabled) String msg = "" try { diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy index 142ddde6b5..ff621e5954 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoCreateAllottedResourceTXCRollback.groovy @@ -1,5 +1,21 @@ /* - * © 2016 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. + * ============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.vcpe.scripts; @@ -37,12 +53,14 @@ import static org.apache.commons.lang3.StringUtils.* */ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProcessor{ + private static final String DebugFlag = "isDebugLogEnabled" + String Prefix="DCARTXCRB_" ExceptionUtil exceptionUtil = new ExceptionUtil() public void preProcessRequest (Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessRequest *****", isDebugEnabled) execution.setVariable("prefix", Prefix) @@ -114,7 +132,7 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc // aaiARPath set during query (existing AR) public void updateAaiAROrchStatus(Execution execution, String status){ - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = null; utils.log("DEBUG", " *** updateAaiAROrchStatus ***", isDebugEnabled) AllottedResourceUtils arUtils = new AllottedResourceUtils(this) @@ -137,7 +155,7 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc public void validateSDNCResp(Execution execution, String response, String method){ - def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG", " *** ValidateSDNCResponse Process*** ", isDebugLogEnabled) String msg = "" @@ -160,24 +178,24 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc throw new BpmnError("MSOWorkflowException") } } catch (BpmnError e) { - if (e.getErrorCode() == 404) + if ("404".contentEquals(e.getErrorCode())) { msg = "SDNC rollback " + method + " returned a 404. Proceding with rollback" - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("DEBUG", msg, isDebugLogEnabled) } else { throw e; } } catch(Exception ex) { msg = "Exception in validateSDNCResp. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("DEBUG", msg, isDebugLogEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } logDebug(" *** Exit ValidateSDNCResp Process*** ", isDebugLogEnabled) } public void deleteAaiAR(Execution execution){ - def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled = execution.getVariable(DebugFlag) try{ utils.log("DEBUG", " *** deleteAaiAR *** ", isDebugLogEnabled) AllottedResourceUtils arUtils = new AllottedResourceUtils(this) @@ -198,7 +216,7 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc } public void postProcessRequest(Execution execution) { - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** postProcessRequest ***** ", isDebugEnabled) String msg = "" try { @@ -222,7 +240,7 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc } public void processRollbackException(Execution execution){ - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** processRollbackException ***** ", isDebugEnabled) try{ utils.log("DEBUG", "Caught an Exception in DoCreateAllottedResourceRollback", isDebugEnabled) @@ -241,7 +259,7 @@ public class DoCreateAllottedResourceTXCRollback extends AbstractServiceTaskProc } public void processRollbackJavaException(Execution execution){ - def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** processRollbackJavaException ***** ", isDebugEnabled) try{ execution.setVariable("rollbackData", null) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy index 9dbca8664b..bfdccc80a1 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceBRG.groovy @@ -1,5 +1,21 @@ /* - * © 2016 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. + * ============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.vcpe.scripts; @@ -41,12 +57,14 @@ import static org.apache.commons.lang3.StringUtils.* */ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ + private static final String DebugFlag = "isDebugLogEnabled" + String Prefix="DDARBRG_" ExceptionUtil exceptionUtil = new ExceptionUtil() public void preProcessRequest (Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessRequest *****", isDebugEnabled) @@ -88,7 +106,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void getAaiAR (Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** getAaiAR ***** ", isDebugEnabled) String allottedResourceId = execution.getVariable("allottedResourceId") @@ -117,7 +135,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ // aaiARPath set during query (existing AR) public void updateAaiAROrchStatus(Execution execution, String status){ - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) utils.log("DEBUG", " *** updateAaiAROrchStatus *** ", isDebugEnabled) AllottedResourceUtils arUtils = new AllottedResourceUtils(this) String aaiARPath = execution.getVariable("aaiARPath") //set during query (existing AR) @@ -127,7 +145,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ public String buildSDNCRequest(Execution execution, String action, String sdncRequestId) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** buildSDNCRequest *****", isDebugEnabled) String sdncReq = null @@ -213,7 +231,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void preProcessSDNCUnassign(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCUnassign *****", isDebugEnabled) @@ -234,7 +252,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void preProcessSDNCDelete(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCDelete *****", isDebugEnabled) @@ -255,7 +273,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void preProcessSDNCDeactivate(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCDeactivate *****", isDebugEnabled) @@ -276,7 +294,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ public void validateSDNCResp(Execution execution, String response, String method){ - def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG", " *** ValidateSDNCResponse Process*** ", isDebugLogEnabled) String msg = "" @@ -302,7 +320,7 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ if ("true".equals(execution.getVariable("failNotFound"))) { msg = "Allotted Resource Not found in SDNC" - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("DEBUG", msg, isDebugLogEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } else @@ -319,14 +337,14 @@ public class DoDeleteAllottedResourceBRG extends AbstractServiceTaskProcessor{ throw e; } catch(Exception ex) { msg = "Exception in validateSDNCResp. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("DEBUG", msg, isDebugLogEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } logDebug(" *** Exit ValidateSDNCResp Process*** ", isDebugLogEnabled) } public void deleteAaiAR(Execution execution){ - def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled = execution.getVariable(DebugFlag) try{ utils.log("DEBUG", " *** deleteAaiAR *** ", isDebugLogEnabled) AllottedResourceUtils arUtils = new AllottedResourceUtils(this) diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy index a66e88852b..1f729ac05d 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/DoDeleteAllottedResourceTXC.groovy @@ -1,5 +1,21 @@ /* - * © 2016 AT&T Intellectual Property. All rights reserved. Used under license from AT&T Intellectual Property. + * ============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.vcpe.scripts; @@ -41,12 +57,14 @@ import static org.apache.commons.lang3.StringUtils.* */ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ + private static final String DebugFlag = "isDebugLogEnabled" + String Prefix="DDARTXC_" ExceptionUtil exceptionUtil = new ExceptionUtil() public void preProcessRequest (Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessRequest *****", isDebugEnabled) @@ -88,7 +106,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void getAaiAR (Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) utils.log("DEBUG"," ***** getAaiAR ***** ", isDebugEnabled) String allottedResourceId = execution.getVariable("allottedResourceId") @@ -117,7 +135,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ // aaiARPath set during query (existing AR) public void updateAaiAROrchStatus(Execution execution, String status){ - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) utils.log("DEBUG", " *** updateAaiAROrchStatus *** ", isDebugEnabled) AllottedResourceUtils arUtils = new AllottedResourceUtils(this) String aaiARPath = execution.getVariable("aaiARPath") //set during query (existing AR) @@ -127,7 +145,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ public String buildSDNCRequest(Execution execution, String action, String sdncRequestId) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** buildSDNCRequest *****", isDebugEnabled) String sdncReq = null @@ -213,7 +231,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void preProcessSDNCUnassign(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCUnassign *****", isDebugEnabled) @@ -234,7 +252,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void preProcessSDNCDelete(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCDelete *****", isDebugEnabled) @@ -255,7 +273,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void preProcessSDNCDeactivate(Execution execution) { - def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugEnabled = execution.getVariable(DebugFlag) String msg = "" utils.log("DEBUG"," ***** preProcessSDNCDeactivate *****", isDebugEnabled) @@ -276,7 +294,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ public void validateSDNCResp(Execution execution, String response, String method){ - def isDebugLogEnabled=execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled=execution.getVariable(DebugFlag) utils.log("DEBUG", " *** ValidateSDNCResponse Process*** ", isDebugLogEnabled) String msg = "" @@ -302,7 +320,7 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ if ("true".equals(execution.getVariable("failNotFound"))) { msg = "Allotted Resource Not found in SDNC" - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("DEBUG", msg, isDebugLogEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } else @@ -319,14 +337,14 @@ public class DoDeleteAllottedResourceTXC extends AbstractServiceTaskProcessor{ throw e; } catch(Exception ex) { msg = "Exception in validateSDNCResp. " + ex.getMessage() - utils.log("DEBUG", msg, isDebugEnabled) + utils.log("DEBUG", msg, isDebugLogEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } logDebug(" *** Exit ValidateSDNCResp Process*** ", isDebugLogEnabled) } public void deleteAaiAR(Execution execution){ - def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + def isDebugLogEnabled = execution.getVariable(DebugFlag) try{ utils.log("DEBUG", " *** deleteAaiAR *** ", isDebugLogEnabled) AllottedResourceUtils arUtils = new AllottedResourceUtils(this) |