summaryrefslogtreecommitdiffstats
path: root/bpmn
diff options
context:
space:
mode:
authorastanislawska <agata.stanislawska@nokia.com>2020-08-12 10:00:28 +0200
committerAgata Stanislawska <agata.stanislawska@nokia.com>2020-08-12 14:09:10 +0000
commitb6d8476958e5bcf80dd0559a2ed7445aa721b265 (patch)
treeab2491e62a1fa374cccc3fdd2f3c1ffadf426cfc /bpmn
parent1ad701732a7e89b8c40a0bd648cdcb7bf18e2ef5 (diff)
Raise an error when PNF in service model but not in userParams
Issue-ID: SO-2785 Signed-off-by: astanislawska <agata.stanislawska@nokia.com> Change-Id: I55ef6aac83eff1c33f09ce0de380330e4ccccce4 Signed-off-by: astanislawska <agata.stanislawska@nokia.com>
Diffstat (limited to 'bpmn')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java10
1 files changed, 10 insertions, 0 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 44a99b88c5..75d3ddf2e6 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
@@ -759,6 +759,7 @@ public class WorkflowAction {
throws JsonProcessingException, VrfBondingServiceException {
String modelUUID = sIRequest.getRequestDetails().getModelInfo().getModelVersionId();
org.onap.so.db.catalog.beans.Service service = catalogDbClient.getServiceByID(modelUUID);
+
if (service == null) {
buildAndThrowException(execution, "Could not find the service model in catalog db.");
} else {
@@ -767,6 +768,7 @@ public class WorkflowAction {
bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.vpnBinding);
RelatedInstance relatedLocalNetwork =
bbInputSetupUtils.getRelatedInstanceByType(sIRequest.getRequestDetails(), ModelType.network);
+
if (relatedVpnBinding != null && relatedLocalNetwork != null) {
traverseVrfConfiguration(aaiResourceIds, resourceList, service, relatedVpnBinding, relatedLocalNetwork);
} else {
@@ -850,6 +852,10 @@ public class WorkflowAction {
buildAndThrowException(execution,
"Cannot orchestrate Service-Macro-Create without user params with a vnf. Please update ASDC model for new macro orchestration support or add service_recipe records to route to old macro flows");
}
+ if (isPnfCustomizationsInTheService(service)) {
+ buildAndThrowException(execution,
+ "Cannot orchestrate Service-Macro-Create without user params with a pnf. Please update ASDC model for new macro orchestration support or add service_recipe records to route to old macro flows");
+ }
List<CollectionResourceCustomization> customizations = service.getCollectionResourceCustomizations();
if (customizations.isEmpty()) {
logger.debug("No Collections found. CollectionResourceCustomization list is empty.");
@@ -967,6 +973,10 @@ public class WorkflowAction {
return !(service.getVnfCustomizations() == null || service.getVnfCustomizations().isEmpty());
}
+ private boolean isPnfCustomizationsInTheService(org.onap.so.db.catalog.beans.Service service) {
+ return !(service.getPnfCustomizations() == null || service.getPnfCustomizations().isEmpty());
+ }
+
protected void traverseAAIService(DelegateExecution execution, List<Resource> resourceList, String resourceId,
List<Pair<WorkflowType, String>> aaiResourceIds) {
try {