summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/java
diff options
context:
space:
mode:
authorJozsef Csongvai <jozsef.csongvai@bell.ca>2021-05-29 06:48:46 -0400
committerJozsef Csongvai <jozsef.csongvai@bell.ca>2021-08-04 12:52:23 +0000
commitaced60c11508e1267580492b95372f0b088e2ad9 (patch)
tree6df98a73334ed4bb8a96888c448a20be01efd8bb /bpmn/MSOCommonBPMN/src/main/java
parent872613eafe80034cca612bd93294286b3dbed4b1 (diff)
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 <jozsef.csongvai@bell.ca>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java3
1 files changed, 3 insertions, 0 deletions
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<PreFlowManipulator> filtered = filterListeners(flowManipulators,
(item -> item.shouldRunFor(currentBB.getBuildingBlock().getBpmnFlowName(),