summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/java/org
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-05-10 16:43:19 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-10 16:43:19 +0000
commit2627001834084af2e31a6c8c49503919a114b9c3 (patch)
treecb93cef41cf0b405dc0625a52d749fbeee393602 /bpmn/MSOCommonBPMN/src/main/java/org
parent28a0ce73a022a5ccecadae6b3172beb15e3f46ab (diff)
parentc22110ebcc4df14891b0f3af3739a5a3fb4d51ef (diff)
Merge "Update Rainy day handling to be more robust"
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java/org')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java35
1 files changed, 14 insertions, 21 deletions
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 c8e296d5ac..0a7a75c89b 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
@@ -82,7 +82,6 @@ public class ExecuteBuildingBlockRainyDay {
boolean aLaCarte = (boolean) execution.getVariable("aLaCarte");
boolean suppressRollback = (boolean) execution.getVariable("suppressRollback");
String handlingCode = "";
-
WorkflowException workflowException = (WorkflowException) execution.getVariable("WorkflowException");
try {
// Extract error data to be returned to WorkflowAction
@@ -97,6 +96,9 @@ public class ExecuteBuildingBlockRainyDay {
try {
serviceType = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0)
.getModelInfoServiceInstance().getServiceType();
+ if (serviceType == null || serviceType.isEmpty()) {
+ serviceType = ASTERISK;
+ }
} catch (Exception ex) {
// keep default serviceType value
}
@@ -118,6 +120,7 @@ public class ExecuteBuildingBlockRainyDay {
} catch (Exception ex) {
// keep default errorCode value
}
+
try {
errorCode = "" + (String) execution.getVariable("WorkflowExceptionCode");
} catch (Exception ex) {
@@ -131,29 +134,19 @@ public class ExecuteBuildingBlockRainyDay {
// keep default workStep value
}
- RainyDayHandlerStatus rainyDayHandlerStatus;
- rainyDayHandlerStatus = catalogDbClient
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(bbName,
- serviceType, vnfType, errorCode, workStep);
- if (rainyDayHandlerStatus == null) {
- rainyDayHandlerStatus = catalogDbClient
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(bbName,
- ASTERISK, ASTERISK, errorCode, ASTERISK);
+ String errorMessage = ASTERISK;
+ try {
+ errorMessage = workflowException.getErrorMessage();
+ } catch (Exception ex) {
+ // keep default workStep value
}
+ RainyDayHandlerStatus rainyDayHandlerStatus;
+ rainyDayHandlerStatus = catalogDbClient.getRainyDayHandlerStatus(bbName, serviceType, vnfType,
+ errorCode, workStep, errorMessage);
+
if (rainyDayHandlerStatus == null) {
- rainyDayHandlerStatus = catalogDbClient
- .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(bbName,
- ASTERISK, ASTERISK, ASTERISK, ASTERISK);
- if (rainyDayHandlerStatus == null) {
- handlingCode = "Abort";
- } else {
- if (primaryPolicy) {
- handlingCode = rainyDayHandlerStatus.getPolicy();
- } else {
- handlingCode = rainyDayHandlerStatus.getSecondaryPolicy();
- }
- }
+ handlingCode = "Abort";
} else {
if (primaryPolicy) {
handlingCode = rainyDayHandlerStatus.getPolicy();