From c1cf7c9c229ca4f4cbb66e448c074889a828d1df Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Sat, 24 Nov 2018 19:03:28 +0530 Subject: Fix parsing for pnf-name Fix parsing for pnf-name. Change-Id: I2d846725b4aafda12587dfb5d7992b1accc02aa8 Issue-ID: SO-689 Signed-off-by: subhash kumar singh --- .../workflow/service/ServicePluginFactory.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java index e753f79ebd..95b826f331 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/service/ServicePluginFactory.java @@ -436,14 +436,19 @@ public class ServicePluginFactory { Map keys = uri.getURIKeys(); String uriString = uri.build().toString(); - AAIResourceUri parent = AAIUriFactory.createResourceUri(AAIObjectType.PNF, keys.get("pnf-name")); - - AAIResultWrapper wrapper = client.get(parent); - Optional optRelationships = wrapper.getRelationships(); - if (optRelationships.isPresent()) { - Relationships relationships = optRelationships.get(); - - return !relationships.getRelatedAAIUris(AAIObjectType.EXT_AAI_NETWORK).isEmpty(); + + if (uriString != null) { + // get the pnfname + String[] token = uriString.split("/"); + AAIResourceUri parent = AAIUriFactory.createResourceUri(AAIObjectType.PNF, token[4]); + + AAIResultWrapper wrapper = client.get(parent); + Optional optRelationships = wrapper.getRelationships(); + if (optRelationships.isPresent()) { + Relationships relationships = optRelationships.get(); + + return !relationships.getRelatedAAIUris(AAIObjectType.EXT_AAI_NETWORK).isEmpty(); + } } return false; -- cgit 1.2.3-korg