From aced60c11508e1267580492b95372f0b088e2ad9 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Sat, 29 May 2021 06:48:46 -0400 Subject: Enable WorkflowActionBB to skip last building block WorkflowActionBB does not take into account flowmanipulators such as SkipCDSBuildingBlockListener, which increment the current index of building blocks to execute. In the case where ControllerExecutionBB is the last building block and should be skipped, the index would be incremented beyond bounds and cause exception. WorkflowActionBB needs to check if the flow has been completed before it tries to execute the next building block. Issue-ID: SO-3678 Change-Id: I635c12a568c3b98031cbeb37ef521663d96b852b Signed-off-by: Jozsef Csongvai --- .../common/listener/flowmanipulator/FlowManipulatorListenerRunner.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bpmn/MSOCommonBPMN/src') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java index 054cc378ef..c6d92cc9ab 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java @@ -60,6 +60,9 @@ public class FlowManipulatorListenerRunner extends ListenerRunner { int sequenceBeforeFlowManipulator; do { sequenceBeforeFlowManipulator = execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); + if (sequenceBeforeFlowManipulator >= flowsToExecute.size()) { + break; + } ExecuteBuildingBlock currentBB = flowsToExecute.get(execution.getCurrentSequence()); List filtered = filterListeners(flowManipulators, (item -> item.shouldRunFor(currentBB.getBuildingBlock().getBpmnFlowName(), -- cgit 1.2.3-korg