aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main/java
diff options
context:
space:
mode:
authorBonkur, Venkat <venkat.bonkur@att.com>2020-06-04 17:20:37 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-06-04 17:20:40 -0400
commit6bf6e8513cf347e0ee4d55a7f54ac21a1b0ee0f6 (patch)
treea1a300a03099a2cca63d0809b32d990f85fe5a7d /bpmn/so-bpmn-tasks/src/main/java
parentf239be089f523a016cf52f723638c060f899978f (diff)
Add ChangeModelVnfBB and
Add ChangeModelVnfBB and ChangeModelServiceInstanceBB as part of fallout for vfmodule replace flow Update to execute the ChangeModelVnfBB and ChangeModelServiceInstanceBB flows for fallout in vfmodule replace flow Update the logic to the ChangeBB list Issue-ID: SO-2976 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: Id50d7ecd2abdd18178fbe2566c247e0c57b54353
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main/java')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
index 0ddafa0b44..9d68b5a3f0 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
@@ -74,6 +74,8 @@ public class WorkflowActionBBTasks {
private static final String COMPLETED = "completed";
private static final String HANDLINGCODE = "handlingCode";
private static final String ROLLBACKTOCREATED = "RollbackToCreated";
+ private static final String REPLACEINSTANCE = "replaceInstance";
+ private static final String VFMODULE = "VfModule";
protected String maxRetries = "mso.rainyDay.maxRetries";
private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBTasks.class);
@@ -286,12 +288,23 @@ public class WorkflowActionBBTasks {
* working on.
*/
public void rollbackExecutionPath(DelegateExecution execution) {
+ final String action = (String) execution.getVariable(G_ACTION);
+ final String resourceName = (String) execution.getVariable("resourceName");
if (!(boolean) execution.getVariable("isRollback")) {
List<ExecuteBuildingBlock> flowsToExecute =
(List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
+
+ List<ExecuteBuildingBlock> flowsToExecuteChangeBBs = new ArrayList();
+ for (int i = 0; i < flowsToExecute.size(); i++) {
+ if (flowsToExecute.get(i).getBuildingBlock().getBpmnFlowName().startsWith("Change")) {
+ flowsToExecuteChangeBBs.add(flowsToExecute.get(i));
+ }
+ }
+
List<ExecuteBuildingBlock> rollbackFlows = new ArrayList();
int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
int listSize = flowsToExecute.size();
+
for (int i = listSize - 1; i >= 0; i--) {
if (i > currentSequence - 1) {
flowsToExecute.remove(i);
@@ -340,6 +353,18 @@ public class WorkflowActionBBTasks {
}
}
+ List<ExecuteBuildingBlock> rollbackFlowsFilteredNonChangeBBs = new ArrayList();
+ if (action.equals(REPLACEINSTANCE) && resourceName.equals(VFMODULE)) {
+ for (int i = 0; i < rollbackFlowsFiltered.size(); i++) {
+ if (!rollbackFlowsFiltered.get(i).getBuildingBlock().getBpmnFlowName().startsWith("Change")) {
+ rollbackFlowsFilteredNonChangeBBs.add(rollbackFlowsFiltered.get(i));
+ }
+ }
+ rollbackFlowsFiltered.clear();
+ rollbackFlowsFiltered.addAll(flowsToExecuteChangeBBs);
+ rollbackFlowsFiltered.addAll(rollbackFlowsFilteredNonChangeBBs);
+ }
+
workflowActionBBFailure.updateRequestErrorStatusMessage(execution);
if (rollbackFlows.isEmpty())
execution.setVariable("isRollbackNeeded", false);