diff options
author | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2019-04-27 12:31:21 +0530 |
---|---|---|
committer | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2019-04-27 12:51:57 +0530 |
commit | bb0a782bbec2ba9166804237b117ce0c70a1aa76 (patch) | |
tree | 66f63748f5eb13a4b5878514e02da9d2b8a5b3b7 /bpmn/so-bpmn-infrastructure-common | |
parent | e98c9cbc978ceb3bcb4a8f946bfec4cbd7b22511 (diff) |
Enhance resource sequence to add group
Enhance resource sequence to add group.
Change-Id: I9f7ad2a437cd66ba3b8382f3937b0b04752a184a
Issue-ID: SO-1393
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common')
-rw-r--r-- | bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy | 19 |
1 files changed, 18 insertions, 1 deletions
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 98def612de..a7d453d56d 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 @@ -23,6 +23,7 @@ package org.onap.so.bpmn.infrastructure.scripts import org.onap.so.bpmn.common.scripts.CatalogDbUtilsFactory +import org.onap.so.bpmn.core.domain.GroupResource import org.onap.so.bpmn.infrastructure.properties.BPMNProperties import org.apache.commons.lang3.StringUtils import org.apache.http.HttpResponse @@ -117,6 +118,22 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ if (StringUtils.containsIgnoreCase(resource.getModelInfo().getModelName(), resourceType)) { sequencedResourceList.add(resource) + // if resource type is vnfResource then check for groups also + // Did not use continue because if same model type is used twice + // then we would like to add it twice for processing + // e.g. S{ V1{G1, G2, G1}} --> S{ V1{G1, G1, G2}} + if (resource instanceof VnfResource) { + if (resource.getGroups() != null) { + String[] grpSequence = resource.getGroupOrder().split(",") + for (String grpType in grpSequence) { + for (GroupResource gResource in resource.getGroups()) { + if (StringUtils.containsIgnoreCase(gResource.getModelInfo().getModelName(), grpType)) { + sequencedResourceList.add(gResource) + } + } + } + } + } if (resource instanceof NetworkResource) { networkResourceList.add(resource) } @@ -126,7 +143,7 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ } else { //define sequenced resource list, we deploy vf first and then network and then ar - //this is defaule sequence + //this is default sequence List<VnfResource> vnfResourceList = new ArrayList<VnfResource>() List<AllottedResource> arResourceList = new ArrayList<AllottedResource>() |