From 89c1ed09024b96ad67d7c656b6dfd2d76cbcfbc0 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Mon, 4 Mar 2019 09:48:00 -0500 Subject: put error message in execution put error message in execution before checking rollback Change-Id: I41bc89f589a260aece0c837d83218794ec1ec72e Issue-ID: SO-1591 Signed-off-by: Benjamin, Max (mb388a) --- .../tasks/ExecuteBuildingBlockRainyDay.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 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 054198fd9a..aa992d6153 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 @@ -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, -- cgit 1.2.3-korg