diff options
author | Max Benjamin <max.benjamin@att.com> | 2021-03-08 20:13:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-03-08 20:13:26 +0000 |
commit | 9bdda0dda7d7b641012f41dbaa48276f4516f579 (patch) | |
tree | 31ddd78fb4a95650e4a0526e97c6ca26e4b8602d | |
parent | 3c0b8888188d9d1a263472fa7450c060d5dd5767 (diff) | |
parent | cd24b2b9acd1223463dbc0e2d17489ef89e39d4e (diff) |
Merge "improve error handling in postProcessingExecuteBB"
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java | 29 |
1 files changed, 18 insertions, 11 deletions
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 ccefc772c3..ec2ca74fa7 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 @@ -420,18 +420,25 @@ public class WorkflowActionBBTasks { } public void postProcessingExecuteBB(DelegateExecution execution) { - List<ExecuteBuildingBlock> flowsToExecute = - (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); - String handlingCode = (String) execution.getVariable(HANDLINGCODE); - final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE); - int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); - ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1); - String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName(); - if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte && "Success".equalsIgnoreCase(handlingCode)) { - postProcessingExecuteBBActivateVfModule(execution, ebb, flowsToExecute); - } + try { + List<ExecuteBuildingBlock> flowsToExecute = + (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); + String handlingCode = (String) execution.getVariable(HANDLINGCODE); + final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE); + int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); + logger.debug("Current Sequence: {}", currentSequence); + ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1); + String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName(); + if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte + && "Success".equalsIgnoreCase(handlingCode)) { + postProcessingExecuteBBActivateVfModule(execution, ebb, flowsToExecute); + } - flowManipulatorListenerRunner.postModifyFlows(flowsToExecute, new DelegateExecutionImpl(execution)); + flowManipulatorListenerRunner.postModifyFlows(flowsToExecute, new DelegateExecutionImpl(execution)); + } catch (Exception ex) { + logger.error("Exception in postProcessingExecuteBB", ex); + workflowAction.buildAndThrowException(execution, "Failed to post process Execute BB"); + } } protected void postProcessingExecuteBBActivateVfModule(DelegateExecution execution, ExecuteBuildingBlock ebb, |