diff options
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main')
4 files changed, 25 insertions, 15 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java index e809ecd0ae..206942fcb1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/FlowCompletionTasks.java @@ -20,27 +20,14 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks; -import java.util.ArrayList; -import java.util.List; -import org.camunda.bpm.engine.delegate.BpmnError; -import org.camunda.bpm.engine.delegate.DelegateExecution; import org.onap.so.bpmn.common.BuildingBlockExecution; -import org.onap.so.bpmn.common.workflow.context.WorkflowCallbackResponse; -import org.onap.so.bpmn.common.workflow.context.WorkflowContextHolder; import org.onap.so.bpmn.core.WorkflowException; -import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock; -import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; -import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.client.RequestsDbClient; -import org.onap.so.serviceinstancebeans.RequestReferences; -import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; @Component public class FlowCompletionTasks { @@ -50,7 +37,9 @@ public class FlowCompletionTasks { @Autowired private RequestsDbClient requestDbclient; + public void updateRequestDbStatus(BuildingBlockExecution execution) { + try { String requestId = execution.getGeneralBuildingBlock().getRequestContext().getMsoRequestId(); InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 1f07166b60..11c6455474 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -197,7 +197,9 @@ public class WorkflowAction { suppressRollback = false; } execution.setVariable("suppressRollback", suppressRollback); + boolean isResume = false; if (isUriResume(uri)) { + isResume = true; logger.debug("replacing URI {}", uri); uri = bbInputSetupUtils.loadOriginalInfraActiveRequestById(requestId).getRequestUrl(); logger.debug("for RESUME with original value {}", uri); @@ -225,6 +227,12 @@ public class WorkflowAction { if (flowsToExecute == null) { buildAndThrowException(execution, "Could not resume Macro flow. Error loading execution path."); } + } else if (aLaCarte && isResume) { + flowsToExecute = bbInputSetupUtils.loadOriginalFlowExecutionPath(requestId); + if (flowsToExecute == null) { + buildAndThrowException(execution, + "Could not resume request with request Id: " + requestId + ". No flowsToExecute was found"); + } } else { if (aLaCarte) { if (orchFlows == null || orchFlows.isEmpty()) { @@ -387,7 +395,7 @@ public class WorkflowAction { flowNames.add(ebb.getBuildingBlock().getBpmnFlowName()); } - if (!aLaCarte) { + if (!isResume) { bbInputSetupUtils.persistFlowExecutionPath(requestId, flowsToExecute); } execution.setVariable("flowNames", flowNames); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java index be3e06c9ea..56cd9fd70f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java @@ -39,6 +39,8 @@ import org.springframework.stereotype.Component; @Component public class WorkflowActionBBFailure { + private static final String DEACTIVATE_FABRIC_CONFIGURATION_FLOW = "DeactivateFabricConfigurationBB"; + private static final String UNASSIGN_FABRIC_CONFIGURATION_FLOW = "UnassignFabricConfigurationBB"; private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBFailure.class); public static final String ROLLBACK_TARGET_STATE = "rollbackTargetState"; @Autowired @@ -96,6 +98,16 @@ public class WorkflowActionBBFailure { String rollbackTargetState = (String) execution.getVariable(ROLLBACK_TARGET_STATE); request.setRequestStatus(rollbackTargetState); } else if (isRollbackFailure) { + if (ebb != null && ebb.getBuildingBlock() != null && ebb.getBuildingBlock().getBpmnFlowName() != null) { + String flowName = ebb.getBuildingBlock().getBpmnFlowName(); + if (DEACTIVATE_FABRIC_CONFIGURATION_FLOW.equalsIgnoreCase(flowName) + || UNASSIGN_FABRIC_CONFIGURATION_FLOW.equalsIgnoreCase(flowName)) { + String statusMessage = String.format( + "%s Warning: The vf-module is active but configuration was not removed completely for one or more VMs.", + request.getStatusMessage()); + request.setStatusMessage(statusMessage); + } + } Optional<String> rollbackErrorMsgOp = retrieveErrorMessage(execution); if (rollbackErrorMsgOp.isPresent()) { rollbackErrorMsg = rollbackErrorMsgOp.get(); 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 f5bbcf5bc0..39aa9d6c41 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 @@ -310,7 +310,8 @@ public class WorkflowActionBBTasks { rollbackFlowsFiltered.addAll(rollbackFlows); if ("RollbackToAssigned".equals(handlingCode) || ROLLBACKTOCREATED.equals(handlingCode)) { for (int i = 0; i < rollbackFlows.size(); i++) { - if (rollbackFlows.get(i).getBuildingBlock().getBpmnFlowName().contains("Unassign")) { + if (rollbackFlows.get(i).getBuildingBlock().getBpmnFlowName().contains("Unassign") && !rollbackFlows + .get(i).getBuildingBlock().getBpmnFlowName().contains("FabricConfiguration")) { rollbackFlowsFiltered.remove(rollbackFlows.get(i)); } else if (rollbackFlows.get(i).getBuildingBlock().getBpmnFlowName().contains("Delete") && ROLLBACKTOCREATED.equals(handlingCode)) { |