From 4efbb108a4c4668bf1c08018123e77fb32117051 Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan" Date: Tue, 20 Aug 2019 09:45:01 -0400 Subject: added in exception handling if auditResult is null added in exception handling if auditResult is null maven process format the file that is not formatted fix formsatting again because it failed last time Issue-ID: SO-2242 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I6a83c7fe120e02e808470dbc9e7e431e0b62f4f4 --- .../java/org/onap/so/client/exception/ExceptionBuilder.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bpmn') 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 100887dbbc..729f5c95c4 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 @@ -244,9 +244,9 @@ public class ExceptionBuilder { public void processAuditException(DelegateExecutionImpl execution, boolean flowShouldContinue) { logger.debug("Processing Audit Results"); String auditListString = (String) execution.getVariable("auditInventoryResult"); + String processKey = getProcessKey(execution.getDelegateExecution()); if (auditListString != null) { StringBuilder errorMessage = new StringBuilder(); - String processKey = getProcessKey(execution.getDelegateExecution()); try { ExtractPojosForBB extractPojosForBB = getExtractPojosForBB(); VfModule module = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); @@ -302,7 +302,13 @@ public class ExceptionBuilder { } } else { - logger.debug("Unable to process audit results due to auditInventoryResult being null"); + String errorMessage = "Unable to process audit results due to auditInventoryResult being null"; + WorkflowException exception = new WorkflowException(processKey, 400, errorMessage, TargetEntity.SO); + execution.setVariable("WorkflowException", exception); + execution.setVariable("WorkflowExceptionErrorMessage", errorMessage); + logger.info("Outgoing WorkflowException is {}", exception); + logger.info("Throwing MSOWorkflowException"); + throw new BpmnError("AAIInventoryFailure"); } } -- cgit 1.2.3-korg