aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-09-18 06:18:38 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-18 06:18:38 +0000
commitaefc4022be976a64b2dca05316c05a91a102bbfd (patch)
tree9cbd41c1cd95bb98eb64c60afef1d0fab260ad9c /bpmn/so-bpmn-infrastructure-common/src/main/groovy/org
parent662c5d0e961b7350f17929fa28a7b016fdc8753a (diff)
parent0d5e1abcfdc89dcde7a468560f36c36a5d76ecae (diff)
Merge "conflict process"
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/groovy/org')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy49
1 files changed, 46 insertions, 3 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
index 913970b051..26b0fea6a2 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy
@@ -42,9 +42,11 @@ import org.onap.so.client.aai.AAIObjectType
import org.onap.so.client.aai.AAIResourcesClient
import org.onap.so.client.aai.entities.AAIResultWrapper
import org.onap.so.client.aai.entities.uri.AAIResourceUri
+import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory
import org.onap.so.client.aai.entities.uri.AAIUriFactory
import org.onap.so.logger.MessageEnum
import org.onap.so.logger.MsoLogger
+import org.onap.so.rest.APIResponse
import org.springframework.web.util.UriUtils;
import groovy.json.*
@@ -331,6 +333,37 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
}
+ public void saveServiceInputToAAI(DelegateExecution execution) {
+ AaiUtil aaiUriUtil = new AaiUtil(this)
+
+ // create url for AAI requestInput
+ String aai_uri = aaiUriUtil.getAAIServiceInstanceUri(execution)
+ String namespace = aaiUriUtil.getNamespaceFromUri(aai_uri)
+
+ String serviceInstanceId = execution.getVariable("serviceInstanceId")
+ String serviceInstanceName = execution.getVariable("serviceInstanceName")
+ String serviceType = execution.getVariable("serviceType")
+ String uuiRequest = execution.getVariable("uuiRequest")
+
+ String payload =
+ """< xmlns=\"${namespace}\">
+ <service-instance>
+ <service-instance-id>${serviceInstanceId}</service-instance-id>
+ <service-instance-name>${serviceInstanceName}</service-instance-name>
+ <service-type>${serviceType}</service-type>
+ <customer-request>${uuiRequest}</customer-request>
+ </service-instance>""".trim()
+ utils.logAudit(payload)
+
+ String aai_endpoint = execution.getVariable("URN_aai_endpoint")
+ String serviceAaiPath = "${aai_endpoint}${aai_uri}/" + UriUtils.encode(serviceInstanceId,"UTF-8")
+
+ APIResponse response = aaiUriUtil.executeAAIPutCall(execution, serviceAaiPath, payload)
+ int responseCode = response.getStatusCode()
+ execution.setVariable(Prefix + "PutSppartnerResponseCode", responseCode)
+ }
+
+
public void postProcessAAIGET2(DelegateExecution execution) {
msoLogger.trace("postProcessAAIGET2 ")
String msg = ""
@@ -469,15 +502,25 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
// if site location is in local Operator, create all resources in local ONAP;
// if site location is in 3rd Operator, only process sp-partner to create all resources in 3rd ONAP
public void doProcessSiteLocation(DelegateExecution execution){
-
msoLogger.trace("======== Start doProcessSiteLocation Process ======== ")
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String uuiRequest = execution.getVariable("uuiRequest")
- ServiceDecomposition serviceDecompositionforLocal = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest);
- execution.setVariable("serviceDecomposition", serviceDecompositionforLocal)
+ uuiRequest = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest);
+ execution.setVariable("uuiRequest", uuiRequest)
+ execution.setVariable("serviceDecomposition", serviceDecomposition)
msoLogger.trace("======== COMPLETED doProcessSiteLocation Process ======== ")
}
+
+ // Allocate cross link TPs(terminal points) for sotn network only
+ public void doTPResourcesAllocation(DelegateExecution execution){
+ msoLogger.trace("======== Start doTPResourcesAllocation Process ======== ")
+ ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
+ String uuiRequest = execution.getVariable("uuiRequest")
+ uuiRequest = ServicePluginFactory.getInstance().doTPResourcesAllocation(execution, uuiRequest);
+ execution.setVariable("uuiRequest", uuiRequest)
+ msoLogger.trace("======== COMPLETED doTPResourcesAllocation Process ======== ")
+ }
// prepare input param for using DoCreateResources.bpmn
public void preProcessForAddResource(DelegateExecution execution) {