diff options
author | Yulian Han <elaine.hanyulian@huawei.com> | 2018-08-21 16:33:03 +0800 |
---|---|---|
committer | Yulian Han <elaine.hanyulian@huawei.com> | 2018-08-21 16:35:35 +0800 |
commit | 0d5e1abcfdc89dcde7a468560f36c36a5d76ecae (patch) | |
tree | 2012f5a7e6cb57868cb1e90486f0432d86addeef /bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap | |
parent | 5fc988ea1b7add6604d2e740a90875f9c476e45c (diff) |
conflict process
Change-Id: Idaa55084f5ecb0dd3636c232cebc14fa60000016
Issue-ID: SO-683
Signed-off-by: Yulian Han <elaine.hanyulian@huawei.com>
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap')
-rw-r--r-- | bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy | 49 |
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 4939173d65..5922ad10a0 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) { |