aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main/java
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2020-10-23 16:56:31 +0000
committerGerrit Code Review <gerrit@onap.org>2020-10-23 16:56:31 +0000
commita8aaf6fdd4b45a1c497743030d25724b96c39518 (patch)
tree01c3e5a30b49dfd820cf87a9c14befd326b82e85 /bpmn/so-bpmn-tasks/src/main/java
parent68a78b3427721686cc8d283ae4e9ae5831f4f051 (diff)
parenteeaf0330f835b237812bbbf26ca5bba3c44f4671 (diff)
Merge "PNF service instantiation using building blocks fails"
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main/java')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java7
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java19
2 files changed, 20 insertions, 6 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 43a85051be..0cb8fb2ccd 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
@@ -103,7 +103,6 @@ public class WorkflowActionBBTasks {
(List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
execution.setVariable("MacroRollback", false);
- flowManipulatorListenerRunner.modifyFlows(flowsToExecute, new DelegateExecutionImpl(execution));
int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence);
@@ -114,6 +113,12 @@ public class WorkflowActionBBTasks {
execution.setVariable(G_CURRENT_SEQUENCE, currentSequence);
}
+ public void runFlowManipulator(DelegateExecution execution) {
+ List<ExecuteBuildingBlock> flowsToExecute =
+ (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
+ flowManipulatorListenerRunner.modifyFlows(flowsToExecute, new DelegateExecutionImpl(execution));
+ }
+
public void updateFlowStatistics(DelegateExecution execution) {
try {
int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
index 2119ced951..42aab4c16e 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/listeners/SkipCDSBuildingBlockListener.java
@@ -52,6 +52,8 @@ public class SkipCDSBuildingBlockListener implements FlowManipulator {
private Set<String> pnfActions =
new HashSet<>(Arrays.asList("config-assign", "config-deploy", "PnfConfigAssign", "PnfConfigDeploy"));
+ private static final String COMPLETED = "completed";
+
@Override
public boolean shouldRunFor(String currentBBName, boolean isFirst, BuildingBlockExecution execution) {
@@ -70,6 +72,7 @@ public class SkipCDSBuildingBlockListener implements FlowManipulator {
public void run(List<ExecuteBuildingBlock> flowsToExecute, ExecuteBuildingBlock currentBB,
BuildingBlockExecution execution) {
String customizationUUID = currentBB.getBuildingBlock().getKey();
+ int flowsToExecuteSize = flowsToExecute.size();
if (Strings.isEmpty(customizationUUID)) {
return;
@@ -85,7 +88,7 @@ public class SkipCDSBuildingBlockListener implements FlowManipulator {
vnfResourceCustomizations);
if (null != vrc) {
boolean skipConfigVNF = vrc.isSkipPostInstConf();
- currentSequenceSkipCheck(execution, skipConfigVNF);
+ currentSequenceSkipCheck(execution, skipConfigVNF, flowsToExecuteSize);
}
}
@@ -97,7 +100,7 @@ public class SkipCDSBuildingBlockListener implements FlowManipulator {
if (null != vfc) {
boolean skipVfModule = vfc.isSkipPostInstConf();
- currentSequenceSkipCheck(execution, skipVfModule);
+ currentSequenceSkipCheck(execution, skipVfModule, flowsToExecuteSize);
}
} else if (currentBB.getBuildingBlock().getBpmnScope().equalsIgnoreCase("PNF")
@@ -107,7 +110,7 @@ public class SkipCDSBuildingBlockListener implements FlowManipulator {
if (null != pnfResourceCustomization) {
boolean skipConfigPNF = pnfResourceCustomization.isSkipPostInstConf();
- currentSequenceSkipCheck(execution, skipConfigPNF);
+ currentSequenceSkipCheck(execution, skipConfigPNF, flowsToExecuteSize);
}
}
}
@@ -118,10 +121,16 @@ public class SkipCDSBuildingBlockListener implements FlowManipulator {
}
- private void currentSequenceSkipCheck(BuildingBlockExecution execution, boolean skipModule) {
+ private void currentSequenceSkipCheck(BuildingBlockExecution execution, boolean skipModule,
+ int flowsToExecuteSize) {
if (skipModule) {
int currentSequence = execution.getVariable(BBConstants.G_CURRENT_SEQUENCE);
- execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, currentSequence + 1);
+ currentSequence++;
+ if (currentSequence >= flowsToExecuteSize) {
+ execution.setVariable(COMPLETED, true);
+ } else {
+ execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, currentSequence);
+ }
}
}