put error message in execution 29/79629/1
authorBenjamin, Max (mb388a) <mb388a@us.att.com>
Mon, 4 Mar 2019 14:48:00 +0000 (09:48 -0500)
committerBenjamin, Max (mb388a) <mb388a@us.att.com>
Mon, 4 Mar 2019 14:48:16 +0000 (09:48 -0500)
put error message in execution before checking rollback

Change-Id: I41bc89f589a260aece0c837d83218794ec1ec72e
Issue-ID: SO-1591
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java

index 054198f..aa992d6 100644 (file)
@@ -83,6 +83,15 @@ public class ExecuteBuildingBlockRainyDay {
                        boolean aLaCarte = (boolean) execution.getVariable("aLaCarte");
                        boolean suppressRollback = (boolean) execution.getVariable("suppressRollback");
                        String handlingCode = "";
+                       
+                       WorkflowException workflowException = (WorkflowException) execution.getVariable("WorkflowException");
+                       try {
+                               // Extract error data to be returned to WorkflowAction
+                               execution.setVariable("WorkflowExceptionErrorMessage", workflowException.getErrorMessage());
+                       } catch (Exception e) {
+                               logger.error("No WorkflowException Found",e);
+                       }
+                       
                        if (suppressRollback) {
                                handlingCode = "Abort";
                        } else {
@@ -103,7 +112,7 @@ public class ExecuteBuildingBlockRainyDay {
                                } catch (Exception ex) {
                                        // keep default vnfType value
                                }
-                               WorkflowException workflowException = (WorkflowException) execution.getVariable("WorkflowException");
+                               
                                String errorCode = ASTERISK;
                                try {
                                        errorCode = "" + workflowException.getErrorCode();
@@ -123,12 +132,6 @@ public class ExecuteBuildingBlockRainyDay {
                                        // keep default workStep value
                                }
                                
-                               try {
-                                       // Extract error data to be returned to WorkflowAction
-                                       execution.setVariable("WorkflowExceptionErrorMessage", workflowException.getErrorMessage());
-                               } catch (Exception e) {
-                                       logger.error("No WorkflowException Found",e);
-                               }
                                RainyDayHandlerStatus rainyDayHandlerStatus;
                                rainyDayHandlerStatus = catalogDbClient
                                                .getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(bbName,