summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-01-03 22:50:11 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-01-04 09:15:22 -0500
commitf49313bb87e0dc2ee20f5621c6858d119e5f8f83 (patch)
treeba1902c3f1ee2f5aa54f75ebe533d58d07755ba5 /bpmn/MSOCommonBPMN/src/main
parenta5bb70becba912f172615b873c4921a2a88dcf3e (diff)
Bugfixes for December 2018
Changed the way that the cidr is constructed in network utils. added in the if statement to check if selflink already exists removed execution line that was not needed in pull added service instance id to workflowResourceIds for virtualLinkKey network flows wrote test for updating request to complete in db workflow action directly updates db instead of using mso complete process Increase max timeout for SDNO Health Checks dmaap. Added execution variable and corrected type and way data is retrieved to fix defect fixed retry status message in request db for #/5 updated workflowActionBBTasks for flow status message updated flow status to failed on a workflowaction fail Removed slashes and fixed rollbackStatusMessage Updated requestStatus logic for adding status messages Added junit test to validate casue of a defect and cleaned up code and logging added end timestamp to request db on complete request fixed l3Network update of orchestation status in DoUpdateNetworkInstance groovy as well fixed update of l3network orchestration status Add explicit resetting of heatStackId in A&AI to DeleteVfModule and DeleteVolumeGroup BBs. Preserve heatStackId setting in the copiedVfModule when updating the VF Module in A&AI. added functionality to skip rollback based on flag Update snapshot version for logging, add headers fixed optional of error in retrieveErrorMessage method Set heatStackId to null if we want to remove it in A&AI. added in a warn logger statement to keep track of field map network technology from l3network instead of model info for network adapter object mapper Force heatStackId value to empty on an attempt to set it to null on update updated common pom to use aai schema version 1.4.1 removed handle sync error from SDNCHandler bpmn flow Change-Id: I1bd7aa55b06d4e439000b216165c9daafeacc9a4 Issue-ID: SO-1361 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/NetworkUtils.groovy2
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy9
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java107
3 files changed, 61 insertions, 57 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/NetworkUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/NetworkUtils.groovy
index c1199aefd7..23231df6be 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/NetworkUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/NetworkUtils.groovy
@@ -477,7 +477,7 @@ class NetworkUtils {
networkStartAddress = subnet.getNetworkStartAddress()
}
if (element == "cidr-mask") {
- xmlBuild += "<cidr>"+networkStartAddress+"/"+var+"</cidr>"
+ xmlBuild += "<cidr>"+networkStartAddress+"/"+ subnet.getCidrMask() +"</cidr>"
}
}
if (element == "dhcp-enabled") {
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
index 8aff0f715d..78af8768f9 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy
@@ -365,16 +365,15 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor {
// TODO: Should deprecate use of processKey+Response variable for the response. Will use "WorkflowResponse" instead.
execution.setVariable("WorkflowResponse", callback)
+ callback = utils.removeXmlPreamble(callback)
+
Node root = new XmlParser().parseText(callback)
if (root.name().endsWith('Exception')) {
vnfAdapterWorkflowException(execution, callback)
}
} catch (Exception e) {
- e.printStackTrace()
- callback = callback == null || String.valueOf(callback).isEmpty() ? "NONE" : callback
- String msg = "Received error from VnfAdapter: " + callback
- msoLogger.debug(getProcessKey(execution) + ': ' + msg)
- exceptionUtil.buildWorkflowException(execution, 7020, msg)
+ msoLogger.debug("Error encountered within VnfAdapterRest ProcessCallback method", e)
+ exceptionUtil.buildAndThrowWorkflowException(execution, 7020, "Error encountered within VnfAdapterRest ProcessCallback method")
}
}
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
index ba9426d88a..6c2df13c61 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
@@ -76,43 +76,54 @@ public class ExecuteBuildingBlockRainyDay {
Map<ResourceKey, String> lookupKeyMap = (Map<ResourceKey, String>) execution.getVariable("lookupKeyMap");
String serviceType = ASTERISK;
boolean aLaCarte = (boolean) execution.getVariable("aLaCarte");
- try {
- serviceType = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0).getModelInfoServiceInstance().getServiceType();
- } catch (Exception ex) {
- // keep default serviceType value
- }
- String vnfType = ASTERISK;
- try {
- for(GenericVnf vnf : gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0).getVnfs()) {
- if(vnf.getVnfId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID))) {
- vnfType = vnf.getVnfType();
+ boolean suppressRollback = (boolean) execution.getVariable("suppressRollback");
+ String handlingCode = "";
+ if(suppressRollback){
+ handlingCode = "Abort";
+ }else{
+ try {
+ serviceType = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0).getModelInfoServiceInstance().getServiceType();
+ } catch (Exception ex) {
+ // keep default serviceType value
+ }
+ String vnfType = ASTERISK;
+ try {
+ for(GenericVnf vnf : gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0).getVnfs()) {
+ if(vnf.getVnfId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID))) {
+ vnfType = vnf.getVnfType();
+ }
}
+ } catch (Exception ex) {
+ // keep default vnfType value
}
- } catch (Exception ex) {
- // keep default vnfType value
- }
- WorkflowException workflowException = (WorkflowException) execution.getVariable("WorkflowException");
- String errorCode = ASTERISK;
- try {
- errorCode = "" + workflowException.getErrorCode();
- } catch (Exception ex) {
- // keep default errorCode value
- }
- String workStep = ASTERISK;
- try {
- workStep = workflowException.getWorkStep();
- } catch (Exception ex) {
- // keep default workStep value
- }
- //Extract error data to be returned to WorkflowAction
- execution.setVariable("WorkflowExceptionErrorMessage", workflowException.getErrorMessage());
- RainyDayHandlerStatus rainyDayHandlerStatus;
- String handlingCode = "";
- rainyDayHandlerStatus = catalogDbClient.getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(bbName,serviceType,vnfType,errorCode,workStep);
- if(rainyDayHandlerStatus==null){
- rainyDayHandlerStatus = catalogDbClient.getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(bbName,ASTERISK,ASTERISK,ASTERISK,ASTERISK);
+ WorkflowException workflowException = (WorkflowException) execution.getVariable("WorkflowException");
+ String errorCode = ASTERISK;
+ try {
+ errorCode = "" + workflowException.getErrorCode();
+ } catch (Exception ex) {
+ // keep default errorCode value
+ }
+ String workStep = ASTERISK;
+ try {
+ workStep = workflowException.getWorkStep();
+ } catch (Exception ex) {
+ // keep default workStep value
+ }
+ //Extract error data to be returned to WorkflowAction
+ execution.setVariable("WorkflowExceptionErrorMessage", workflowException.getErrorMessage());
+ RainyDayHandlerStatus rainyDayHandlerStatus;
+ rainyDayHandlerStatus = catalogDbClient.getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(bbName,serviceType,vnfType,errorCode,workStep);
if(rainyDayHandlerStatus==null){
- handlingCode = "Abort";
+ rainyDayHandlerStatus = catalogDbClient.getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(bbName,ASTERISK,ASTERISK,ASTERISK,ASTERISK);
+ if(rainyDayHandlerStatus==null){
+ handlingCode = "Abort";
+ }else{
+ if(primaryPolicy){
+ handlingCode = rainyDayHandlerStatus.getPolicy();
+ }else{
+ handlingCode = rainyDayHandlerStatus.getSecondaryPolicy();
+ }
+ }
}else{
if(primaryPolicy){
handlingCode = rainyDayHandlerStatus.getPolicy();
@@ -120,26 +131,20 @@ public class ExecuteBuildingBlockRainyDay {
handlingCode = rainyDayHandlerStatus.getSecondaryPolicy();
}
}
- }else{
- if(primaryPolicy){
- handlingCode = rainyDayHandlerStatus.getPolicy();
- }else{
- handlingCode = rainyDayHandlerStatus.getSecondaryPolicy();
+ if(!primaryPolicy){
+ try{
+ InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
+ request.setRetryStatusMessage("Retries have been exhausted.");
+ requestDbclient.updateInfraActiveRequests(request);
+ } catch(Exception ex){
+ msoLogger.debug(ex.toString());
+ msoLogger.error("Failed to update Request Db Infra Active Requests with Retry Status");
+ }
}
- }
- if(!primaryPolicy){
- try{
- InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId);
- request.setRetryStatusMessage("Retries have been exhausted.");
- requestDbclient.updateInfraActiveRequests(request);
- } catch(Exception ex){
- msoLogger.debug(ex.toString());
- msoLogger.error("Failed to update Request Db Infra Active Requests with Retry Status");
+ if(handlingCode.equals("RollbackToAssigned")&&!aLaCarte){
+ handlingCode = "Rollback";
}
}
- if(handlingCode.equals("RollbackToAssigned")&&!aLaCarte){
- handlingCode = "Rollback";
- }
msoLogger.debug("RainyDayHandler Status Code is: " + handlingCode);
execution.setVariable(HANDLING_CODE, handlingCode);
} catch (Exception e) {