aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/java
diff options
context:
space:
mode:
authorKuleshov, Elena <evn@att.com>2020-01-24 16:33:39 -0500
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-01-24 16:33:40 -0500
commit2eb23f4ac862f700f0abf6f2dc5b9fa662ec9c60 (patch)
tree4f4e5ad0aa89961c4b51eaf8fd32bc9f340b8c93 /bpmn/MSOCommonBPMN/src/main/java
parent48cb43adc20ac10fa6f22c0e03fe2b6775d45b87 (diff)
add manual handling to rainy day handling for bbs
Initial Manual Handling addition to Rainy Day BB handling. Reenable task API, add task variable setup. TaskTimeout will come from the configuration settings. Update the base path for the APIH manual tasks junit. Additional JUNIT tests for manual handling Add Manual as a primary policy for Change Management BBs. Error handling changes and robot tests for manual handling. Correct failure data retrieval when serviceSubscription is unavailable. Correct failure data retrieval when serviceSubscription is unavailable. Keep WorkflowException when manual pause gets invoked; improved error reporting. Issue-ID: SO-2616 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I98a84c1a489bb7b24b68e567f604aeb074fd7bf9
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java38
1 files changed, 29 insertions, 9 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 ae7addcc57..99767b0405 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
@@ -49,6 +49,9 @@ public class ExecuteBuildingBlockRainyDay {
private static final Logger logger = LoggerFactory.getLogger(ExecuteBuildingBlockRainyDay.class);
public static final String HANDLING_CODE = "handlingCode";
public static final String ROLLBACK_TARGET_STATE = "rollbackTargetState";
+ public static final String RAINY_DAY_SERVICE_TYPE = "rainyDayServiceType";
+ public static final String RAINY_DAY_VNF_TYPE = "rainyDayVnfType";
+ public static final String RAINY_DAY_VNF_NAME = "rainyDayVnfName";
@Autowired
private CatalogDbClient catalogDbClient;
@@ -97,8 +100,10 @@ public class ExecuteBuildingBlockRainyDay {
handlingCode = "Abort";
} else {
try {
- serviceType = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0)
- .getModelInfoServiceInstance().getServiceType();
+ if (gBBInput.getCustomer().getServiceSubscription() != null) {
+ serviceType = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0)
+ .getModelInfoServiceInstance().getServiceType();
+ }
if (serviceType == null || serviceType.isEmpty()) {
serviceType = ASTERISK;
}
@@ -106,19 +111,32 @@ public class ExecuteBuildingBlockRainyDay {
// keep default serviceType value
logger.error("Exception in serviceType retrieval", ex);
}
+ execution.setVariable(RAINY_DAY_SERVICE_TYPE, serviceType);
String vnfType = ASTERISK;
+ String vnfName = 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();
+ if (gBBInput.getCustomer().getServiceSubscription() != null) {
+ for (GenericVnf vnf : gBBInput.getCustomer().getServiceSubscription().getServiceInstances()
+ .get(0).getVnfs()) {
+ if (vnf.getVnfId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID))) {
+ vnfType = vnf.getVnfType();
+ vnfName = vnf.getVnfName();
+ }
+ }
+ } else {
+ for (GenericVnf vnf : gBBInput.getServiceInstance().getVnfs()) {
+ if (vnf.getVnfId().equalsIgnoreCase(lookupKeyMap.get(ResourceKey.GENERIC_VNF_ID))) {
+ vnfType = vnf.getVnfType();
+ vnfName = vnf.getVnfName();
+ }
}
}
} catch (Exception ex) {
// keep default vnfType value
logger.error("Exception in vnfType retrieval", ex);
}
-
+ execution.setVariable(RAINY_DAY_VNF_TYPE, vnfType);
+ execution.setVariable(RAINY_DAY_VNF_NAME, vnfName);
String errorCode = ASTERISK;
if (workflowException != null) {
errorCode = "" + workflowException.getErrorCode();
@@ -151,8 +169,10 @@ public class ExecuteBuildingBlockRainyDay {
String serviceRole = ASTERISK;
try {
- serviceRole = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0)
- .getModelInfoServiceInstance().getServiceRole();
+ if (gBBInput.getCustomer().getServiceSubscription() != null) {
+ serviceRole = gBBInput.getCustomer().getServiceSubscription().getServiceInstances().get(0)
+ .getModelInfoServiceInstance().getServiceRole();
+ }
if (serviceRole == null || serviceRole.isEmpty()) {
serviceRole = ASTERISK;
}