Enable WorkflowActionBB to skip last building block
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / common / listener / flowmanipulator / FlowManipulatorListenerRunner.java
index 054cc37..c6d92cc 100644 (file)
@@ -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(),