aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main/java
diff options
context:
space:
mode:
authorLukasz Muszkieta <lukasz.muszkieta@nokia.com>2020-06-30 13:20:41 +0000
committerGerrit Code Review <gerrit@onap.org>2020-06-30 13:20:41 +0000
commitba43a2374eb02cc391e4aa11306272a54f96c5e5 (patch)
treec6ca51ccf5cadd9d03d6d4ad86cf9ee96cf4ab78 /bpmn/so-bpmn-tasks/src/main/java
parent77821f31ad7ae00ee91a956c139843a8079144f9 (diff)
parent5f47e57c8096910d23ab8621600f47add5c99ac2 (diff)
Merge "WorkflowAction, traverseNetworkCollection refactoring stage 4"
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/WorkflowAction.java54
1 files changed, 33 insertions, 21 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
index a057fe0102..09c7a661e0 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java
@@ -820,27 +820,8 @@ public class WorkflowAction {
private void traverseNetworkCollectionResourceCustomization(List<Resource> resourceList,
CollectionResourceCustomization collectionResourceCustomization) {
- if (collectionResourceCustomization == null) {
- logger.debug("No Network Collection Customization found");
- return;
- }
- resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION,
- collectionResourceCustomization.getModelCustomizationUUID(), false));
- logger.debug("Found a network collection");
- if (collectionResourceCustomization.getCollectionResource() == null) {
- logger.debug("No Network Collection found. collectionResource is null");
- return;
- }
- if (collectionResourceCustomization.getCollectionResource().getInstanceGroup() == null) {
- logger.debug("No Instance Group found for network collection.");
+ if (collectionResourceCustomizationShouldNotBeProcessed(resourceList, collectionResourceCustomization))
return;
- }
- String toscaNodeType =
- collectionResourceCustomization.getCollectionResource().getInstanceGroup().getToscaNodeType();
- if (!toscaNodeTypeHasNetworkCollection(toscaNodeType)) {
- logger.debug("Instance Group tosca node type does not contain NetworkCollection: {}", toscaNodeType);
- return;
- }
int minNetworks = 0;
org.onap.so.db.catalog.beans.InstanceGroup instanceGroup =
collectionResourceCustomization.getCollectionResource().getInstanceGroup();
@@ -854,7 +835,7 @@ public class WorkflowAction {
break;
}
}
- if (collectionInstCust != null && collectionInstCust.getSubInterfaceNetworkQuantity() != null) {
+ if (interfaceNetworkQuantityIsAvailableInCollection(collectionInstCust)) {
minNetworks = collectionInstCust.getSubInterfaceNetworkQuantity();
}
}
@@ -878,6 +859,37 @@ public class WorkflowAction {
}
}
+ private boolean collectionResourceCustomizationShouldNotBeProcessed(List<Resource> resourceList,
+ CollectionResourceCustomization collectionResourceCustomization) {
+ if (collectionResourceCustomization == null) {
+ logger.debug("No Network Collection Customization found");
+ return true;
+ }
+ resourceList.add(new Resource(WorkflowType.NETWORKCOLLECTION,
+ collectionResourceCustomization.getModelCustomizationUUID(), false));
+ logger.debug("Found a network collection");
+ if (collectionResourceCustomization.getCollectionResource() == null) {
+ logger.debug("No Network Collection found. collectionResource is null");
+ return true;
+ }
+ if (collectionResourceCustomization.getCollectionResource().getInstanceGroup() == null) {
+ logger.debug("No Instance Group found for network collection.");
+ return true;
+ }
+ String toscaNodeType =
+ collectionResourceCustomization.getCollectionResource().getInstanceGroup().getToscaNodeType();
+ if (!toscaNodeTypeHasNetworkCollection(toscaNodeType)) {
+ logger.debug("Instance Group tosca node type does not contain NetworkCollection: {}", toscaNodeType);
+ return true;
+ }
+ return false;
+ }
+
+ private boolean interfaceNetworkQuantityIsAvailableInCollection(
+ CollectionResourceInstanceGroupCustomization collectionInstCust) {
+ return collectionInstCust != null && collectionInstCust.getSubInterfaceNetworkQuantity() != null;
+ }
+
private boolean toscaNodeTypeHasNetworkCollection(String toscaNodeType) {
return toscaNodeType != null && toscaNodeType.contains(NETWORKCOLLECTION);
}