From 3f4981493008ccf8eeb23f2aac5c2fcf40a0be49 Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan (sk720x)" Date: Wed, 26 Aug 2020 04:36:07 -0400 Subject: Bpmn to cnf adapter implementation BPMN changes related to CNF Adapter Change-Id: I4c984b9508076381bb7b3d159955fb6bf724eca8 Issue-ID: SO-3199 Signed-off-by: Kalkere Ramesh, Sharan --- .../generalobjects/RequestContext.java | 10 ++++++++++ .../servicedecomposition/tasks/BBInputSetup.java | 15 +++++++++++++-- .../tasks/BBInputSetupParameter.java | 21 +++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src/main/java') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java index 0193469d93..12abec0b77 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/generalobjects/RequestContext.java @@ -57,6 +57,16 @@ public class RequestContext implements Serializable { private List> configurationParameters = new ArrayList<>(); @JsonProperty("application-id") private String applicationId; + @JsonProperty("is-helm") + private Boolean isHelm; + + public Boolean getIsHelm() { + return isHelm; + } + + public void setIsHelm(Boolean isHelm) { + this.isHelm = isHelm; + } public String getServiceURI() { return serviceURI; diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index 009686d0fc..989bba0a6e 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -193,6 +193,12 @@ public class BBInputSetup implements JavaDelegate { execution.setVariable(GBB_INPUT_VAR_NAME, outputBB); execution.setVariable(LOOKUP_KEY_MAP_VAR_NAME, lookupKeyMap); + if (outputBB.getRequestContext().getIsHelm()) { + execution.setVariable("isHelm", true); + } else { + execution.setVariable("isHelm", false); + } + BuildingBlockExecution gBuildingBlockExecution = new DelegateExecutionImpl(execution); execution.setVariable("gBuildingBlockExecution", gBuildingBlockExecution); execution.setVariable("RetryCount", 1); @@ -431,7 +437,8 @@ public class BBInputSetup implements JavaDelegate { protected void mapCatalogInstanceGroup(InstanceGroup instanceGroup, ModelInfo modelInfo, Service service) { // @TODO: this will populate the instanceGroup model info. - // Dependent on MSO-5821 653458 US - MSO - Enhance Catalog DB Schema & Adapter to support VNF Groups + // Dependent on MSO-5821 653458 US - MSO - Enhance Catalog DB Schema & Adapter + // to support VNF Groups } protected void populateConfiguration(BBInputSetupParameter parameter) { @@ -613,6 +620,10 @@ public class BBInputSetup implements JavaDelegate { parameter.getServiceModel().getCurrentService(), vnfModelCustomizationUUID); } } + if (vfModule.getModelInfoVfModule() != null && vfModule.getModelInfoVfModule().getModelName() != null + && vfModule.getModelInfoVfModule().getModelName().contains("helm")) { + parameter.setIsHelm(true); + } } else { logger.debug("Related VNF instance Id not found: {}", parameter.getLookupKeyMap().get(ResourceKey.GENERIC_VNF_ID)); @@ -1018,7 +1029,6 @@ public class BBInputSetup implements JavaDelegate { if (requestDetails.getOwningEntity() != null) owningEntity = mapperLayer.mapRequestOwningEntity(requestDetails.getOwningEntity()); - Service service = bbInputSetupUtils.getCatalogServiceByModelUUID(requestDetails.getModelInfo().getModelVersionId()); if (service == null) { @@ -1094,6 +1104,7 @@ public class BBInputSetup implements JavaDelegate { RequestContext requestContext = mapperLayer.mapRequestContext(parameter.getRequestDetails()); requestContext.setAction(parameter.getRequestAction()); requestContext.setMsoRequestId(parameter.getExecuteBB().getRequestId()); + requestContext.setIsHelm(parameter.getIsHelm()); org.onap.aai.domain.yang.CloudRegion aaiCloudRegion = bbInputSetupUtils.getCloudRegion(parameter.getRequestDetails().getCloudConfiguration()); CloudRegion cloudRegion = diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java index 36ac0969ee..1290f2aeef 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupParameter.java @@ -45,6 +45,7 @@ public class BBInputSetupParameter { private String applicationId; private boolean isReplace; private ServiceModel serviceModel; + private boolean isHelm; private BBInputSetupParameter(Builder builder) { this.cloudConfiguration = builder.cloudConfiguration; @@ -74,6 +75,7 @@ public class BBInputSetupParameter { this.applicationId = builder.applicationId; this.isReplace = builder.isReplace; this.serviceModel = builder.serviceModel; + this.isHelm = builder.isHelm; } @@ -331,6 +333,15 @@ public class BBInputSetupParameter { this.serviceModel = serviceModel; } + protected boolean getIsHelm() { + return isHelm; + } + + + protected void setIsHelm(boolean isHelm) { + this.isHelm = isHelm; + } + public static class Builder { private CloudConfiguration cloudConfiguration; private ConfigurationResourceKeys configurationResourceKeys; @@ -359,6 +370,7 @@ public class BBInputSetupParameter { private String applicationId; private boolean isReplace; private ServiceModel serviceModel; + private boolean isHelm; public Builder setCloudConfiguration(CloudConfiguration cloudConfiguration) { this.cloudConfiguration = cloudConfiguration; @@ -495,6 +507,15 @@ public class BBInputSetupParameter { return this; } + protected boolean getIsHelm() { + return isHelm; + } + + + protected void setIsHelm(boolean isHelm) { + this.isHelm = isHelm; + } + public BBInputSetupParameter build() { return new BBInputSetupParameter(this); } -- cgit 1.2.3-korg