added in exception handling if auditResult is null 67/93967/1
authorKalkere Ramesh, Sharan <sharan.kalkere.ramesh@att.com>
Tue, 20 Aug 2019 13:45:01 +0000 (09:45 -0400)
committerBenjamin, Max (mb388a) <mb388a@att.com>
Tue, 20 Aug 2019 13:45:02 +0000 (09:45 -0400)
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) <mb388a@att.com>
Change-Id: I6a83c7fe120e02e808470dbc9e7e431e0b62f4f4

bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java

index 100887d..729f5c9 100644 (file)
@@ -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");
         }
     }