modify getting openecomp.db.endpoint config codes
Change-Id: Idaa55084f5ecb0dd3636c232cebc14fa5f064405
Issue-ID: SO-791
Signed-off-by: Yulian Han <elaine.hanyulian@huawei.com>
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
index f640aa7..30e6c45 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ActivateSDNCNetworkResource.groovy
@@ -31,6 +31,7 @@
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.logger.MsoLogger
/**
@@ -162,7 +163,7 @@
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
index a0f0e27..afd67c3 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Create3rdONAPE2EServiceInstance.groovy
@@ -29,13 +29,13 @@
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.ExternalAPIUtil
-import org.onap.so.bpmn.common.scripts.AaiUtil
import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.aai.domain.yang.SpPartner
import org.onap.so.bpmn.common.recipe.ResourceInput
import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.AbstractBuilder
import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.AAIResourcesClient
@@ -53,7 +53,7 @@
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import org.apache.commons.codec.binary.Base64
-import org.springframework.web.util.UriUtils
+
/**
* This groovy class supports the <class>Create3rdONAPE2EServiceInstance.bpmn</class> process.
@@ -144,12 +144,10 @@
execution.setVariable("mso-request-id", requestId)
execution.setVariable("mso-service-instance-id", resourceInputObj.getServiceInstanceId())
- } catch (BpmnError e) {
- throw e
} catch (Exception ex){
String msg = "Exception in checkSPPartnerInfo " + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -187,7 +185,7 @@
} catch (Exception ex){
String msg = "Exception in checkLocallCall " + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -259,12 +257,10 @@
execution.setVariable(Prefix + "ResourceModelCustomizationUuid", resourceModelCustomizationUuid)
msoLogger.info("resourceModelCustomizationUuid:" + resourceModelCustomizationUuid)
- } catch (BpmnError e) {
- throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -424,13 +420,14 @@
public void doCreateE2ESIin3rdONAP(DelegateExecution execution) {
msoLogger.info(" ***** Started doCreateE2ESIin3rdONAP *****")
-
+ try {
String extAPIPath = execution.getVariable("ExternalAPIURL")
String payload = execution.getVariable(Prefix + "Payload")
msoLogger.debug("doCreateE2ESIin3rdONAP externalAPIURL is: " + extAPIPath)
msoLogger.debug("doCreateE2ESIin3rdONAP payload is: " + payload)
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil()
+ execution.setVariable("ServiceOrderId", "")
Response response = externalAPIUtil.executeExternalAPIPostCall(execution, extAPIPath, payload)
@@ -446,7 +443,7 @@
//Process Response
if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
- //200 OK 201 CREATED 202 ACCEPTED
+ //200 OK 201 CREATED 202 ACCEPTED
{
msoLogger.debug("Post ServiceOrder Received a Good Response")
String serviceOrderId = responseObj.get("id")
@@ -458,6 +455,9 @@
msoLogger.error("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
// exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Post ServiceOrder Received a bad response from 3rdONAP External API")
}
+ }catch(Exception e){
+ msoLogger.error("doCreateE2ESIin3rdONAP exception:" + e.getMessage())
+ }
msoLogger.info("Exit " + doCreateE2ESIin3rdONAP)
}
@@ -465,10 +465,11 @@
public void getE2ESIProgressin3rdONAP(DelegateExecution execution) {
msoLogger.info(" ***** Started getE2ESIProgressin3rdONAP *****")
+ try {
String extAPIPath = execution.getVariable("ExternalAPIURL")
extAPIPath += "/" + execution.getVariable("ServiceOrderId")
- utils.log("DEBUG", "getE2ESIProgressin3rdONAP create externalAPIURL is: " + extAPIPath, isDebugEnabled)
+ msoLogger.debug("getE2ESIProgressin3rdONAP create externalAPIURL is: " + extAPIPath)
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil()
@@ -547,9 +548,15 @@
execution.setVariable("progress", 100)
execution.setVariable("status", "error")
execution.setVariable("statusDescription", "Get Create ServiceOrder Received a bad response")
- exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Create ServiceOrder Received a bad response from 3rdONAP External API")
+// exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Create ServiceOrder Received a bad response from 3rdONAP External API")
}
+ }catch(Exception e){
+ execution.setVariable("progress", 100)
+ execution.setVariable("status", "error")
+ execution.setVariable("statusDescription", "Get Create ServiceOrder Exception")
+ msoLogger.error("getE2ESIProgressin3rdONAP exception:" + e.getMessage())
+ }
msoLogger.info("Exit " + getE2ESIProgressin3rdONAP)
}
@@ -566,7 +573,7 @@
public void saveSPPartnerInAAI(DelegateExecution execution) {
msoLogger.info(" ***** Started saveSPPartnerInAAI *****")
-
+ try {
String sppartnerId = execution.getVariable(Prefix + "SppartnerServiceId")
String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
String callSource = execution.getVariable(Prefix + "CallSource")
@@ -591,12 +598,16 @@
AAIResourceUri siUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId)
client.connect(uri, siUri)
-
+ } catch (Exception ex) {
+ String msg = "Exception in Create3rdONAPE2EServiceInstance.saveSPPartnerInAAI. " + ex.getMessage()
+ msoLogger.info(msg)
+// throw new BpmnError("MSOWorkflowException")
+ }
msoLogger.info("Exit " + saveSPPartnerInAAI)
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
@@ -624,7 +635,7 @@
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
msoLogger.debug(" ***** Exit sendSyncResopnse *****")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy
index 8fc9ce0..ff9a119 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateDeviceResource.groovy
@@ -31,7 +31,10 @@
import org.onap.so.bpmn.common.recipe.ResourceInput;
import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
import org.onap.so.bpmn.core.WorkflowException
+import org.onap.so.bpmn.core.domain.ModelInfo
+import org.onap.so.bpmn.core.domain.VnfResource
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.AbstractBuilder
import org.onap.so.logger.MsoLogger
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
@@ -41,9 +44,8 @@
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
-import org.apache.commons.codec.binary.Base64;
-import org.springframework.web.util.UriUtils
-import org.onap.so.bpmn.common.scripts.AaiUtil
+import org.apache.commons.codec.binary.Base64
+
/**
* This groovy class supports the <class>CreateDeviceResource.bpmn</class> process.
@@ -124,12 +126,10 @@
execution.setVariable(Prefix + "serviceInstanceId", resourceInputObj.getServiceInstanceId())
execution.setVariable("mso-request-id", requestId)
- } catch (BpmnError e) {
- throw e;
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -143,22 +143,18 @@
if(StringUtils.isBlank(devType)) {
devType = "OTHER"
}
- // support VNF as PNF, to modify
- else if(StringUtils.equalsIgnoreCase(devType, "VNF")) {
- devType = "PNF"
- }
execution.setVariable("device_class", devType)
} catch (Exception ex){
String msg = "Exception in checkDevType " + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
@@ -196,7 +192,7 @@
msoLogger.info(" ***** Exit prepareUpdateProgress *****")
}
- public void getVNFTemplatefromSDC(DelegateExecution execution){
+ private void getVNFTemplatefromSDC(DelegateExecution execution){
msoLogger.info(" ***** Started getVNFTemplatefromSDC *****")
try {
// To do
@@ -205,22 +201,109 @@
} catch (Exception ex){
String msg = "Exception in getVNFTemplatefromSDC " + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
- public void postVNFInfoProcess(DelegateExecution execution){
- msoLogger.info(" ***** Started postVNFInfoProcess *****")
- try {
- // To do
+ public void prepareVnfAndModulesCreate(DelegateExecution execution) {
+ try {
+ msoLogger.trace("Inside prepareVnfAndModulesCreate of CreateDeviceResource ")
+
+ JSONObject resourceInputParameters = execution.getVariable(Prefix + "ResourceRequestInputs")
+ String devType = resourceInputParameters.get("device_type")
+ String devVersion = resourceInputParameters.get("device_version")
+
+ //get vnf model from SDC
+ getVNFTemplatefromSDC(execution)
+
+ VnfResource vnf = execution.getVariable("vnfResource")
+ Integer vnfsCreatedCount = execution.getVariable(Prefix + "VnfsCreatedCount")
+ String vnfModelInfoString = null;
+
+ if (vnf != null) {
+ msoLogger.debug("getting model info for vnf # " + vnfsCreatedCount)
+ ModelInfo vnfModelInfo = vnf.getModelInfo()
+ vnfModelInfoString = vnfModelInfo.toString()
+ } else {
+ msoLogger.debug("vnf is null")
+ vnfModelInfoString = execution.getVariable("vnfModelInfo")
+ }
+
+ msoLogger.debug(" vnfModelInfoString :" + vnfModelInfoString)
+
+ // extract cloud configuration
+// String vimId = jsonUtil.getJsonValue(createVcpeServiceRequest,
+// "requestDetails.cloudConfiguration.lcpCloudRegionId")
+// def cloudRegion = vimId.split("_")
+// execution.setVariable("cloudOwner", cloudRegion[0])
+// msoLogger.debug("cloudOwner: "+ cloudRegion[0])
+// execution.setVariable("cloudRegionId", cloudRegion[1])
+// msoLogger.debug("cloudRegionId: "+ cloudRegion[1])
+// execution.setVariable("lcpCloudRegionId", cloudRegion[1])
+// msoLogger.debug("lcpCloudRegionId: "+ cloudRegion[1])
+// String tenantId = jsonUtil.getJsonValue(createVcpeServiceRequest,
+// "requestDetails.cloudConfiguration.tenantId")
+// execution.setVariable("tenantId", tenantId)
+// msoLogger.debug("tenantId: " + tenantId)
+
+
+ execution.setVariable("cloudOwner", "")
+
+ execution.setVariable("cloudRegionId", "")
+
+ execution.setVariable("lcpCloudRegionId", "")
+
+ execution.setVariable("tenantId", "")
+
+ String sdncVersion = execution.getVariable("sdncVersion")
+ msoLogger.debug("sdncVersion: " + sdncVersion)
+
+ msoLogger.trace("Completed prepareVnfAndModulesCreate of CreateVcpeResCustService ")
+ } catch (Exception ex) {
+ // try error in method block
+ String exceptionMessage = "Bpmn error encountered in CreateDeviceResource flow. Unexpected Error from method prepareVnfAndModulesCreate() - " + ex.getMessage()
+ msoLogger.debug(exceptionMessage)
+ }
+ }
+
+ // *******************************
+ // Validate Vnf request Section -> increment count
+ // *******************************
+ public void validateVnfCreate(DelegateExecution execution) {
+
+ try {
+ msoLogger.trace("Inside validateVnfCreate of CreateDeviceResource ")
+
+ //Update Relationship between VNF to Device
+ addVNFAAIRelationShip(execution)
+
+ Integer vnfsCreatedCount = execution.getVariable(Prefix + "VnfsCreatedCount")
+ vnfsCreatedCount++
+
+ execution.setVariable(Prefix + "VnfsCreatedCount", vnfsCreatedCount)
+
+ msoLogger.debug(" ***** Completed validateVnfCreate of CreateDeviceResource ***** " + " vnf # " + vnfsCreatedCount)
+ } catch (Exception ex) {
+ // try error in method block
+ String exceptionMessage = "Bpmn error encountered in CreateDeviceResource flow. Unexpected Error from method validateVnfCreate() - " + ex.getMessage()
+ msoLogger.debug(exceptionMessage)
+ }
+ }
+
+ public void addVNFAAIRelationShip(DelegateExecution execution) {
+
+ try {
+ msoLogger.trace("Inside addVNFAAIRelationShip of CreateDeviceResource ")
- } catch (Exception ex){
- String msg = "Exception in postVNFInfoProcess " + ex.getMessage()
- msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
- }
- }
+
+ msoLogger.debug(" ***** Completed addVNFAAIRelationShip of CreateDeviceResource ***** ")
+ } catch (Exception ex) {
+ // try error in method block
+ String exceptionMessage = "Bpmn error encountered in CreateDeviceResource flow. Unexpected Error from method addVNFAAIRelationShip() - " + ex.getMessage()
+ msoLogger.debug(exceptionMessage)
+ }
+ }
public void sendSyncResponse (DelegateExecution execution) {
msoLogger.debug(" *** sendSyncResponse *** ")
@@ -236,7 +319,7 @@
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
utils.log("DEBUG"," ***** Exit sendSyncResopnse *****")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
index 4b5737c..f8c2ced 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy
@@ -33,6 +33,7 @@
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.client.aai.AAIObjectPlurals
import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.uri.AAIResourceUri
@@ -448,7 +449,7 @@
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
index f131417..ed8b3b4 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeActivateSDNCNetworkResource.groovy
@@ -29,6 +29,7 @@
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.logger.MsoLogger
/**
@@ -367,13 +368,14 @@
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
public void postDeactivateSDNCCall(DelegateExecution execution) {
- msoLogger.info(" ***** Started prepareSDNCRequest *****") String responseCode = execution.getVariable(Prefix + "sdncDeleteReturnCode")
+ msoLogger.info(" ***** Started prepareSDNCRequest *****")
+ String responseCode = execution.getVariable(Prefix + "sdncDeleteReturnCode")
String responseObj = execution.getVariable(Prefix + "SuccessIndicator")
msoLogger.info("response from sdnc, response code :" + responseCode + " response object :" + responseObj)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
index 46c0c4b..052b28d 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/Delete3rdONAPE2EServiceInstance.groovy
@@ -24,6 +24,7 @@
import javax.ws.rs.core.Response
import org.apache.commons.lang3.StringUtils
+import static org.apache.commons.lang3.StringUtils.*
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.json.JSONArray
@@ -31,11 +32,11 @@
import org.onap.aai.domain.yang.SpPartner
import org.onap.so.bpmn.common.recipe.ResourceInput
import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
-import org.onap.so.bpmn.common.scripts.AaiUtil
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.ExternalAPIUtil
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.uri.AAIResourceUri
@@ -77,11 +78,6 @@
execution.setVariable(Prefix + "SppartnerId", sppartnerId)
// Get Sppartner from AAI
- AaiUtil aaiUriUtil = new AaiUtil(this)
- AAIResourceUri spPartner = AAIUriFactory.createResourceUri(AAIObjectType.SP_PARTNER, sppartnerId)
- String spPartnerUri = aaiUriUtil.createAaiUri(spPartner)
- execution.setVariable(Prefix + "ServiceAaiPath", spPartnerUri)
-
getSPPartnerInAAI(execution)
String callSource = "UUI"
@@ -101,12 +97,10 @@
execution.setVariable("mso-request-id", requestId)
execution.setVariable("mso-service-instance-id", resourceInputObj.getServiceInstanceId())
- } catch (BpmnError e) {
- throw e
} catch (Exception ex){
String msg = "Exception in checkSPPartnerInfoFromAAI " + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -169,12 +163,10 @@
execution.setVariable("resourceTemplateId", resourceTemplateId)
msoLogger.info( "resourceTemplateId:" + resourceTemplateId)
- } catch (BpmnError e) {
- throw e
} catch (Exception ex){
msg = "Exception in preProcessRequest " + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -269,6 +261,7 @@
private void queryServicefrom3rdONAP(DelegateExecution execution)
{
msoLogger.info(" ***** Started queryServicefrom3rdONAP *****")
+ try {
String globalSubscriberId = execution.getVariable("globalSubscriberId")
String SppartnerServiceId = execution.getVariable(Prefix + "SppartnerId")
@@ -310,19 +303,22 @@
msoLogger.error("Get Service Received a Bad Response Code. Response Code is: " + responseCode)
// exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Service Received a bad response from 3rdONAP External API")
}
-
+ }catch(Exception e) {
+ msoLogger.error("queryServicefrom3rdONAP exception:" + e.getMessage())
+ }
msoLogger.info( "Exit " + queryServicefrom3rdONAP)
}
public void doDeleteE2ESIin3rdONAP(DelegateExecution execution) {
msoLogger.info(" ***** Started doDeleteE2ESIin3rdONAP *****")
-
+ try {
String extAPIPath = execution.getVariable("ExternalAPIURL")
String payload = execution.getVariable(Prefix + "Payload")
msoLogger.debug("doDeleteE2ESIin3rdONAP externalAPIURL is: " + extAPIPath)
msoLogger.debug("doDeleteE2ESIin3rdONAP payload is: " + payload)
ExternalAPIUtil externalAPIUtil = new ExternalAPIUtil()
+ execution.setVariable("ServiceOrderId", "")
Response response = externalAPIUtil.executeExternalAPIPostCall(execution, extAPIPath, payload)
@@ -348,15 +344,18 @@
}
else{
msoLogger.error("Post ServiceOrder Received a Bad Response Code. Response Code is: " + responseCode)
- exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Post ServiceOrder Received a bad response from 3rdONAP External API")
+// exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Post ServiceOrder Received a bad response from 3rdONAP External API")
}
-
+ }catch(Exception e) {
+ msoLogger.error("doDeleteE2ESIin3rdONAP exception:" + e.getMessage())
+ }
msoLogger.info( "Exit " + doDeleteE2ESIin3rdONAP)
}
public void getE2ESIProgressin3rdONAP(DelegateExecution execution) {
msoLogger.info(" ***** Started getE2ESIProgressin3rdONAP *****")
+ try {
String extAPIPath = execution.getVariable("ExternalAPIURL")
extAPIPath += "/" + execution.getVariable("ServiceOrderId")
@@ -438,9 +437,14 @@
execution.setVariable("progress", 100)
execution.setVariable("status", "error")
execution.setVariable("statusDescription", "Get Delete ServiceOrder Received a bad response")
- exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Delete ServiceOrder Received a bad response from 3rdONAP External API")
+// exceptionUtil.buildAndThrowWorkflowException(execution, 500, "Get Delete ServiceOrder Received a bad response from 3rdONAP External API")
}
-
+ }catch(Exception e) {
+ execution.setVariable("progress", 100)
+ execution.setVariable("status", "error")
+ execution.setVariable("statusDescription", "Get Delete ServiceOrder Exception")
+ msoLogger.error("getE2ESIProgressin3rdONAP exception:" + e.getMessage())
+ }
msoLogger.info( "Exit " + getE2ESIProgressin3rdONAP)
}
@@ -457,6 +461,7 @@
private void getSPPartnerInAAI(DelegateExecution execution) {
msoLogger.info(" ***** Started getSPPartnerInAAI *****")
+ try {
String id = execution.getVariable(Prefix + "SppartnerId")
AAIResourcesClient client = new AAIResourcesClient()
@@ -467,9 +472,9 @@
execution.setVariable(Prefix + "SuccessIndicator", true)
execution.setVariable(Prefix + "FoundIndicator", true)
- String sppartnerId = sp.getSpPartnerId()
- execution.setVariable(Prefix + "SppartnerId", sppartnerId)
- msoLogger.debug(" SppartnerId is: " + sppartnerId)
+// String sppartnerId = sp.getSpPartnerId()
+// execution.setVariable(Prefix + "SppartnerId", sppartnerId)
+// msoLogger.debug(" SppartnerId is: " + sppartnerId)
String sppartnerUrl = sp.getUrl()
execution.setVariable(Prefix + "SppartnerUrl", sppartnerUrl)
msoLogger.debug(" SppartnerUrl is: " + sppartnerUrl)
@@ -479,35 +484,38 @@
String sppartnerVersion = sp.getResourceVersion()
execution.setVariable(Prefix + "SppartnerVersion", sppartnerVersion)
msoLogger.debug(" Resource Version is: " + sppartnerVersion)
-
+ } catch (Exception ex) {
+ String msg = "Exception in Delete3rdONAPE2EServiceInstance.saveSPPartnerInAAI. " + ex.getMessage()
+ msoLogger.debug(msg)
+// throw new BpmnError("MSOWorkflowException")
+ }
msoLogger.info( "Exit " + getSPPartnerInAAI)
}
public void deleteSPPartnerInAAI(DelegateExecution execution) {
msoLogger.info(" ***** Started deleteSPPartnerInAAI *****")
+ try {
String sppartnerId = execution.getVariable(Prefix + "SppartnerId")
- String sppartnerUrl = execution.getVariable(Prefix + "SppartnerUrl")
- String sppartnerVersion = execution.getVariable(Prefix + "SppartnerVersion")
AAIResourcesClient client = new AAIResourcesClient()
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SP_PARTNER, sppartnerId)
- try {
- client.delete(uri)
- msoLogger.debug("Delete sppartner Received a Good Response")
- execution.setVariable(Prefix + "SuccessIndicator", true)
- } catch (NotFoundException e) {
- msoLogger.debug(" Delete sppartner Received a Not Found (404) Response")
- execution.setVariable(Prefix + "FoundIndicator", false)
- }
+ client.delete(uri)
msoLogger.debug("Delete sppartner Received a Good Response")
+ execution.setVariable(Prefix + "SuccessIndicator", true)
+ } catch (Exception ex) {
+ String msg = "Exception in Delete3rdONAPE2EServiceInstance.deleteSPPartnerInAAI. " + ex.getMessage()
+ msoLogger.debug(msg)
+// throw new BpmnError("MSOWorkflowException")
+ }
+
msoLogger.info( "Exit " + deleteSPPartnerInAAI)
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
index cbbc518..519f064 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCustomE2EServiceInstance.groovy
@@ -33,6 +33,7 @@
import org.onap.so.bpmn.common.scripts.VidUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.logger.MsoLogger
import org.springframework.web.util.UriUtils;
@@ -351,7 +352,7 @@
utils.log("DEBUG", "Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId, isDebugEnabled)
serviceId = UriUtils.encode(serviceId,"UTF-8")
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
index 82be3e6..2829797 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteDeviceResource.groovy
@@ -27,6 +27,7 @@
import groovy.xml.XmlUtil
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
+import org.onap.aai.domain.yang.Device
import org.onap.so.bpmn.common.recipe.ResourceInput;
import org.onap.so.bpmn.common.resource.ResourceRequestBuilder
import org.onap.so.bpmn.core.UrnPropertiesReader
@@ -34,6 +35,10 @@
import org.onap.so.bpmn.core.json.JsonUtils
import org.onap.so.bpmn.infrastructure.workflow.serviceTask.client.builder.AbstractBuilder
import org.onap.so.client.HttpClient
+import org.onap.so.client.aai.AAIObjectType
+import org.onap.so.client.aai.AAIResourcesClient
+import org.onap.so.client.aai.entities.uri.AAIResourceUri
+import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.MsoLogger
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
@@ -43,10 +48,9 @@
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.apache.commons.lang3.*
import javax.ws.rs.core.MediaType
-import org.apache.commons.codec.binary.Base64;
-import org.springframework.web.util.UriUtils
+import org.apache.commons.codec.binary.Base64
import org.onap.so.utils.TargetEntity
-import org.onap.so.bpmn.common.scripts.AaiUtil
+
/**
* This groovy class supports the <class>DeleteDeviceResource.bpmn</class> process.
@@ -95,62 +99,31 @@
execution.setVariable(Prefix + "serviceInstanceId", resourceInputObj.getServiceInstanceId())
execution.setVariable("mso-request-id", requestId)
- } catch (BpmnError e) {
- throw e;
} catch (Exception ex){
String msg = "Exception in preProcessRequest " + ex.getMessage()
msoLogger.debug(msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
private void getDeviceInAAI(DelegateExecution execution) {
msoLogger.info(" ***** Started getDeviceInAAI *****")
-
+ try {
String deviceId = execution.getVariable(Prefix + "DeviceId")
- AaiUtil aaiUriUtil = new AaiUtil()
- String aai_uri = aaiUriUtil.getNetworkDeviceUri(execution)
- String aai_endpoint = execution.getVariable("URN_aai_endpoint")
- String serviceAaiPath = "${aai_endpoint}${aai_uri}/" + UriUtils.encode(deviceId,"UTF-8")
- execution.setVariable(Prefix + "ServiceAaiPath", serviceAaiPath)
+
+ AAIResourcesClient client = new AAIResourcesClient()
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.DEVICE, deviceId)
+ Device dev = client.get(uri).asBean(Device.class).get()
+
+ String devClass = dev.getClass ()
+ execution.setVariable(Prefix + "DeviceClass", devClass)
+ msoLogger.debug(" DeviceClass is: " + devClass)
- URL url = new URL(serviceAaiPath)
- HttpClient client = new HttpClient(url, MediaType.APPLICATION_XML, TargetEntity.AAI)
- client.addBasicAuthHeader(UrnPropertiesReader.getVariable("aai.auth", execution), UrnPropertiesReader.getVariable("mso.msoKey", execution))
- client.addAdditionalHeader("X-FromAppId", "MSO")
- client.addAdditionalHeader("X-TransactionId", utils.getRequestID())
- client.addAdditionalHeader("Accept", MediaType.APPLICATION_XML)
- Response response = client.get()
-
-
-
- int responseCode = response.getStatus()
- execution.setVariable(Prefix + "GetDeviceResponseCode", responseCode)
- msoLogger.debug(" Get device response code is: " + responseCode)
-
- String aaiResponse = response.readEntity(String.class)
- aaiResponse = StringEscapeUtils.unescapeXml(aaiResponse)
- aaiResponse = aaiResponse.replaceAll("&", "&")
- execution.setVariable(Prefix + "GetDeviceResponse", aaiResponse)
-
- //Process Response
- if(responseCode == 200 || responseCode == 201 || responseCode == 202 )
- //200 OK 201 CREATED 202 ACCEPTED
- {
- msoLogger.debug("GET Device Received a Good Response")
- execution.setVariable(Prefix + "SuccessIndicator", true)
- execution.setVariable(Prefix + "FoundIndicator", true)
-
- String devClass = utils.getNodeText(aaiResponse, "device_class")
- execution.setVariable(Prefix + "DeviceClass", devClass)
- msoLogger.debug(" DeviceClass is: " + devClass)
-
- }
- else
- {
- msoLogger.debug("Get DeviceInAAI Received a Bad Response Code. Response Code is: " + responseCode)
-
- }
+ } catch (Exception ex){
+ String msg = "Exception in getDeviceInAAI " + ex.getMessage()
+ msoLogger.debug(msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+ }
msoLogger.info(" ***** Exit getDeviceInAAI *****")
}
@@ -170,12 +143,12 @@
} catch (Exception ex){
String msg = "Exception in checkDevType " + ex.getMessage()
msoLogger.debug( msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
@@ -222,7 +195,7 @@
} catch (Exception ex){
String msg = "Exception in getVNFTemplatefromSDC " + ex.getMessage()
msoLogger.debug( msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -235,7 +208,7 @@
} catch (Exception ex){
String msg = "Exception in postVNFInfoProcess " + ex.getMessage()
msoLogger.debug( msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
}
@@ -253,7 +226,7 @@
} catch (Exception ex) {
String msg = "Exceptuion in sendSyncResponse:" + ex.getMessage()
msoLogger.debug( msg)
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
+// exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
}
msoLogger.debug(" ***** Exit sendSyncResopnse *****")
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
index 3519bd7..b5c9f8c 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteSDNCNetworkResource.groovy
@@ -29,6 +29,7 @@
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.logger.MsoLogger
import static org.apache.commons.lang3.StringUtils.*
@@ -361,7 +362,7 @@
}
private void setProgressUpdateVariables(DelegateExecution execution, String body) {
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceV2.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceV2.groovy
index eab6fe0..5bc1e65 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceV2.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCustomDeleteE2EServiceInstanceV2.groovy
@@ -35,6 +35,7 @@
import org.onap.so.bpmn.common.scripts.ExceptionUtil
import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
@@ -911,7 +912,7 @@
execution.setVariable("operationId", operationId)
execution.setVariable("operationType", operationType)
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
msoLogger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
index cf0bd3f..9accbd8 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteResourcesV1.groovy
@@ -39,6 +39,7 @@
import org.onap.so.bpmn.core.domain.ServiceDecomposition
import org.onap.so.bpmn.core.domain.VnfResource
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.bpmn.infrastructure.properties.BPMNProperties
import org.onap.so.logger.MsoLogger
@@ -320,7 +321,7 @@
</soapenv:Body>
</soapenv:Envelope>""";
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
execution.setVariable("CVFMI_updateResOperStatusRequest", body)
}
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy
index 3a309cf..687ac21 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ScaleCustomE2EServiceInstance.groovy
@@ -29,6 +29,7 @@
import org.onap.so.bpmn.common.scripts.MsoUtils
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
import org.onap.so.utils.UUIDChecker
@@ -259,7 +260,7 @@
execution.setVariable("operationId", operationId)
execution.setVariable("operationType", operationType)
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
msoLogger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
index 20ced72..df0cd46 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy
@@ -36,6 +36,7 @@
import org.onap.so.bpmn.core.WorkflowException
import org.onap.so.bpmn.core.domain.Resource
import org.onap.so.bpmn.core.json.JsonUtils
+import org.onap.so.bpmn.core.UrnPropertiesReader
import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.AAIResultWrapper
@@ -247,7 +248,7 @@
execution.setVariable("operationId", operationId)
execution.setVariable("operationType", operationType)
- def dbAdapterEndpoint = execution.getVariable("URN_mso_adapters_openecomp_db_endpoint")
+ def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.openecomp.db.endpoint", execution)
execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
utils.log("DEBUG", "DB Adapter Endpoint is: " + dbAdapterEndpoint, isDebugEnabled)
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateDeviceResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateDeviceResource.bpmn
index 3c7be09..5fd2c69 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateDeviceResource.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateDeviceResource.bpmn
@@ -33,7 +33,7 @@
<bpmn:outgoing>SequenceFlow_1rwaeun</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1caax8u" name="GoTo StartCreateDevinSDNC">
- <bpmn:incoming>SequenceFlow_1ylvnxq</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_1ss02ik</bpmn:incoming>
<bpmn:linkEventDefinition name="StartCreateDevinSDNC" />
</bpmn:intermediateThrowEvent>
<bpmn:scriptTask id="ScriptTask_00y93jj" name="Check DevType" scriptFormat="groovy">
@@ -53,7 +53,7 @@
<bpmn:incoming>SequenceFlow_0h4378g</bpmn:incoming>
<bpmn:linkEventDefinition name="StartCreateDevinSDNC" />
</bpmn:intermediateThrowEvent>
- <bpmn:sequenceFlow id="SequenceFlow_1ss02ik" name="VNF" sourceRef="ExclusiveGateway_0kba700" targetRef="ScriptTask_02rli65">
+ <bpmn:sequenceFlow id="SequenceFlow_1ss02ik" name="VNF" sourceRef="ExclusiveGateway_0kba700" targetRef="IntermediateThrowEvent_1caax8u">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("device_class" ) == "VNF" )}]]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_1hp2h5t" sourceRef="ScriptTask_00y93jj" targetRef="ExclusiveGateway_0kba700" />
@@ -74,39 +74,6 @@
<bpmn:linkEventDefinition name="StartCreateDevinSDNC" />
</bpmn:intermediateCatchEvent>
<bpmn:sequenceFlow id="SequenceFlow_1gu13by" sourceRef="IntermediateCatchEvent_0slgrxw" targetRef="Task_0bga3e8" />
- <bpmn:callActivity id="CallActivity_0pyrfca" name="call CreateVNF" calledElement="DoCreateVNF">
- <bpmn:extensionElements>
- <camunda:in source="mso-request-id" target="mso-request-id" />
- <camunda:in source="requestAction" target="requestAction" />
- <camunda:in source="recipeParams" target="recipeParams" />
- <camunda:in source="resourceInput" target="resourceInput" />
- <camunda:in source="recipeParamXsd" target="recipeParamXsd" />
- <camunda:in source="operationId" target="operationId" />
- <camunda:in source="svcAction" target="svcAction" />
- <camunda:in source="requestAction" target="requestAction" />
- <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
- <camunda:in source="networkRequest" target="networkRequest" />
- </bpmn:extensionElements>
- <bpmn:incoming>SequenceFlow_0pg3072</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0pkp4ce</bpmn:outgoing>
- </bpmn:callActivity>
- <bpmn:sequenceFlow id="SequenceFlow_0pkp4ce" sourceRef="CallActivity_0pyrfca" targetRef="ScriptTask_0u1piih" />
- <bpmn:scriptTask id="ScriptTask_02rli65" name="Get VNF Template fom SDC" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_1ss02ik</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0pg3072</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
-def dcsi = new CreateDeviceResource()
-dcsi.getVNFTemplatefromSDC(execution)]]></bpmn:script>
- </bpmn:scriptTask>
- <bpmn:sequenceFlow id="SequenceFlow_0pg3072" sourceRef="ScriptTask_02rli65" targetRef="CallActivity_0pyrfca" />
- <bpmn:scriptTask id="ScriptTask_0u1piih" name="Post VNF info process " scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_0pkp4ce</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1ylvnxq</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
-def dcsi = new CreateDeviceResource()
-dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
- </bpmn:scriptTask>
- <bpmn:sequenceFlow id="SequenceFlow_1ylvnxq" sourceRef="ScriptTask_0u1piih" targetRef="IntermediateThrowEvent_1caax8u" />
<bpmn:scriptTask id="ScriptTask_0p4b5vu" name="Prepare Create resource progress" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_0b5nrig</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_09s5dfc</bpmn:outgoing>
@@ -203,9 +170,9 @@
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1ss02ik_di" bpmnElement="SequenceFlow_1ss02ik">
<di:waypoint xsi:type="dc:Point" x="384" y="-127" />
- <di:waypoint xsi:type="dc:Point" x="480" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="1026" y="-127" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="420.94444444444446" y="-148" width="23" height="12" />
+ <dc:Bounds x="696.8437500000002" y="-148" width="23" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1hp2h5t_di" bpmnElement="SequenceFlow_1hp2h5t">
@@ -252,36 +219,6 @@
<dc:Bounds x="-75.5" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="CallActivity_0pyrfca_di" bpmnElement="CallActivity_0pyrfca">
- <dc:Bounds x="662" y="-167" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0pkp4ce_di" bpmnElement="SequenceFlow_0pkp4ce">
- <di:waypoint xsi:type="dc:Point" x="762" y="-127" />
- <di:waypoint xsi:type="dc:Point" x="849" y="-127" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="760.5" y="-148" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_02rli65_di" bpmnElement="ScriptTask_02rli65">
- <dc:Bounds x="480" y="-167" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0pg3072_di" bpmnElement="SequenceFlow_0pg3072">
- <di:waypoint xsi:type="dc:Point" x="580" y="-127" />
- <di:waypoint xsi:type="dc:Point" x="662" y="-127" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="621" y="-148" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_0u1piih_di" bpmnElement="ScriptTask_0u1piih">
- <dc:Bounds x="849" y="-167" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1ylvnxq_di" bpmnElement="SequenceFlow_1ylvnxq">
- <di:waypoint xsi:type="dc:Point" x="949" y="-127" />
- <di:waypoint xsi:type="dc:Point" x="1026" y="-127" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="987.5" y="-148" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0p4b5vu_di" bpmnElement="ScriptTask_0p4b5vu">
<dc:Bounds x="309" y="-290" width="100" height="80" />
</bpmndi:BPMNShape>
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteDeviceResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteDeviceResource.bpmn
index f0baac0..73d38b3 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteDeviceResource.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/DeleteDeviceResource.bpmn
@@ -33,7 +33,7 @@
<bpmn:outgoing>SequenceFlow_1rwaeun</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1caax8u" name="GoTo StartDeleteDevinSDNC">
- <bpmn:incoming>SequenceFlow_1ylvnxq</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_1ss02ik</bpmn:incoming>
<bpmn:linkEventDefinition name="StartDeleteDevinSDNC" />
</bpmn:intermediateThrowEvent>
<bpmn:scriptTask id="ScriptTask_00y93jj" name="Check DevType from AAI" scriptFormat="groovy">
@@ -53,7 +53,7 @@
<bpmn:incoming>SequenceFlow_0h4378g</bpmn:incoming>
<bpmn:linkEventDefinition name="StartDeleteDevinSDNC" />
</bpmn:intermediateThrowEvent>
- <bpmn:sequenceFlow id="SequenceFlow_1ss02ik" name="VNF" sourceRef="ExclusiveGateway_0kba700" targetRef="ScriptTask_02rli65">
+ <bpmn:sequenceFlow id="SequenceFlow_1ss02ik" name="VNF" sourceRef="ExclusiveGateway_0kba700" targetRef="IntermediateThrowEvent_1caax8u">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[#{(execution.getVariable("device_class" ) == "VNF" )}]]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_1hp2h5t" sourceRef="ScriptTask_00y93jj" targetRef="ExclusiveGateway_0kba700" />
@@ -74,39 +74,6 @@
<bpmn:linkEventDefinition name="StartDeleteDevinSDNC" />
</bpmn:intermediateCatchEvent>
<bpmn:sequenceFlow id="SequenceFlow_1gu13by" sourceRef="IntermediateCatchEvent_0slgrxw" targetRef="Task_0bga3e8" />
- <bpmn:callActivity id="CallActivity_0pyrfca" name="call DeleteVNF" calledElement="DoDeleteVNF">
- <bpmn:extensionElements>
- <camunda:in source="mso-request-id" target="mso-request-id" />
- <camunda:in source="requestAction" target="requestAction" />
- <camunda:in source="recipeParams" target="recipeParams" />
- <camunda:in source="resourceInput" target="resourceInput" />
- <camunda:in source="recipeParamXsd" target="recipeParamXsd" />
- <camunda:in source="operationId" target="operationId" />
- <camunda:in source="svcAction" target="svcAction" />
- <camunda:in source="requestAction" target="requestAction" />
- <camunda:in source="URN_mso_workflow_sdncadapter_callback" target="URN_mso_workflow_sdncadapter_callback" />
- <camunda:in source="networkRequest" target="networkRequest" />
- </bpmn:extensionElements>
- <bpmn:incoming>SequenceFlow_0pg3072</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0pkp4ce</bpmn:outgoing>
- </bpmn:callActivity>
- <bpmn:sequenceFlow id="SequenceFlow_0pkp4ce" sourceRef="CallActivity_0pyrfca" targetRef="ScriptTask_0u1piih" />
- <bpmn:scriptTask id="ScriptTask_02rli65" name="Get VNF ID" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_1ss02ik</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0pg3072</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
-def dcsi = new DeleteDeviceResource()
-dcsi.getVNFTemplatefromSDC(execution)]]></bpmn:script>
- </bpmn:scriptTask>
- <bpmn:sequenceFlow id="SequenceFlow_0pg3072" sourceRef="ScriptTask_02rli65" targetRef="CallActivity_0pyrfca" />
- <bpmn:scriptTask id="ScriptTask_0u1piih" name="Post VNF info process " scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_0pkp4ce</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1ylvnxq</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
-def dcsi = new DeleteDeviceResource()
-dcsi.postVNFInfoProcess(execution)]]></bpmn:script>
- </bpmn:scriptTask>
- <bpmn:sequenceFlow id="SequenceFlow_1ylvnxq" sourceRef="ScriptTask_0u1piih" targetRef="IntermediateThrowEvent_1caax8u" />
<bpmn:scriptTask id="ScriptTask_14oc86m" name="Prepare Create resource progress" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_1g6azih</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_003svcq</bpmn:outgoing>
@@ -203,9 +170,9 @@
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1ss02ik_di" bpmnElement="SequenceFlow_1ss02ik">
<di:waypoint xsi:type="dc:Point" x="384" y="-127" />
- <di:waypoint xsi:type="dc:Point" x="480" y="-127" />
+ <di:waypoint xsi:type="dc:Point" x="1026" y="-127" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="420.94444444444446" y="-148" width="23" height="12" />
+ <dc:Bounds x="696.8437500000002" y="-148" width="23" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1hp2h5t_di" bpmnElement="SequenceFlow_1hp2h5t">
@@ -252,36 +219,6 @@
<dc:Bounds x="-75.5" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="CallActivity_0pyrfca_di" bpmnElement="CallActivity_0pyrfca">
- <dc:Bounds x="662" y="-167" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0pkp4ce_di" bpmnElement="SequenceFlow_0pkp4ce">
- <di:waypoint xsi:type="dc:Point" x="762" y="-127" />
- <di:waypoint xsi:type="dc:Point" x="849" y="-127" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="760.5" y="-148" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_02rli65_di" bpmnElement="ScriptTask_02rli65">
- <dc:Bounds x="480" y="-167" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_0pg3072_di" bpmnElement="SequenceFlow_0pg3072">
- <di:waypoint xsi:type="dc:Point" x="580" y="-127" />
- <di:waypoint xsi:type="dc:Point" x="662" y="-127" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="621" y="-148" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_0u1piih_di" bpmnElement="ScriptTask_0u1piih">
- <dc:Bounds x="849" y="-167" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1ylvnxq_di" bpmnElement="SequenceFlow_1ylvnxq">
- <di:waypoint xsi:type="dc:Point" x="949" y="-127" />
- <di:waypoint xsi:type="dc:Point" x="1026" y="-127" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="987.5" y="-148" width="0" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_14oc86m_di" bpmnElement="ScriptTask_14oc86m">
<dc:Bounds x="309" y="-281" width="100" height="80" />
</bpmndi:BPMNShape>