aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main
diff options
context:
space:
mode:
authorGamboa, Gilbert <gilbert.g.gamboa@att.com>2019-07-05 10:30:58 -0400
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-07-05 10:31:04 -0400
commitcc805b184620525115c88c1a52ddfde55c73e15b (patch)
tree419e6d3573b0860d2aa18d0b462e310a2d17bef9 /bpmn/MSOCommonBPMN/src/main
parent0e2cda138f35ee6a7a8a54c29a6c4edf07d51745 (diff)
mso will support new requeststate values
Support new request status - ROLLED_BACK, ROLLED_BACK_TO_ASSIGNED, ROLLED_BACK_TO_CREATED, and ABORTED. Support new request status - ROLLED_BACK, ROLLED_BACK_TO_ASSIGNED, ROLLED_BACK_TO_CREATED, and ABORTED. Added default FAILED request status in case rollback is not needed. Variable rollbackTargetState needs to be returned to WorkflowAction flow Variable rollbackTargetState needs to in to ExecuteBuildingBlock as well. Add new RequestDb migration file to expand infra_active_requests column request_status to 25 bytes to fit new request states. Change-Id: I0da2f8013001a28dcc20f64eb9455e4cfd3dd197 Issue-ID: SO-2093 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java14
1 files changed, 14 insertions, 0 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 ed31e1d079..fd2054c3d0 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
@@ -30,6 +30,7 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock;
import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey;
+import org.onap.so.constants.Status;
import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
import org.onap.so.db.catalog.client.CatalogDbClient;
import org.onap.so.db.request.beans.InfraActiveRequests;
@@ -47,6 +48,7 @@ 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";
@Autowired
private CatalogDbClient catalogDbClient;
@@ -167,6 +169,18 @@ public class ExecuteBuildingBlockRainyDay {
if (handlingCode.equals("RollbackToAssigned") && !aLaCarte) {
handlingCode = "Rollback";
}
+ if (handlingCode.startsWith("Rollback")) {
+ String targetState = "";
+ if (handlingCode.equalsIgnoreCase("RollbackToAssigned")) {
+ targetState = Status.ROLLED_BACK_TO_ASSIGNED.toString();
+ } else if (handlingCode.equalsIgnoreCase("RollbackToCreated")) {
+ targetState = Status.ROLLED_BACK_TO_CREATED.toString();
+ } else {
+ targetState = Status.ROLLED_BACK.toString();
+ }
+ execution.setVariable(ROLLBACK_TARGET_STATE, targetState);
+ logger.debug("Rollback target state is: {}", targetState);
+ }
}
logger.debug("RainyDayHandler Status Code is: {}", handlingCode);
execution.setVariable(HANDLING_CODE, handlingCode);