From 947249a450e6c849710b750867a9b92300ff384f Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Sun, 28 Apr 2019 03:10:37 +0530 Subject: Add parsing for support of new CCVPN model Update the resource_list logic to create the resource as per new CCVPN model. e.g. new model UUI request to create the service with this input // [ // { VFB1 : [GrpA1, GrA2, GrB1]}, // { VFB2 : [GrpA1, GrB1]}, // { VFA1 : [GrpC1]} // ] should be converted to // [ // { VFA1 : [GrpA1, GrA2, GrB1]}, // { VFA2 : [GrpA1, GrB1]}, // { VFB1 : [GrpC1]} // ] as per resource ordering. Change-Id: I79a30d5080d2551eb7e1944cc4f25d5332d22d4f Issue-ID: SO-1393 Signed-off-by: subhash kumar singh --- .../so/bpmn/infrastructure/scripts/DoCreateResources.groovy | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/groovy') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy index a7d453d56d..973d8a156c 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy @@ -22,6 +22,7 @@ package org.onap.so.bpmn.infrastructure.scripts +import org.onap.so.bpmn.common.resource.InstanceResourceList import org.onap.so.bpmn.common.scripts.CatalogDbUtilsFactory import org.onap.so.bpmn.core.domain.GroupResource import org.onap.so.bpmn.infrastructure.properties.BPMNProperties @@ -88,6 +89,16 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ logger.trace("Exit preProcessRequest ") } + // this method will convert resource list to instance_resource_list + void prepareInstanceResourceList(DelegateExecution execution) { + + String uuiRequest = execution.getVariable("uuiRequest") + List sequencedResourceList = execution.getVariable("sequencedResourceList") + List instanceResourceList = InstanceResourceList.getInstanceResourceList(sequencedResourceList, uuiRequest) + + execution.setVariable("instanceResourceList", instanceResourceList) + } + public void sequenceResoure(DelegateExecution execution) { logger.trace("Start sequenceResoure Process ") -- cgit 1.2.3-korg