From 42158c7400de39923d3eb8418402ed38770e5a7b Mon Sep 17 00:00:00 2001 From: "Boslet, Cory" Date: Wed, 18 Nov 2020 15:38:07 -0500 Subject: Catch exceptions during the select BB method for Catch exceptions during the select BB method for more info Removed unused import added by mistake Issue-ID: SO-3392 Signed-off-by: Benjamin, Max (mb388a) Change-Id: Ieb63a10708d9f023f4f3ae1e27ffafb28b8858e1 --- .../workflow/tasks/WorkflowActionBBTasks.java | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'bpmn') diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index 217b3a848e..df82142f39 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -99,22 +99,26 @@ public class WorkflowActionBBTasks { private RequestsDbListenerRunner requestsDbListener; public void selectBB(DelegateExecution execution) { - List flowsToExecute = - (List) execution.getVariable("flowsToExecute"); - execution.setVariable("MacroRollback", false); try { - flowManipulatorListenerRunner.modifyFlows(flowsToExecute, new DelegateExecutionImpl(execution)); - } catch (NullPointerException ex) { - workflowAction.buildAndThrowException(execution, "Error in FlowManipulator Modify Flows", ex); - } - int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); + List flowsToExecute = + (List) execution.getVariable("flowsToExecute"); + execution.setVariable("MacroRollback", false); + try { + flowManipulatorListenerRunner.modifyFlows(flowsToExecute, new DelegateExecutionImpl(execution)); + } catch (NullPointerException ex) { + workflowAction.buildAndThrowException(execution, "Error in FlowManipulator Modify Flows", ex); + } + int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); - ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence); + ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence); - execution.setVariable("buildingBlock", ebb); - currentSequence++; - execution.setVariable(COMPLETED, currentSequence >= flowsToExecute.size()); - execution.setVariable(G_CURRENT_SEQUENCE, currentSequence); + execution.setVariable("buildingBlock", ebb); + currentSequence++; + execution.setVariable(COMPLETED, currentSequence >= flowsToExecute.size()); + execution.setVariable(G_CURRENT_SEQUENCE, currentSequence); + } catch (Exception e) { + workflowAction.buildAndThrowException(execution, "Internal Error occured during selectBB", e); + } } public void updateFlowStatistics(DelegateExecution execution) { -- cgit 1.2.3-korg