From a577f75663e5c8ccddee54337328425c5b2361d2 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max" Date: Mon, 16 Mar 2020 12:01:26 -0400 Subject: split single and plural graph inventory uris split single and plural graph inventory uris updated all object references in MSO using graph inventory plurals corrected unit test stubbings added additional unit tests correct interfaces to return plural after related-to modified the way http aware uris are built reformated interfaces to no longer duplicate methods corrected issues with identity of unbuilt uris removed AAIUri references from groovy files fixed clone behavior on Uri objects Issue-ID: SO-2743 Signed-off-by: Benjamin, Max (mb388a) Change-Id: I37aa2a13dcbf010b6c82ad73af3be5db5d9bd673 --- .../org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src/main/groovy') diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy index b43a153acb..c0124cfd50 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy @@ -22,10 +22,10 @@ package org.onap.so.bpmn.common.scripts -import org.onap.so.logger.LoggingAnchor import org.apache.commons.lang.StringUtils import org.camunda.bpm.engine.delegate.DelegateExecution import org.onap.aai.domain.yang.GenericVnf +import org.onap.aai.domain.yang.GenericVnfs import org.onap.so.bpmn.core.RollbackData import org.onap.so.client.aai.AAIObjectPlurals import org.onap.so.client.aai.AAIObjectType @@ -34,6 +34,7 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory import org.onap.so.client.graphinventory.entities.uri.Depth import org.onap.so.db.catalog.beans.OrchestrationStatus import org.onap.logging.filter.base.ErrorCode +import org.onap.so.logger.LoggingAnchor import org.onap.so.logger.MessageEnum import org.slf4j.Logger import org.slf4j.LoggerFactory @@ -151,15 +152,13 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ AAIResourceUri uri def vnfId = execution.getVariable("CAAIVfMod_vnfId") def vnfName = execution.getVariable("CAAIVfMod_vnfName") + Optional genericVnfOp if (vnfId == null || vnfId.isEmpty()) { - uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF) - uri.queryParam("vnf-name", vnfName) + genericVnfOp = getAAIClient().getFirst(GenericVnfs.class, GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName).depth(Depth.ONE)) } else { - uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId) + genericVnfOp = getAAIClient().get(GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)) } - uri.depth(Depth.ONE) try { - Optional genericVnfOp = getAAIClient().get(GenericVnf.class, uri) if(genericVnfOp.isPresent()){ execution.setVariable("CAAIVfMod_queryGenericVnfResponseCode", 200) execution.setVariable("CAAIVfMod_queryGenericVnfResponse", genericVnfOp.get()) -- cgit 1.2.3-korg