diff options
author | Steve Smokowski <ss835w@att.com> | 2020-01-30 19:08:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-01-30 19:08:51 +0000 |
commit | 98fce84d19c8aa1eb11fc24a8dddb5b0deb38d7a (patch) | |
tree | e3e443dfb3cb788bc39d9523f296acf25104dd0f /bpmn | |
parent | b06b1e355c7f4d4d9c74c88227f67c61841a2b0d (diff) | |
parent | 0a70df3984208a80060080f3cba20da7779765bb (diff) |
Merge "Increased lock time on add graph data task and"
Diffstat (limited to 'bpmn')
2 files changed, 22 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 99767b0405..5a52e3a49d 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 @@ -25,12 +25,14 @@ package org.onap.so.bpmn.servicedecomposition.tasks; import java.util.Map; import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.onap.logging.filter.base.ONAPComponents; import org.onap.logging.filter.base.ONAPComponentsList; import org.onap.so.bpmn.core.WorkflowException; 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.client.exception.ExceptionBuilder; import org.onap.so.constants.Status; import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus; import org.onap.so.db.catalog.client.CatalogDbClient; @@ -54,6 +56,8 @@ public class ExecuteBuildingBlockRainyDay { public static final String RAINY_DAY_VNF_NAME = "rainyDayVnfName"; @Autowired + private ExceptionBuilder exceptionBuilder; + @Autowired private CatalogDbClient catalogDbClient; @Autowired private RequestsDbClient requestDbclient; @@ -242,9 +246,15 @@ public class ExecuteBuildingBlockRainyDay { try { String requestId = (String) execution.getVariable("mso-request-id"); WorkflowException exception = (WorkflowException) execution.getVariable("WorkflowException"); + if (exception == null) { + String errorMessage = (String) execution.getVariable("WorkflowExceptionMessage"); + exception = + exceptionBuilder.buildWorkflowException(execution, 500, errorMessage, ONAPComponents.EXTERNAL); + } ONAPComponentsList extSystemErrorSource = exception.getExtSystemErrorSource(); InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); Boolean isRollbackFailure = (Boolean) execution.getVariable("isRollback"); + if (isRollbackFailure == null) { isRollbackFailure = false; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java index 903280ce05..0a6ce05a06 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java @@ -231,6 +231,18 @@ public class ExceptionBuilder { throw new BpmnError("MSOWorkflowException"); } + public WorkflowException buildWorkflowException(DelegateExecution execution, int errorCode, String errorMessage, + ONAPComponentsList extSystemErrorSource) { + String processKey = getProcessKey(execution); + logger.info("Building a WorkflowException for Subflow"); + + WorkflowException exception = new WorkflowException(processKey, errorCode, errorMessage, extSystemErrorSource); + execution.setVariable("WorkflowException", exception); + execution.setVariable("WorkflowExceptionErrorMessage", errorMessage); + logger.info("Outgoing WorkflowException is {}", exception); + return exception; + } + public void buildAndThrowWorkflowException(DelegateExecution execution, String errorCode, String errorMessage) { execution.setVariable("WorkflowExceptionErrorMessage", errorMessage); throw new BpmnError(errorCode, errorMessage); |