From: Benjamin, Max (mb388a) Date: Wed, 3 Apr 2019 03:04:18 +0000 (-0400) Subject: do not error out when there is no config X-Git-Tag: 1.4.1~106^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F35%2F84035%2F1;p=so.git do not error out when there is no config fixed rollback execution path creation in bb tasks do not error out when there is no config Change-Id: I3e2ce1e203271deebc45e1f14a884c940ecd5d25 Issue-ID: SO-1733 Signed-off-by: Benjamin, Max (mb388a) --- 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 242f125bde..359f8ea164 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 @@ -26,6 +26,8 @@ import java.util.List; import java.util.Optional; import java.util.UUID; +import javax.persistence.EntityNotFoundException; + import org.camunda.bpm.engine.delegate.DelegateExecution; import org.onap.aai.domain.yang.Vnfc; import org.onap.so.bpmn.common.workflow.context.WorkflowCallbackResponse; @@ -296,14 +298,15 @@ public class WorkflowActionBBTasks { } } - int flowSize = rollbackFlows.size(); String handlingCode = (String) execution.getVariable("handlingCode"); + List rollbackFlowsFiltered = new ArrayList<>(); + rollbackFlowsFiltered.addAll(rollbackFlows); if(handlingCode.equals("RollbackToAssigned") || handlingCode.equals("RollbackToCreated")){ - for(int i = 0; i flowsToExecute = new ArrayList(); + ExecuteBuildingBlock ebb1 = new ExecuteBuildingBlock(); + BuildingBlock bb1 = new BuildingBlock(); + bb1.setBpmnFlowName("AssignVfModuleBB"); + ebb1.setBuildingBlock(bb1); + flowsToExecute.add(ebb1); + ExecuteBuildingBlock ebb2 = new ExecuteBuildingBlock(); + BuildingBlock bb2 = new BuildingBlock(); + bb2.setBpmnFlowName("CreateVfModuleBB"); + ebb2.setBuildingBlock(bb2); + flowsToExecute.add(ebb2); + ExecuteBuildingBlock ebb3 = new ExecuteBuildingBlock(); + BuildingBlock bb3 = new BuildingBlock(); + bb3.setBpmnFlowName("ActivateVfModuleBB"); + ebb3.setBuildingBlock(bb3); + flowsToExecute.add(ebb3); + + execution.setVariable("flowsToExecute", flowsToExecute); + execution.setVariable("gCurrentSequence", 3); + + workflowActionBBTasks.rollbackExecutionPath(execution); + List ebbs = (List) execution.getVariable("flowsToExecute"); + assertEquals("DeactivateVfModuleBB",ebbs.get(0).getBuildingBlock().getBpmnFlowName()); + assertEquals(0,execution.getVariable("gCurrentSequence")); + assertEquals(1,ebbs.size()); + } + @Test public void checkRetryStatusTest(){ String reqId = "reqId123";