diff options
author | hyu2010 <henry.yu1@huawei.com> | 2020-09-07 18:07:25 -0400 |
---|---|---|
committer | hyu2010 <henry.yu1@huawei.com> | 2020-09-15 21:21:22 -0400 |
commit | c2110d59a01f3343a42cf55045bf67e456c2f182 (patch) | |
tree | 606150d795cd28469204e4fe35c13016ad89fe19 | |
parent | 78be30206872dbf2907a42d5070b197536d4a9c2 (diff) |
Implementation of TN NSSMF WF on SO
(1) Workflow of Allocate TN NSSI
(2) Workflow of Deallocate TN NSSI
(3) Workflow of Activate and Deactivate TN NSSI
(4) Workflow of Modify TN NSSI
NOTE:
1. The full implementation of TN NSSMF consists of two layers:
(1) The TN Sice definition layer, which is an orchestration
layer that provides the NBI of TN NSSMF to its consumers
(i.e., it concerns the "what" question), and (2) the TN slice
realization layer, which is responsible for the actual network
configurations of TN slicing (i.e., the "how" question). The first
layer is done on the SO (i.e., this changeset), while the 2nd
layer is implemented on the SDNC. That's why this changeset is
relatively simple, since the "real work" is done by the SDNC.
2. This changeset depends on the common NSSMF WF
(https://gerrit.onap.org/r/c/so/+/111477)
Issue-ID: SO-2959
Signed-off-by: hyu2010 <henry.yu1@huawei.com>
Change-Id: I9d4e77b7706d28fb4133ddca0ff1d6e307be613d
Signed-off-by: hyu2010 <henry.yu1@huawei.com>
15 files changed, 3522 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy new file mode 100644 index 0000000000..04fe161295 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssi.groovy @@ -0,0 +1,162 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.scripts + +import com.fasterxml.jackson.databind.ObjectMapper +import groovy.json.JsonSlurper +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.aai.domain.yang.ServiceInstance +import org.onap.aaiclient.client.aai.AAIObjectType +import org.onap.aaiclient.client.aai.AAIResourcesClient +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory +import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.onap.so.bpmn.common.scripts.ExceptionUtil +import org.onap.so.bpmn.common.scripts.RequestDBUtil +import org.onap.so.bpmn.core.json.JsonUtils +import org.onap.so.db.request.beans.ResourceOperationStatus +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +public class DoActivateTnNssi extends AbstractServiceTaskProcessor { + String Prefix = "TNACT_" + + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + RequestDBUtil requestDBUtil = new RequestDBUtil() + TnNssmfUtils tnNssmfUtils = new TnNssmfUtils() + JsonSlurper jsonSlurper = new JsonSlurper() + ObjectMapper objectMapper = new ObjectMapper() + private static final Logger logger = LoggerFactory.getLogger(DoActivateTnNssi.class) + + + public void preProcessRequest(DelegateExecution execution) { + logger.debug("Start preProcessRequest") + + execution.setVariable("startTime", System.currentTimeMillis()) + String msg = tnNssmfUtils.getExecutionInputParams(execution) + logger.debug("Activate TN NSSI input parameters: " + msg) + + execution.setVariable("prefix", Prefix) + + tnNssmfUtils.setSdncCallbackUrl(execution, true) + logger.debug("SDNC Callback URL: " + execution.getVariable("sdncCallbackUrl")) + + String modelInvariantUuid = execution.getVariable("modelInvariantUuid") + String modelUuid = execution.getVariable("modelUuid") + //here modelVersion is not set, we use modelUuid to decompose the service. + def isDebugLogEnabled = true + execution.setVariable("isDebugLogEnabled", isDebugLogEnabled) + String serviceModelInfo = """{ + "modelInvariantUuid":"${modelInvariantUuid}", + "modelUuid":"${modelUuid}", + "modelVersion":"" + }""" + execution.setVariable("serviceModelInfo", serviceModelInfo) + + String sliceServiceInstanceId = execution.getVariable("serviceInstanceID") + execution.setVariable("sliceServiceInstanceId", sliceServiceInstanceId) + + String sliceServiceInstanceName = execution.getVariable("servicename") + execution.setVariable("sliceServiceInstanceName", sliceServiceInstanceName) + + String operationType = execution.getVariable("operationType") + String actionType = operationType.equals("activateInstance") ? "activate" : "deactivate" + execution.setVariable("actionType", actionType) + + + logger.debug("Finish preProcessRequest") + } + + void preprocessSdncActOrDeactTnNssiRequest(DelegateExecution execution) { + def method = getClass().getSimpleName() + '.preprocessSdncActivateTnNssiRequest(' + + 'execution=' + execution.getId() + ')' + def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled') + logger.trace('Entered ' + method) + + try { + String serviceInstanceId = execution.getVariable("sliceServiceInstanceId") + String actionType = execution.getVariable("actionType") + + String sdncRequest = tnNssmfUtils.buildSDNCRequest(execution, serviceInstanceId, actionType) + + execution.setVariable("TNNSSMF_SDNCRequest", sdncRequest) + logger.debug("Outgoing SDNCRequest is: \n" + sdncRequest) + + } catch (Exception e) { + logger.debug("Exception Occured Processing preprocessSdncDeallocateTnNssiRequest. Exception is:\n" + e) + exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCActivateRequest Method:\n" + e.getMessage()) + } + logger.trace("COMPLETED preprocessSdncActivateTnNssiRequest Process") + } + + + void validateSDNCResponse(DelegateExecution execution, String response) { + tnNssmfUtils.validateSDNCResponse(execution, response, method) + } + + + void updateAAIOrchStatus(DelegateExecution execution) { + logger.debug("Start updateAAIOrchStatus") + String tnNssiId = execution.getVariable("tnNssiId") + String orchStatus = execution.getVariable("orchestrationStatus") + + try { + ServiceInstance si = new ServiceInstance() + si.setOrchestrationStatus(orchStatus) + AAIResourcesClient client = getAAIClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, tnNssiId) + client.update(uri, si) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in CreateSliceService.updateAAIOrchStatus " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + + logger.debug("Finish updateAAIOrchStatus") + } + + void prepareUpdateJobStatus(DelegateExecution execution, + String status, + String progress, + String statusDescription) { + String serviceId = execution.getVariable("serviceInstanceID") + String jobId = execution.getVariable("jobId") + String nsiId = execution.getVariable("nsiId") + String operType = execution.getVariable("actionType") + + + ResourceOperationStatus roStatus = new ResourceOperationStatus() + roStatus.setServiceId(serviceId) + roStatus.setOperationId(jobId) + roStatus.setResourceTemplateUUID(nsiId) + roStatus.setOperType(operType) + roStatus.setProgress(progress) + roStatus.setStatus(status) + roStatus.setStatusDescription(statusDescription) + requestDBUtil.prepareUpdateResourceOperationStatus(execution, status) + } + +} + diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy new file mode 100644 index 0000000000..534467f6ab --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateTnNssiInstance.groovy @@ -0,0 +1,231 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.scripts + +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.aai.domain.yang.SliceProfile +import org.onap.aaiclient.client.aai.AAIObjectType +import org.onap.aaiclient.client.aai.AAIResourcesClient +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory +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.slf4j.Logger +import org.slf4j.LoggerFactory + +class DoCreateTnNssiInstance extends AbstractServiceTaskProcessor { + + private static final Logger logger = LoggerFactory.getLogger(DoCreateTnNssiInstance.class); + JsonUtils jsonUtil = new JsonUtils() + TnNssmfUtils tnNssmfUtils = new TnNssmfUtils() + ExceptionUtil exceptionUtil = new ExceptionUtil() + String Prefix = "DCTN_" + + void preProcessRequest(DelegateExecution execution) { + String msg = "" + logger.trace("Enter preProcessRequest()") + + execution.setVariable("prefix", Prefix) + + String modelInvariantUuid = execution.getVariable("modelInvariantUuid") + String modelUuid = execution.getVariable("modelUuid") + //here modelVersion is not set, we use modelUuid to decompose the service. + def isDebugLogEnabled = true + execution.setVariable("isDebugLogEnabled", isDebugLogEnabled) + String serviceModelInfo = """{ + "modelInvariantUuid":"${modelInvariantUuid}", + "modelUuid":"${modelUuid}", + "modelVersion":"" + }""" + execution.setVariable("serviceModelInfo", serviceModelInfo) + + logger.trace("Exit preProcessRequest") + } + + + void createSliceProfile(DelegateExecution execution) { + + String sliceserviceInstanceId = execution.getVariable("sliceServiceInstanceId") + String sliceProfileStr = execution.getVariable("sliceProfile") + String sliceProfileId = UUID.randomUUID().toString() + SliceProfile sliceProfile = new SliceProfile(); + sliceProfile.setProfileId(sliceProfileId) + sliceProfile.setLatency(Integer.parseInt(jsonUtil.getJsonValue(sliceProfileStr, "latency"))) + sliceProfile.setResourceSharingLevel(jsonUtil.getJsonValue(sliceProfileStr, "resourceSharingLevel")) + sliceProfile.setSNssai(tnNssmfUtils.getFirstSnssaiFromSliceProfile(sliceProfileStr)) //TODO: should be list + + sliceProfile.setE2ELatency(Integer.parseInt(jsonUtil.getJsonValue(sliceProfileStr, "latency"))) + sliceProfile.setMaxBandwidth(Integer.parseInt(jsonUtil.getJsonValue(sliceProfileStr, "maxBandwidth"))) + + //TODO: new API + sliceProfile.setReliability(new Object()) + try { + AAIResourcesClient client = getAAIClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SLICE_PROFILE, execution.getVariable + ("globalSubscriberId"), + execution.getVariable("subscriptionServiceType"), sliceserviceInstanceId, sliceProfileId) + client.create(uri, sliceProfile) + + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in DoCreateSliceServiceInstance.instantiateSliceService. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + + void createServiceInstance(DelegateExecution execution) { + + String serviceRole = "TN" + String serviceType = execution.getVariable("subscriptionServiceType") + String ssInstanceId = execution.getVariable("sliceServiceInstanceId") + String sliceProfileStr = execution.getVariable("sliceProfile") + try { + org.onap.aai.domain.yang.ServiceInstance ss = new org.onap.aai.domain.yang.ServiceInstance() + ss.setServiceInstanceId(ssInstanceId) + String sliceInstanceName = execution.getVariable("sliceServiceInstanceName") + ss.setServiceInstanceName(sliceInstanceName) + ss.setServiceType(serviceType) + String serviceStatus = "allocated" + ss.setOrchestrationStatus(serviceStatus) + String modelInvariantUuid = execution.getVariable("modelInvariantUuid") + String modelUuid = execution.getVariable("modelUuid") + ss.setModelInvariantId(modelInvariantUuid) + ss.setModelVersionId(modelUuid) + String serviceInstanceLocationid = tnNssmfUtils.getFirstPlmnIdFromSliceProfile(sliceProfileStr) + ss.setServiceInstanceLocationId(serviceInstanceLocationid) + String snssai = tnNssmfUtils.getFirstSnssaiFromSliceProfile(sliceProfileStr) + ss.setEnvironmentContext(snssai) + ss.setServiceRole(serviceRole) + AAIResourcesClient client = getAAIClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), ssInstanceId) + client.create(uri, ss) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in DoCreateTnNssiInstance.createServiceInstance. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + + void createAllottedResource(DelegateExecution execution) { + String serviceInstanceId = execution.getVariable('sliceServiceInstanceId') + + AAIResourcesClient resourceClient = getAAIClient() + AAIResourceUri ssServiceuri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId) + + try { + List<String> networkStrList = jsonUtil.StringArrayToList(execution.getVariable("transportSliceNetworks")) + + for (String networkStr : networkStrList) { + String allottedResourceId = UUID.randomUUID().toString() + AAIResourceUri allottedResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.ALLOTTED_RESOURCE, + execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), + execution.getVariable("sliceserviceInstanceId"), allottedResourceId) + execution.setVariable("allottedResourceUri", allottedResourceUri) + String modelInvariantId = execution.getVariable("modelInvariantUuid") + String modelVersionId = execution.getVariable("modelUuid") + + org.onap.aai.domain.yang.AllottedResource resource = new org.onap.aai.domain.yang.AllottedResource() + resource.setId(allottedResourceId) + resource.setType("TsciNetwork") + resource.setAllottedResourceName("network_" + execution.getVariable("sliceServiceInstanceName")) + resource.setModelInvariantId(modelInvariantId) + resource.setModelVersionId(modelVersionId) + getAAIClient().create(allottedResourceUri, resource) + //AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceFromExistingURI(AAIObjectType.SERVICE_INSTANCE, UriBuilder.fromPath(ssServiceuri).build()) + //getAAIClient().connect(allottedResourceUri,ssServiceuri) + //execution.setVariable("aaiARPath", allottedResourceUri.build().toString()); + + String linkArrayStr = jsonUtil.getJsonValue(networkStr, "connectionLinks") + createLogicalLinksForAllocatedResource(execution, linkArrayStr, serviceInstanceId, allottedResourceId) + } + + } catch (Exception ex) { + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Exception in createAaiAR " + ex.getMessage()) + } + } + + void createLogicalLinksForAllocatedResource(DelegateExecution execution, + String linkArrayStr, String serviceInstanceId, + String allottedResourceId) { + + try { + List<String> linkStrList = jsonUtil.StringArrayToList(linkArrayStr) + + for (String linkStr : linkStrList) { + String logicalLinkId = UUID.randomUUID().toString() + String epA = jsonUtil.getJsonValue(linkStr, "transportEndpointA") + String epB = jsonUtil.getJsonValue(linkStr, "transportEndpointB") + String modelInvariantId = execution.getVariable("modelInvariantUuid") + String modelVersionId = execution.getVariable("modelUuid") + + org.onap.aai.domain.yang.LogicalLink resource = new org.onap.aai.domain.yang.LogicalLink() + resource.setLinkId(logicalLinkId) + resource.setLinkName(epA) + resource.setLinkName2(epB) + resource.setModelInvariantId(modelInvariantId) + resource.setModelVersionId(modelVersionId) + + AAIResourceUri logicalLinkUri = AAIUriFactory.createResourceUri(AAIObjectType.LOGICAL_LINK, logicalLinkId) + getAAIClient().create(logicalLinkUri, resource) + } + } catch (Exception ex) { + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, + "Exception in createLogicalLinksForAllocatedResource" + ex.getMessage()) + } + } + + void preprocessSdncAllocateTnNssiRequest(DelegateExecution execution) { + def method = getClass().getSimpleName() + '.preProcessSDNCActivateRequest(' + + 'execution=' + execution.getId() + + ')' + def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled') + logger.trace('Entered ' + method) + + logger.trace("STARTED preProcessSDNCActivateRequest Process") + try { + String serviceInstanceId = execution.getVariable("sliceServiceInstanceId") + + String createSDNCRequest = tnNssmfUtils.buildSDNCRequest(execution, serviceInstanceId, "create") + + execution.setVariable("TNNSSMF_SDNCRequest", createSDNCRequest) + logger.debug("Outgoing SDNCRequest is: \n" + createSDNCRequest) + + } catch (Exception e) { + logger.debug("Exception Occured Processing preProcessSDNCActivateRequest. Exception is:\n" + e) + exceptionUtil.buildAndThrowWorkflowException(execution, 1002, + "Error Occured during preProcessSDNCActivateRequest Method:\n" + e.getMessage()) + } + logger.trace("COMPLETED preProcessSDNCActivateRequest Process") + } + + + void validateSDNCResponse(DelegateExecution execution, String response, String method) { + tnNssmfUtils.validateSDNCResponse(execution, response, method) + } +} diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy new file mode 100644 index 0000000000..7681bf9346 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssi.groovy @@ -0,0 +1,169 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.scripts + +import com.fasterxml.jackson.databind.ObjectMapper +import groovy.json.JsonSlurper +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.aai.domain.yang.ServiceInstance +import org.onap.aaiclient.client.aai.AAIObjectType +import org.onap.aaiclient.client.aai.AAIResourcesClient +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory +import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.onap.so.bpmn.common.scripts.ExceptionUtil +import org.onap.so.bpmn.common.scripts.RequestDBUtil +import org.onap.so.bpmn.core.json.JsonUtils +import org.onap.so.db.request.beans.ResourceOperationStatus +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +class DoDeallocateTnNssi extends AbstractServiceTaskProcessor { + String Prefix = "TNDEALLOC_" + + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + RequestDBUtil requestDBUtil = new RequestDBUtil() + TnNssmfUtils tnNssmfUtils = new TnNssmfUtils() + JsonSlurper jsonSlurper = new JsonSlurper() + ObjectMapper objectMapper = new ObjectMapper() + private static final Logger logger = LoggerFactory.getLogger(DoDeallocateTnNssi.class) + + + void preProcessRequest(DelegateExecution execution) { + logger.debug("Start preProcessRequest") + + execution.setVariable("startTime", System.currentTimeMillis()) + String msg = tnNssmfUtils.getExecutionInputParams(execution) + logger.debug("Deallocate TN NSSI input parameters: " + msg) + + execution.setVariable("prefix", Prefix) + + tnNssmfUtils.setSdncCallbackUrl(execution, true) + logger.debug("SDNC Callback URL: " + execution.getVariable("sdncCallbackUrl")) + + String sliceServiceInstanceId = execution.getVariable("serviceInstanceID") + execution.setVariable("sliceServiceInstanceId", sliceServiceInstanceId) + + String sliceServiceInstanceName = execution.getVariable("servicename") + execution.setVariable("sliceServiceInstanceName", sliceServiceInstanceName) + + + String modelInvariantUuid = execution.getVariable("modelInvariantUuid") + String modelUuid = execution.getVariable("modelUuid") + //here modelVersion is not set, we use modelUuid to decompose the service. + def isDebugLogEnabled = true + execution.setVariable("isDebugLogEnabled", isDebugLogEnabled) + String serviceModelInfo = """{ + "modelInvariantUuid":"${modelInvariantUuid}", + "modelUuid":"${modelUuid}", + "modelVersion":"" + }""" + execution.setVariable("serviceModelInfo", serviceModelInfo) + logger.debug("Finish preProcessRequest") + } + + void preprocessSdncDeallocateTnNssiRequest(DelegateExecution execution) { + def method = getClass().getSimpleName() + '.preprocessSdncDeallocateTnNssiRequest(' + + 'execution=' + execution.getId() + ')' + def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled') + logger.trace('Entered ' + method) + + try { + String serviceInstanceId = execution.getVariable("serviceInstanceID") + + String sdncRequest = tnNssmfUtils.buildSDNCRequest(execution, serviceInstanceId, "deallocate") + + execution.setVariable("TNNSSMF_SDNCRequest", sdncRequest) + logger.debug("Outgoing SDNCRequest is: \n" + sdncRequest) + + } catch (Exception e) { + logger.debug("Exception Occured Processing preprocessSdncDeallocateTnNssiRequest. Exception is:\n" + e) + exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCActivateRequest Method:\n" + e.getMessage()) + } + logger.trace("COMPLETED preprocessSdncDeallocateTnNssiRequest Process") + } + + + void validateSDNCResponse(DelegateExecution execution, String response, String method) { + tnNssmfUtils.validateSDNCResponse(execution, response, method) + } + + void deleteServiceInstance(DelegateExecution execution) { + try { + AAIResourcesClient client = getAAIClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, + execution.getVariable("globalSubscriberId"), + execution.getVariable("subscriptionServiceType"), + execution.getVariable("serviceInstanceID")) + client.delete(uri) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in DoDeallocateTnNssi.deleteServiceInstance. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + public void updateAAIOrchStatus(DelegateExecution execution) { + logger.debug("Start updateAAIOrchStatus") + String tnNssiId = execution.getVariable("serviceInstanceID") + String orchStatus = execution.getVariable("orchestrationStatus") + + try { + ServiceInstance si = new ServiceInstance() + si.setOrchestrationStatus(orchStatus) + AAIResourcesClient client = getAAIClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, tnNssiId) + client.update(uri, si) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in CreateSliceService.updateAAIOrchStatus " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + + logger.debug("Finish updateAAIOrchStatus") + } + + void prepareUpdateJobStatus(DelegateExecution execution, + String status, + String progress, + String statusDescription) { + String serviceId = execution.getVariable("serviceInstanceID") + String jobId = execution.getVariable("jobId") + String nsiId = execution.getVariable("nsiId") + + ResourceOperationStatus roStatus = new ResourceOperationStatus() + roStatus.setServiceId(serviceId) + roStatus.setOperationId(jobId) + roStatus.setResourceTemplateUUID(nsiId) + roStatus.setOperType("Deallocate") + roStatus.setProgress(progress) + roStatus.setStatus(status) + roStatus.setStatusDescription(statusDescription) + requestDBUtil.prepareUpdateResourceOperationStatus(execution, status) + } +} + diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyTnNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyTnNssi.groovy new file mode 100644 index 0000000000..0b7a5ff59b --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyTnNssi.groovy @@ -0,0 +1,401 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.scripts + +import com.fasterxml.jackson.databind.ObjectMapper +import groovy.json.JsonSlurper +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.aai.domain.yang.ServiceInstance +import org.onap.aai.domain.yang.SliceProfile +import org.onap.aaiclient.client.aai.AAIObjectType +import org.onap.aaiclient.client.aai.AAIResourcesClient +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory +import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.onap.so.bpmn.common.scripts.ExceptionUtil +import org.onap.so.bpmn.common.scripts.RequestDBUtil +import org.onap.so.bpmn.core.json.JsonUtils +import org.onap.so.db.request.beans.ResourceOperationStatus +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +import static org.apache.commons.lang3.StringUtils.isBlank + +public class DoModifyTnNssi extends AbstractServiceTaskProcessor { + String Prefix = "TNMOD_" + + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + RequestDBUtil requestDBUtil = new RequestDBUtil() + TnNssmfUtils tnNssmfUtils = new TnNssmfUtils() + JsonSlurper jsonSlurper = new JsonSlurper() + ObjectMapper objectMapper = new ObjectMapper() + private static final Logger logger = LoggerFactory.getLogger(DoModifyTnNssi.class) + + + void preProcessRequest(DelegateExecution execution) { + logger.debug("Start preProcessRequest") + execution.setVariable("prefix", Prefix) + String msg = "" + + try { + execution.setVariable("startTime", System.currentTimeMillis()) + msg = tnNssmfUtils.getExecutionInputParams(execution) + logger.debug("Modify TN NSSI input parameters: " + msg) + + execution.setVariable("prefix", Prefix) + + tnNssmfUtils.setSdncCallbackUrl(execution, true) + logger.debug("SDNC Callback URL: " + execution.getVariable("sdncCallbackUrl")) + + String additionalPropJsonStr = execution.getVariable("sliceParams") + + String sliceServiceInstanceId = execution.getVariable("serviceInstanceID") + execution.setVariable("sliceServiceInstanceId", sliceServiceInstanceId) + + String sliceServiceInstanceName = execution.getVariable("servicename") + execution.setVariable("sliceServiceInstanceName", sliceServiceInstanceName) + + String operationId = UUID.randomUUID().toString() + execution.setVariable("operationId", operationId) + + String modelInvariantUuid = execution.getVariable("modelInvariantUuid") + String modelUuid = execution.getVariable("modelUuid") + //here modelVersion is not set, we use modelUuid to decompose the service. + def isDebugLogEnabled = true + execution.setVariable("isDebugLogEnabled", isDebugLogEnabled) + String serviceModelInfo = """{ + "modelInvariantUuid":"${modelInvariantUuid}", + "modelUuid":"${modelUuid}", + "modelVersion":"" + }""" + execution.setVariable("serviceModelInfo", serviceModelInfo) + + //additional properties + String sliceProfile = jsonUtil.getJsonValue(additionalPropJsonStr, "sliceProfile") + if (isBlank(sliceProfile)) { + msg = "Input sliceProfile is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable("sliceProfile", sliceProfile) + } + + String transportSliceNetworks = jsonUtil.getJsonValue(additionalPropJsonStr, "transportSliceNetworks") + if (isBlank(transportSliceNetworks)) { + msg = "Input transportSliceNetworks is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable("transportSliceNetworks", transportSliceNetworks) + } + logger.debug("transportSliceNetworks: " + transportSliceNetworks) + + String nsiInfo = jsonUtil.getJsonValue(additionalPropJsonStr, "nsiInfo") + if (isBlank(nsiInfo)) { + msg = "Input nsiInfo is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable("nsiInfo", nsiInfo) + } + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + msg = "Exception in preProcessRequest " + ex.getMessage() + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + logger.debug("Finish preProcessRequest") + } + + + void deleteServiceInstance(DelegateExecution execution) { + try { + AAIResourcesClient client = getAAIClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, + execution.getVariable("globalSubscriberId"), + execution.getVariable("subscriptionServiceType"), + execution.getVariable("serviceInstanceID")) + client.delete(uri) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in DoDeallocateTnNssi.deleteServiceInstance. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + + void getExistingServiceInstance(DelegateExecution execution) { + String serviceInstanceId = execution.getVariable("serviceInstanceID") + + AAIResourcesClient resourceClient = getAAIClient() + AAIResourceUri ssServiceuri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId) + + try { + if (resourceClient.exists(ssServiceuri)) { + execution.setVariable("ssi_resourceLink", ssServiceuri.build().toString()) + org.onap.aai.domain.yang.ServiceInstance ss = + resourceClient.get(org.onap.aai.domain.yang.ServiceInstance.class, ssServiceuri) + org.onap.aai.domain.yang.SliceProfile sliceProfile = ss.getSliceProfiles().getSliceProfile().get(0) + execution.setVariable("sliceProfileId", sliceProfile.getProfileId()) + + org.onap.aai.domain.yang.AllottedResources ars = ss.getAllottedResources() + List<org.onap.aai.domain.yang.AllottedResource> arList = ars.getAllottedResource() + List<String> arIdList = new ArrayList<>() + for (org.onap.aai.domain.yang.AllottedResource ar : arList) { + String arId = ar.getId() + arIdList.add(arId) + } + execution.setVariable("arIdList", arIdList) + } else { + exceptionUtil.buildAndThrowWorkflowException(execution, 2500, "Service instance was not found in aai to " + + "associate allotted resource for service :" + serviceInstanceId) + } + } catch (BpmnError e) { + throw e; + } catch (Exception ex) { + String msg = "Exception in getServiceInstance. " + ex.getMessage() + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + + } + + public void updateTnNssiInAAI(DelegateExecution execution) { + getExistingServiceInstance(execution) + + updateServiceInstance(execution) + updateSliceProfile(execution) + updateAllottedResource(execution) + } + + void updateServiceInstance(DelegateExecution execution) { + String serviceRole = "TN" + String serviceType = execution.getVariable("subscriptionServiceType") + String sliceProfileStr = execution.getVariable("sliceProfile") + String ssInstanceId = execution.getVariable("sliceServiceInstanceId") + try { + org.onap.aai.domain.yang.ServiceInstance ss = new org.onap.aai.domain.yang.ServiceInstance() + ss.setServiceInstanceId(ssInstanceId) + String sliceInstanceName = execution.getVariable("sliceServiceInstanceName") + ss.setServiceInstanceName(sliceInstanceName) + ss.setServiceType(serviceType) + String serviceStatus = "modified" + ss.setOrchestrationStatus(serviceStatus) + String modelInvariantUuid = execution.getVariable("modelInvariantUuid") + String modelUuid = execution.getVariable("modelUuid") + ss.setModelInvariantId(modelInvariantUuid) + ss.setModelVersionId(modelUuid) + String serviceInstanceLocationid = tnNssmfUtils.getFirstPlmnIdFromSliceProfile(sliceProfileStr) + ss.setServiceInstanceLocationId(serviceInstanceLocationid) + String snssai = tnNssmfUtils.getFirstSnssaiFromSliceProfile(sliceProfileStr) + ss.setEnvironmentContext(snssai) + ss.setServiceRole(serviceRole) + AAIResourcesClient client = getAAIClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), ssInstanceId) + client.update(uri, ss) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in DoCreateTnNssiInstance.createServiceInstance. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + void updateSliceProfile(DelegateExecution execution) { + + String sliceserviceInstanceId = execution.getVariable("sliceServiceInstanceId") + String sliceProfileStr = execution.getVariable("sliceProfile") + String sliceProfileId = execution.getVariable("sliceProfileId") + SliceProfile sliceProfile = new SliceProfile(); + sliceProfile.setProfileId(sliceProfileId) + sliceProfile.setLatency(Integer.parseInt(jsonUtil.getJsonValue(sliceProfileStr, "latency"))) + sliceProfile.setResourceSharingLevel(jsonUtil.getJsonValue(sliceProfileStr, "resourceSharingLevel")) + sliceProfile.setSNssai(tnNssmfUtils.getFirstSnssaiFromSliceProfile(sliceProfileStr)) //TODO: should be list + + sliceProfile.setE2ELatency(Integer.parseInt(jsonUtil.getJsonValue(sliceProfileStr, "latency"))) + sliceProfile.setMaxBandwidth(Integer.parseInt(jsonUtil.getJsonValue(sliceProfileStr, "maxBandwidth"))) + + //TODO: new API + sliceProfile.setReliability(new Object()) + try { + AAIResourcesClient client = getAAIClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SLICE_PROFILE, execution.getVariable + ("globalSubscriberId"), + execution.getVariable("subscriptionServiceType"), sliceserviceInstanceId, sliceProfileId) + client.update(uri, sliceProfile) + + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in updateSliceProfile. " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + } + + void updateAllottedResource(DelegateExecution execution) { + String serviceInstanceId = execution.getVariable('serviceInstanceID') + + List<String> arIdList = execution.getVariable("arIdList") + try { + for (String arId : arIdList) { + AAIResourceUri arUri = AAIUriFactory.createResourceUri(AAIObjectType.ALLOTTED_RESOURCE, + execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), + serviceInstanceId, arId) + + getAAIClient().delete(arUri) + } + + List<String> networkStrList = jsonUtil.StringArrayToList(execution.getVariable("transportSliceNetworks")) + + for (String networkStr : networkStrList) { + String allottedResourceId = UUID.randomUUID().toString() + AAIResourceUri allottedResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.ALLOTTED_RESOURCE, + execution.getVariable("globalSubscriberId"), execution.getVariable("subscriptionServiceType"), + execution.getVariable("sliceserviceInstanceId"), allottedResourceId) + execution.setVariable("allottedResourceUri", allottedResourceUri) + String modelInvariantId = execution.getVariable("modelInvariantUuid") + String modelVersionId = execution.getVariable("modelUuid") + + org.onap.aai.domain.yang.AllottedResource resource = new org.onap.aai.domain.yang.AllottedResource() + resource.setId(allottedResourceId) + resource.setType("TsciNetwork") + resource.setAllottedResourceName("network_" + execution.getVariable("sliceServiceInstanceName")) + resource.setModelInvariantId(modelInvariantId) + resource.setModelVersionId(modelVersionId) + getAAIClient().create(allottedResourceUri, resource) + + String linkArrayStr = jsonUtil.getJsonValue(networkStr, "connectionLinks") + createLogicalLinksForAllocatedResource(execution, linkArrayStr, serviceInstanceId, allottedResourceId) + } + + } catch (Exception ex) { + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Exception in createAaiAR " + ex.getMessage()) + } + } + + void createLogicalLinksForAllocatedResource(DelegateExecution execution, + String linkArrayStr, String serviceInstanceId, + String allottedResourceId) { + + try { + List<String> linkStrList = jsonUtil.StringArrayToList(linkArrayStr) + + for (String linkStr : linkStrList) { + String logicalLinkId = UUID.randomUUID().toString() + String epA = jsonUtil.getJsonValue(linkStr, "transportEndpointA") + String epB = jsonUtil.getJsonValue(linkStr, "transportEndpointB") + String modelInvariantId = execution.getVariable("modelInvariantUuid") + String modelVersionId = execution.getVariable("modelUuid") + + org.onap.aai.domain.yang.LogicalLink resource = new org.onap.aai.domain.yang.LogicalLink() + resource.setLinkId(logicalLinkId) + resource.setLinkName(epA) + resource.setLinkName2(epB) + resource.setModelInvariantId(modelInvariantId) + resource.setModelVersionId(modelVersionId) + + AAIResourceUri logicalLinkUri = AAIUriFactory.createResourceUri(AAIObjectType.LOGICAL_LINK, logicalLinkId) + getAAIClient().create(logicalLinkUri, resource) + } + } catch (Exception ex) { + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, + "Exception in createLogicalLinksForAllocatedResource" + ex.getMessage()) + } + } + + + void preprocessSdncModifyTnNssiRequest(DelegateExecution execution) { + def method = getClass().getSimpleName() + '.preprocessSdncModifyTnNssiRequest(' + + 'execution=' + execution.getId() + ')' + def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled') + logger.trace('Entered ' + method) + + try { + String serviceInstanceId = execution.getVariable("serviceInstanceID") + + String sdncRequest = tnNssmfUtils.buildSDNCRequest(execution, serviceInstanceId, "modify") + + execution.setVariable("TNNSSMF_SDNCRequest", sdncRequest) + logger.debug("Outgoing SDNCRequest is: \n" + sdncRequest) + + } catch (Exception e) { + logger.debug("Exception Occured Processing preprocessSdncModifyTnNssiRequest. Exception is:\n" + e) + exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during preProcessSDNCActivateRequest Method:\n" + e.getMessage()) + } + logger.trace("COMPLETED preprocessSdncModifyTnNssiRequest Process") + } + + + void validateSDNCResponse(DelegateExecution execution, String response, String method) { + tnNssmfUtils.validateSDNCResponse(execution, response, method) + } + + + void updateAAIOrchStatus(DelegateExecution execution) { + logger.debug("Start updateAAIOrchStatus") + String sliceServiceInstanceId = execution.getVariable("sliceServiceInstanceId") + String orchStatus = execution.getVariable("orchestrationStatus") + + try { + ServiceInstance si = new ServiceInstance() + si.setOrchestrationStatus(orchStatus) + AAIResourcesClient client = getAAIClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, sliceServiceInstanceId) + client.update(uri, si) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in CreateSliceService.updateAAIOrchStatus " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + + logger.debug("Finish updateAAIOrchStatus") + } + + void prepareUpdateJobStatus(DelegateExecution execution, + String status, + String progress, + String statusDescription) { + String serviceId = execution.getVariable("serviceInstanceID") + String jobId = execution.getVariable("jobId") + String nsiId = execution.getVariable("nsiId") + + ResourceOperationStatus roStatus = new ResourceOperationStatus() + roStatus.setServiceId(serviceId) + roStatus.setOperationId(jobId) + roStatus.setResourceTemplateUUID(nsiId) + roStatus.setOperType("Modify") + roStatus.setProgress(progress) + roStatus.setStatus(status) + roStatus.setStatusDescription(statusDescription) + requestDBUtil.prepareUpdateResourceOperationStatus(execution, status) + } + +} + diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy new file mode 100644 index 0000000000..3367920064 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnAllocateNssi.groovy @@ -0,0 +1,339 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License") + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.scripts + +import com.fasterxml.jackson.databind.ObjectMapper +import com.google.gson.JsonArray +import com.google.gson.JsonObject +import groovy.json.JsonSlurper +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.aai.domain.yang.ServiceInstance +import org.onap.aaiclient.client.aai.AAIObjectType +import org.onap.aaiclient.client.aai.AAIResourcesClient +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory +import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.onap.so.bpmn.common.scripts.ExceptionUtil +import org.onap.so.bpmn.common.scripts.RequestDBUtil +import org.onap.so.bpmn.core.UrnPropertiesReader +import org.onap.so.bpmn.core.domain.ServiceDecomposition +import org.onap.so.bpmn.core.domain.ServiceProxy +import org.onap.so.bpmn.core.json.JsonUtils +import org.onap.so.db.request.beans.ResourceOperationStatus +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import org.springframework.web.util.UriUtils + +import static org.apache.commons.lang3.StringUtils.isBlank + +class TnAllocateNssi extends AbstractServiceTaskProcessor { + String Prefix = "TNALLOC_" + + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + RequestDBUtil requestDBUtil = new RequestDBUtil() + JsonSlurper jsonSlurper = new JsonSlurper() + ObjectMapper objectMapper = new ObjectMapper() + TnNssmfUtils tnNssmfUtils = new TnNssmfUtils() + private static final Logger logger = LoggerFactory.getLogger(TnAllocateNssi.class) + + void preProcessRequest(DelegateExecution execution) { + logger.debug("Start preProcessRequest") + execution.setVariable("prefix", Prefix) + String msg = "" + + try { + execution.setVariable("startTime", System.currentTimeMillis()) + + msg = tnNssmfUtils.getExecutionInputParams(execution) + logger.debug("Allocate TN NSSI input parameters: " + msg) + + tnNssmfUtils.setSdncCallbackUrl(execution, true) + logger.debug("SDNC Callback URL: " + execution.getVariable("sdncCallbackUrl")) + + String additionalPropJsonStr = execution.getVariable("sliceParams") + + String tnNssiId = execution.getVariable("serviceInstanceID") + if (isBlank(tnNssiId)) { + tnNssiId = UUID.randomUUID().toString() + } + + String operationId = UUID.randomUUID().toString() + execution.setVariable("operationId", operationId) + + logger.debug("Generate new TN NSSI ID:" + tnNssiId) + tnNssiId = UriUtils.encode(tnNssiId, "UTF-8") + execution.setVariable("sliceServiceInstanceId", tnNssiId) + + String sliceServiceInstanceName = execution.getVariable("servicename") + execution.setVariable("sliceServiceInstanceName", sliceServiceInstanceName) + + //additional properties + String sliceProfile = jsonUtil.getJsonValue(additionalPropJsonStr, "sliceProfile") + if (isBlank(sliceProfile)) { + msg = "Input sliceProfile is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable("sliceProfile", sliceProfile) + } + + String transportSliceNetworks = jsonUtil.getJsonValue(additionalPropJsonStr, "transportSliceNetworks") + if (isBlank(transportSliceNetworks)) { + msg = "Input transportSliceNetworks is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable("transportSliceNetworks", transportSliceNetworks) + } + logger.debug("transportSliceNetworks: " + transportSliceNetworks) + + String nsiInfoStr = jsonUtil.getJsonValue(additionalPropJsonStr, "nsiInfo") + if (isBlank(nsiInfoStr)) { + msg = "Input nsiInfo is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable("nsiInfo", nsiInfoStr) + } + + //nsiId is passed in from caller bpmn + //String nsiIdStr = jsonUtil.getJsonValue(nsiInfo, "nsiId") + //execution.setVariable("nsiId", nsiIdStr) + + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + msg = "Exception in preProcessRequest " + ex.getMessage() + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + logger.debug("Finish preProcessRequest") + } + + + void prepareDecomposeService(DelegateExecution execution) { + logger.debug("Start prepareDecomposeService") + String msg = "" + String modelUuid = execution.getVariable("modelUuid") + if (isBlank(modelUuid)) { + msg = "Input modelUuid is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } + + String modelInvariantUuid = execution.getVariable("modelInvariantUuid") + if (isBlank(modelInvariantUuid)) { + msg = "Input modelInvariantUuid is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } + + String serviceModelInfo = """{ + "modelInvariantUuid":"${modelInvariantUuid}", + "modelUuid":"${modelUuid}", + "modelVersion":"" + }""" + execution.setVariable("ssServiceModelInfo", serviceModelInfo) + + logger.debug("Finish prepareDecomposeService") + } + + void processDecomposition(DelegateExecution execution) { + logger.debug("Start processDecomposition") + + ServiceDecomposition tnNsstServiceDecomposition = execution.getVariable("tnNsstServiceDecomposition") + logger.debug("tnNsstServiceDecomposition : " + tnNsstServiceDecomposition.toString()) + //TN NSST decomposition + String tnModelVersion = tnNsstServiceDecomposition.getModelInfo().getModelVersion() + String tnModelName = tnNsstServiceDecomposition.getModelInfo().getModelName() + List<ServiceProxy> serviceProxyList = tnNsstServiceDecomposition.getServiceProxy() + List<String> nsstInfoList = new ArrayList<>() + for (ServiceProxy serviceProxy : serviceProxyList) { + String nsstModelUuid = serviceProxy.getModelInfo().getModelUuid() + String nsstModelInvariantUuid = serviceProxy.getModelInfo().getModelInvariantUuid() + String name = serviceProxy.getModelInfo().getModelName() + String nsstServiceModelInfo = """{ + "UUID":"${nsstModelUuid}", + "invariantUUID":"${nsstModelInvariantUuid}", + "name":"${name}" + }""" + nsstInfoList.add(nsstServiceModelInfo) + } + int currentIndex = 0 + int maxIndex = nsstInfoList.size() + if (maxIndex < 1) { + String msg = "Exception in TN NSST processDecomposition. There is no NSST associated with TN NSST " + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + execution.setVariable("tnNsstInfoList", nsstInfoList) + execution.setVariable("tnModelVersion", tnModelVersion) + execution.setVariable("tnModelName", tnModelName) + execution.setVariable("currentIndex", currentIndex) + execution.setVariable("maxIndex", maxIndex) + + logger.debug("End processDecomposition") + } + + void prepareOofSelection(DelegateExecution execution) { + logger.debug("Start prepareOofSelection") + + String urlString = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution) + logger.debug("get NSSI option OOF Url: " + urlString) + //build oof request body + String requestId = execution.getVariable("msoRequestId") + String messageType = "NSISelectionResponse" + Map<String, Object> profileInfo = objectMapper.readValue(execution.getVariable("sliceProfile"), Map.class) + String modelUuid = execution.getVariable("modelUuid") + String modelInvariantUuid = execution.getVariable("modelInvariantUuid") + String modelName = execution.getVariable("tnModelName") + String timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution); + List<String> nsstInfoList = objectMapper.readValue(execution.getVariable("nsstInfoList"), List.class) + JsonArray capabilitiesList = new JsonArray() + + execution.setVariable("nssiSelection_Url", "/api/oof/selection/nsi/v1") + execution.setVariable("nssiSelection_messageType", messageType) + execution.setVariable("nssiSelection_correlator", requestId) + execution.setVariable("nssiSelection_timeout", timeout) + String oofRequest = buildSelectTnNssiRequest(requestId, messageType, modelUuid, modelInvariantUuid, + modelName, profileInfo, nsstInfoList, capabilitiesList, false) + execution.setVariable("nssiSelection_oofRequest", oofRequest) + + logger.debug("Finish prepareOofSelection") + } + + String buildSelectTnNssiRequest(String requestId, String messageType, String UUID, String invariantUUID, + String name, Map<String, Object> profileInfo, + List<String> nsstInfoList, JsonArray capabilitiesList, Boolean preferReuse) { + + def transactionId = requestId + logger.debug("transactionId is: " + transactionId) + String correlator = requestId + String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator + ObjectMapper objectMapper = new ObjectMapper() + String profileJson = objectMapper.writeValueAsString(profileInfo) + String nsstInfoListString = objectMapper.writeValueAsString(nsstInfoList) + //Prepare requestInfo object + JsonObject requestInfo = new JsonObject() + requestInfo.addProperty("transactionId", transactionId) + requestInfo.addProperty("requestId", requestId) + requestInfo.addProperty("callbackUrl", callbackUrl) + requestInfo.addProperty("sourceId", "SO") + requestInfo.addProperty("timeout", 600) + requestInfo.addProperty("numSolutions", 1) + + //Prepare serviceInfo object + JsonObject ranNsstInfo = new JsonObject() + ranNsstInfo.addProperty("UUID", UUID) + ranNsstInfo.addProperty("invariantUUID", invariantUUID) + ranNsstInfo.addProperty("name", name) + + JsonObject json = new JsonObject() + json.add("requestInfo", requestInfo) + json.add("NSTInfo", ranNsstInfo) + json.addProperty("serviceProfile", profileJson) + json.addProperty("NSSTInfo", nsstInfoListString) + json.add("subnetCapabilities", capabilitiesList) + json.addProperty("preferReuse", preferReuse) + + return json.toString() + } + + void processOofSelection(DelegateExecution execution) { + logger.debug(Prefix + "processOofSelection method start") + String oofResponse = execution.getVariable("nssiSelection_asyncCallbackResponse") + String requestStatus = jsonUtil.getJsonValue(oofResponse, "requestStatus") + if (requestStatus.equals("completed")) { + List<String> solution = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(oofResponse, "solutions")) + boolean existingNSI = jsonUtil.getJsonValue(solution.get(0), "existingNSI") + if (existingNSI) { + def sharedNSISolution = jsonUtil.getJsonValue(solution.get(0), "sharedNSISolution") + execution.setVariable("sharedTnNssiSolution", sharedNSISolution) + logger.debug("sharedTnNssiSolution from OOF " + sharedNSISolution) + String tnServiceInstanceId = jsonUtil.getJsonValue(solution.get(0), "sharedNSISolution.NSIId") + execution.setVariable("tnServiceInstanceId", tnServiceInstanceId) + org.onap.so.bpmn.core.domain.ServiceInstance serviceInstance = new org.onap.so.bpmn.core.domain.ServiceInstance(); + serviceInstance.setInstanceId(tnServiceInstanceId); + ServiceDecomposition serviceDecomposition = execution.getVariable("tnNsstServiceDecomposition") + serviceDecomposition.setServiceInstance(serviceInstance); + execution.setVariable("tnNsstServiceDecomposition", serviceDecomposition) + execution.setVariable("isOofTnNssiSelected", true) + } else { + def sliceProfiles = jsonUtil.getJsonValue(solution.get(0), "newNSISolution.sliceProfiles") + execution.setVariable("tnConstituentSliceProfiles", sliceProfiles) + execution.setVariable("isOofTnNssiSelected", false) + logger.debug("tnConstituentSliceProfiles list from OOF " + sliceProfiles) + } + } else { + String statusMessage = jsonUtil.getJsonValue(oofResponse, "statusMessage") + logger.error("received failed status from oof " + statusMessage) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Received a failed Async Response from OOF : " + statusMessage) + } + + logger.debug(Prefix + "processOofSelection method finished") + } + + void updateAAIOrchStatus(DelegateExecution execution) { + logger.debug("Start updateAAIOrchStatus") + String sliceServiceInstanceId = execution.getVariable("sliceServiceInstanceId") + String orchStatus = execution.getVariable("orchestrationStatus") + + try { + ServiceInstance si = new ServiceInstance() + si.setOrchestrationStatus(orchStatus) + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, sliceServiceInstanceId) + client.update(uri, si) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + String msg = "Exception in CreateSliceService.updateAAIOrchStatus " + ex.getMessage() + logger.info(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + + logger.debug("Finish updateAAIOrchStatus") + } + + + void prepareUpdateJobStatus(DelegateExecution execution, + String status, + String progress, + String statusDescription) { + String serviceId = execution.getVariable("sliceServiceInstanceId") + String jobId = execution.getVariable("jobId") + String nsiId = execution.getVariable("nsiId") + + ResourceOperationStatus roStatus = new ResourceOperationStatus() + roStatus.setServiceId(serviceId) + roStatus.setOperationId(jobId) + roStatus.setResourceTemplateUUID(nsiId) + roStatus.setOperType("Allocate") + roStatus.setProgress(progress) + roStatus.setStatus(status) + roStatus.setStatusDescription(statusDescription) + requestDBUtil.prepareUpdateResourceOperationStatus(execution, status) + } + +} + diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy new file mode 100644 index 0000000000..a1b883c34e --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/TnNssmfUtils.groovy @@ -0,0 +1,244 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.scripts + + +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.onap.so.bpmn.common.scripts.ExceptionUtil +import org.onap.so.bpmn.common.scripts.MsoUtils +import org.onap.so.bpmn.common.scripts.SDNCAdapterUtils +import org.onap.so.bpmn.core.RollbackData +import org.onap.so.bpmn.core.UrnPropertiesReader +import org.onap.so.bpmn.core.WorkflowException +import org.onap.so.bpmn.core.json.JsonUtils +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +import static org.apache.commons.lang3.StringUtils.isBlank + +class TnNssmfUtils { + private static final Logger logger = LoggerFactory.getLogger(TnNssmfUtils.class); + + + ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + MsoUtils msoUtils = new MsoUtils() + SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils() + + TnNssmfUtils() { + } + + + void setSdncCallbackUrl(DelegateExecution execution, boolean exceptionOnErr) { + setSdncCallbackUrl(execution, "sdncCallbackUrl", exceptionOnErr) + } + + void setSdncCallbackUrl(DelegateExecution execution, String variableName, boolean exceptionOnErr) { + String sdncCallbackUrl = UrnPropertiesReader.getVariable('mso.workflow.sdncadapter.callback', execution) + + if (isBlank(sdncCallbackUrl) && exceptionOnErr) { + String msg = "mso.workflow.sdncadapter.callback is null" + logger.debug(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } else { + execution.setVariable(variableName, sdncCallbackUrl) + } + } + + String buildSDNCRequest(DelegateExecution execution, String svcInstId, String action) { + + String uuid = execution.getVariable('testReqId') // for junits + if (uuid == null) { + uuid = execution.getVariable("msoRequestId") + "-" + System.currentTimeMillis() + } + + def callbackURL = execution.getVariable("sdncCallbackUrl") + def requestId = execution.getVariable("msoRequestId") + def serviceId = execution.getVariable("sliceServiceInstanceId") + def vnfType = execution.getVariable("serviceType") + def vnfName = execution.getVariable("sliceServiceInstanceName") + def tenantId = execution.getVariable("sliceServiceInstanceId") + def source = execution.getVariable("sliceServiceInstanceId") + def vnfId = execution.getVariable("sliceServiceInstanceId") + def cloudSiteId = execution.getVariable("sliceServiceInstanceId") + def serviceModelInfo = execution.getVariable("serviceModelInfo") + def vnfModelInfo = execution.getVariable("serviceModelInfo") + def globalSubscriberId = execution.getVariable("globalSubscriberId") + + String vnfNameString = """<vnf-name>${MsoUtils.xmlEscape(vnfName)}</vnf-name>""" + String serviceEcompModelInformation = sdncAdapterUtils.modelInfoToEcompModelInformation(serviceModelInfo) + String vnfEcompModelInformation = sdncAdapterUtils.modelInfoToEcompModelInformation(vnfModelInfo) + + String sdncVNFParamsXml = "" + + if (execution.getVariable("vnfParamsExistFlag") == true) { + sdncVNFParamsXml = buildSDNCParamsXml(execution) + } else { + sdncVNFParamsXml = "" + } + + String sdncRequest = + """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1" + xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1" + xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1"> + <sdncadapter:RequestHeader> + <sdncadapter:RequestId>${MsoUtils.xmlEscape(uuid)}</sdncadapter:RequestId> + <sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(svcInstId)}</sdncadapter:SvcInstanceId> + <sdncadapter:SvcAction>${MsoUtils.xmlEscape(action)}</sdncadapter:SvcAction> + <sdncadapter:SvcOperation>vnf-topology-operation</sdncadapter:SvcOperation> + <sdncadapter:CallbackUrl>${MsoUtils.xmlEscape(callbackURL)}</sdncadapter:CallbackUrl> + <sdncadapter:MsoAction>generic-resource</sdncadapter:MsoAction> + </sdncadapter:RequestHeader> + <sdncadapterworkflow:SDNCRequestData> + <request-information> + <request-id>${MsoUtils.xmlEscape(requestId)}</request-id> + <request-action>AllocateTnNssi</request-action> + <source>${MsoUtils.xmlEscape(source)}</source> + <notification-url/> + <order-number/> + <order-version/> + </request-information> + <service-information> + <service-id>${MsoUtils.xmlEscape(serviceId)}</service-id> + <subscription-service-type>${MsoUtils.xmlEscape(serviceId)}</subscription-service-type> + ${serviceEcompModelInformation} + <service-instance-id>${MsoUtils.xmlEscape(svcInstId)}</service-instance-id> + <global-customer-id>${MsoUtils.xmlEscape(globalSubscriberId)}</global-customer-id> + </service-information> + <vnf-information> + <vnf-id>${MsoUtils.xmlEscape(vnfId)}</vnf-id> + <vnf-type>${MsoUtils.xmlEscape(vnfType)}</vnf-type> + ${vnfEcompModelInformation} + </vnf-information> + <vnf-request-input> + ${vnfNameString} + <tenant>${MsoUtils.xmlEscape(tenantId)}</tenant> + <aic-cloud-region>${MsoUtils.xmlEscape(cloudSiteId)}</aic-cloud-region> + ${sdncVNFParamsXml} + </vnf-request-input> + </sdncadapterworkflow:SDNCRequestData> + </sdncadapterworkflow:SDNCAdapterWorkflowRequest>""" + + logger.debug("sdncRequest: " + sdncRequest) + return sdncRequest + } + + String buildSDNCParamsXml(DelegateExecution execution) { + String params = "" + StringBuilder sb = new StringBuilder() + Map<String, String> paramsMap = execution.getVariable("TNNSSMF_vnfParamsMap") + + for (Map.Entry<String, String> entry : paramsMap.entrySet()) { + String paramsXml + String key = entry.getKey(); + String value = entry.getValue() + paramsXml = """<${key}>$value</$key>""" + params = sb.append(paramsXml) + } + return params + } + + void validateSDNCResponse(DelegateExecution execution, String response, String method) { + validateSDNCResponse(execution, response, method, true) + } + + void validateSDNCResponse(DelegateExecution execution, String response, String method, boolean exceptionOnErr) { + logger.debug("STARTED ValidateSDNCResponse Process") + + String msg + + String prefix = execution.setVariable("prefix") + if (isBlank(prefix)) { + if (exceptionOnErr) { + msg = "validateSDNCResponse: prefix is null" + logger.error(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } + return + } + + WorkflowException workflowException = execution.getVariable("WorkflowException") + boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator") + + logger.debug("workflowException: " + workflowException) + + sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator) + + String sdncResponse = response + if (execution.getVariable(prefix + 'sdncResponseSuccess') == true) { + logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + sdncResponse) + RollbackData rollbackData = execution.getVariable("rollbackData") + + if (method.equals("allocate")) { + rollbackData.put("VNFMODULE", "rollbackSDNCRequestAllocate", "true") + } else if (method.equals("deallocate")) { + rollbackData.put("VNFMODULE", "rollbackSDNCRequestDeallocate", "true") + } else if (method.equals("activate")) { + rollbackData.put("VNFMODULE", "rollbackSDNCRequestActivate", "true") + } else if (method.equals("deactivate")) { + rollbackData.put("VNFMODULE", "rollbackSDNCRequestDeactivate", "true") + } else if (method.equals("modify")) { + rollbackData.put("VNFMODULE", "rollbackSDNCRequestModify", "true") + } + execution.setVariable("rollbackData", rollbackData) + } else { + if (exceptionOnErr) { + msg = "validateSDNCResponse: bad Response from SDNC Adapter for " + method + " SDNC Call." + logger.error(msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) + } + } + + logger.debug("COMPLETED ValidateSDNCResponse Process") + } + + String getExecutionInputParams(DelegateExecution execution) { + String res = "msoRequestId=" + execution.getVariable("msoRequestId") + + ", modelInvariantUuid=" + execution.getVariable("modelInvariantUuid") + + ", modelUuid=" + execution.getVariable("modelUuid") + + ", serviceInstanceID=" + execution.getVariable("serviceInstanceID") + + ", operationType=" + execution.getVariable("operationType") + + ", globalSubscriberId=" + execution.getVariable("globalSubscriberId") + + ", dummyServiceId=" + execution.getVariable("dummyServiceId") + + ", nsiId=" + execution.getVariable("nsiId") + + ", networkType=" + execution.getVariable("networkType") + + ", subscriptionServiceType=" + execution.getVariable("subscriptionServiceType") + + ", jobId=" + execution.getVariable("jobId") + + ", sliceParams=" + execution.getVariable("sliceParams") + + ", servicename=" + execution.getVariable("servicename") + + return res + } + + String getFirstSnssaiFromSliceProfile(String sliceProfileStr) { + String snssaiListStr = jsonUtil.getJsonValue(sliceProfileStr, "snssaiList") + String snssai = jsonUtil.StringArrayToList(snssaiListStr).get(0) + + return snssai + } + + String getFirstPlmnIdFromSliceProfile(String sliceProfileStr) { + String plmnListStr = jsonUtil.getJsonValue(sliceProfileStr, "plmnIdList") + String res = jsonUtil.StringArrayToList(plmnListStr).get(0) + + return res + } +} diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssiTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssiTest.groovy new file mode 100644 index 0000000000..93557a48cf --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoActivateTnNssiTest.groovy @@ -0,0 +1,178 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + # + # Licensed under the Apache License, Version 2.0 (the "License") + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.bpmn.infrastructure.scripts + +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.junit.Before +import org.junit.Test +import org.mockito.ArgumentCaptor +import org.mockito.Captor +import org.mockito.Mockito +import org.onap.so.bpmn.common.scripts.MsoGroovyTest + +import static org.junit.Assert.assertNotNull +import static org.mockito.ArgumentMatchers.eq +import static org.mockito.Mockito.* + +class DoActivateTnNssiTest extends MsoGroovyTest { + @Before + void init() throws IOException { + super.init("DoActivateTnNssiTest") + } + + @Captor + static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class) + + @Test + void testPreProcessRequest() { + when(mockExecution.getVariable("msoRequestId")).thenReturn("4c614769-f58a-4556-8ad9-dcd903077c82") + when(mockExecution.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback") + when(mockExecution.getVariable("modelInvariantUuid")).thenReturn("f85cbcc0-ad74-45d7-a5a1-17c8744fdb71") + when(mockExecution.getVariable("modelUuid")).thenReturn("36a3a8ea-49a6-4ac8-b06c-89a54544b9b6") + when(mockExecution.getVariable("serviceInstanceID")).thenReturn("eb0863e9-a69b-4b17-8a56-f05ad110bef7") + when(mockExecution.getVariable("operationId")).thenReturn("998c2081-5a71-4a39-9ae6-d6b7c5bb50c0") + when(mockExecution.getVariable("operationType")).thenReturn("opTypeTest") + when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer") + when(mockExecution.getVariable("servicename")).thenReturn("5G-test") + when(mockExecution.getVariable("networkType")).thenReturn("5G-network") + when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G-service") + when(mockExecution.getVariable("nsiId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") + when(mockExecution.getVariable("jobId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") + when(mockExecution.getVariable("operationType")).thenReturn("activateInstance") + when(mockExecution.getVariable("sliceParams")).thenReturn(mockSliceParams()) + + DoActivateTnNssi obj = new DoActivateTnNssi() + obj.preProcessRequest(mockExecution) + Mockito.verify(mockExecution, times(1)).setVariable(eq("sliceServiceInstanceId"), captor.capture()) + String sliceServiceInstanceId = captor.getValue() + assertNotNull(sliceServiceInstanceId) + } + + @Test + void testPreprocessSdncRequest() { + when(mockExecution.getVariable("msoRequestId")).thenReturn("4c614769-f58a-4556-8ad9-dcd903077c82") + when(mockExecution.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback") + when(mockExecution.getVariable("sliceServiceInstanceId")).thenReturn("5ad89cf9-0569-4a93-9306-d8324321e2be") + when(mockExecution.getVariable("sliceServiceInstanceName")).thenReturn("5G-service") + when(mockExecution.getVariable("actionType")).thenReturn("activate") + when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer") + when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G") + when(mockExecution.getVariable("modelInvariantUuid")).thenReturn("f85cbcc0-ad74-45d7-a5a1-17c8744fdb71") + when(mockExecution.getVariable("modelUuid")).thenReturn("36a3a8ea-49a6-4ac8-b06c-89a54544b9b6") + when(mockExecution.getVariable("sliceParams")).thenReturn(mockSliceParams()) + when(mockExecution.getVariable("serviceModelInfo")).thenReturn(mockServiceModelInfo()) +// JsonUtils jsonUtil = new JsonUtils() +// String sliceProfile = jsonUtil.getJsonValue(mockSliceParams(), "sliceProfile") +// when(mockExecution.getVariable("sliceProfile")).thenReturn(sliceProfile) + + DoActivateTnNssi obj = spy(DoActivateTnNssi.class) + + obj.preprocessSdncActOrDeactTnNssiRequest(mockExecution) + Mockito.verify(mockExecution, times(1)).setVariable(eq("TNNSSMF_SDNCRequest"), captor.capture()) + String request = captor.getValue() + assertNotNull(request) + } + + + private String mockSliceParams() { + String expect = """{ + "sliceProfile": { + "snssaiList": [ + "001-100001" + ], + "sliceProfileId": "ab9af40f13f721b5f13539d87484098", + "plmnIdList": [ + "460-00", + "460-01" + ], + "perfReq": { + }, + "coverageAreaTAList": [ + ], + "latency": 2, + "maxBandwidth": 100, + "resourceSharingLevel": "non-shared" + }, + "transportSliceNetworks": [ + { + "connectionLinks": [ + { + "transportEndpointA": "tranportEp_ID_XXX", + "transportEndpointB": "tranportEp_ID_YYY" + }, + { + "transportEndpointA": "tranportEp_ID_AAA", + "transportEndpointB": "tranportEp_ID_BBB" + } + ] + }, + { + "connectionLinks": [ + { + "transportEndpointA": "tranportEp_ID_CCC", + "transportEndpointB": "tranportEp_ID_DDD" + }, + { + "transportEndpointA": "tranportEp_ID_EEE", + "transportEndpointB": "tranportEp_ID_FFF" + } + ] + } + ], + "nsiInfo": { + "nsiId": "NSI-M-001-HDBNJ-NSMF-01-A-ZX", + "nsiName": "eMBB-001" + }, + "scriptName": "AN1" + }""" + return expect.replaceAll("\\\\s+", "") + } + + private String mockSliceProfile() { + String expect = """{ + "snssaiList": [ + "001-100001" + ], + "sliceProfileId": "ab9af40f13f721b5f13539d87484098", + "plmnIdList": [ + "460-00", + "460-01" + ], + "perfReq": { + }, + "coverageAreaTAList": [ + ], + "latency": 2, + "maxBandwidth": 100, + "resourceSharingLevel": "non-shared" + }""" + return expect.replaceAll("\\\\s+", "") + } + + private String mockServiceModelInfo() { + String expect = """{ + "modelInvariantUuid":"f85cbcc0-ad74-45d7-a5a1-17c8744fdb71", + "modelUuid":"36a3a8ea-49a6-4ac8-b06c-89a54544b9b6", + "modelVersion":"" + }""" + return expect.replaceAll("\\\\s+", "") + } +} diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateTnNssiTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateTnNssiTest.groovy new file mode 100644 index 0000000000..33110b6e5b --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateTnNssiTest.groovy @@ -0,0 +1,167 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + # + # Licensed under the Apache License, Version 2.0 (the "License") + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.bpmn.infrastructure.scripts + +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.junit.Before +import org.junit.Test +import org.mockito.ArgumentCaptor +import org.mockito.Captor +import org.mockito.Mockito +import org.onap.aaiclient.client.aai.AAIObjectType +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory +import org.onap.so.bpmn.common.scripts.MsoGroovyTest + +import static org.junit.Assert.assertNotNull +import static org.mockito.ArgumentMatchers.eq +import static org.mockito.Mockito.* + +class DoAllocateTnNssiTest extends MsoGroovyTest { + @Before + void init() throws IOException { + super.init("DoAllocateTnNssiTest") + } + + @Captor + static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class) + + @Test + void testPreProcessRequest() { + when(mockExecution.getVariable("msoRequestId")).thenReturn("4c614769-f58a-4556-8ad9-dcd903077c82") + when(mockExecution.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback") + when(mockExecution.getVariable("modelInvariantUuid")).thenReturn("f85cbcc0-ad74-45d7-a5a1-17c8744fdb71") + when(mockExecution.getVariable("modelUuid")).thenReturn("36a3a8ea-49a6-4ac8-b06c-89a54544b9b6") + //when(mockExecution.getVariable("serviceInstanceID")).thenReturn("eb0863e9-a69b-4b17-8a56-f05ad110bef7") + //when(mockExecution.getVariable("operationId")).thenReturn("998c2081-5a71-4a39-9ae6-d6b7c5bb50c0") + when(mockExecution.getVariable("operationType")).thenReturn("opTypeTest") + when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer") + when(mockExecution.getVariable("servicename")).thenReturn("5G-test") + when(mockExecution.getVariable("networkType")).thenReturn("5G-network") + when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G-service") + when(mockExecution.getVariable("nsiId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") + when(mockExecution.getVariable("jobId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") + when(mockExecution.getVariable("sliceParams")).thenReturn(mockSliceParams()) + + TnAllocateNssi obj = new TnAllocateNssi() + obj.preProcessRequest(mockExecution) + Mockito.verify(mockExecution, times(1)).setVariable(eq("sliceServiceInstanceId"), captor.capture()) + String sliceServiceInstanceId = captor.getValue() + assertNotNull(sliceServiceInstanceId) + } + + @Test + void testCreateServiceInstance() { + when(mockExecution.getVariable("sliceServiceInstanceId")).thenReturn("5ad89cf9-0569-4a93-9306-d8324321e2be") + when(mockExecution.getVariable("sliceServiceInstanceName")).thenReturn("5G-service") + when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer") + when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G") + when(mockExecution.getVariable("modelInvariantUuid")).thenReturn("f85cbcc0-ad74-45d7-a5a1-17c8744fdb71") + when(mockExecution.getVariable("modelUuid")).thenReturn("36a3a8ea-49a6-4ac8-b06c-89a54544b9b6") + when(mockExecution.getVariable("sliceProfile")).thenReturn(mockSliceProfile()) + +// JsonUtils jsonUtil = new JsonUtils() +// String sliceProfile = jsonUtil.getJsonValue(mockSliceParams(), "sliceProfile") +// when(mockExecution.getVariable("sliceProfile")).thenReturn(sliceProfile) + + AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "5GCustomer", "5G", "5ad89cf9-0569-4a93-9306-d8324321e2be") + DoCreateTnNssiInstance obj = spy(DoCreateTnNssiInstance.class) + when(obj.getAAIClient()).thenReturn(client) + + obj.createServiceInstance(mockExecution) + } + + + private String mockSliceParams() { + String expect = """{ + "sliceProfile": { + "snssaiList": [ + "001-100001" + ], + "sliceProfileId": "ab9af40f13f721b5f13539d87484098", + "plmnIdList": [ + "460-00", + "460-01" + ], + "perfReq": { + }, + "coverageAreaTAList": [ + ], + "latency": 2, + "maxBandwidth": 100, + "resourceSharingLevel": "non-shared" + }, + "transportSliceNetworks": [ + { + "connectionLinks": [ + { + "transportEndpointA": "tranportEp_ID_XXX", + "transportEndpointB": "tranportEp_ID_YYY" + }, + { + "transportEndpointA": "tranportEp_ID_AAA", + "transportEndpointB": "tranportEp_ID_BBB" + } + ] + }, + { + "connectionLinks": [ + { + "transportEndpointA": "tranportEp_ID_CCC", + "transportEndpointB": "tranportEp_ID_DDD" + }, + { + "transportEndpointA": "tranportEp_ID_EEE", + "transportEndpointB": "tranportEp_ID_FFF" + } + ] + } + ], + "nsiInfo": { + "nsiId": "NSI-M-001-HDBNJ-NSMF-01-A-ZX", + "nsiName": "eMBB-001" + }, + "scriptName": "AN1" + }""" + return expect.replaceAll("\\\\s+", "") + } + + private String mockSliceProfile() { + String expect = """{ + "snssaiList": [ + "001-100001" + ], + "sliceProfileId": "ab9af40f13f721b5f13539d87484098", + "plmnIdList": [ + "460-00", + "460-01" + ], + "perfReq": { + }, + "coverageAreaTAList": [ + ], + "latency": 2, + "maxBandwidth": 100, + "resourceSharingLevel": "non-shared" + }""" + return expect.replaceAll("\\\\s+", "") + } +} diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssiTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssiTest.groovy new file mode 100644 index 0000000000..eac79a9473 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeallocateTnNssiTest.groovy @@ -0,0 +1,135 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + # + # Licensed under the Apache License, Version 2.0 (the "License") + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.bpmn.infrastructure.scripts + +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.junit.Before +import org.junit.Test +import org.mockito.ArgumentCaptor +import org.mockito.Captor +import org.mockito.Mockito +import org.onap.aaiclient.client.aai.AAIObjectType +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory +import org.onap.so.bpmn.common.scripts.MsoGroovyTest + +import static org.junit.Assert.assertNotNull +import static org.mockito.ArgumentMatchers.eq +import static org.mockito.Mockito.* + +class DoDeallocateTnNssiTest extends MsoGroovyTest { + @Before + void init() throws IOException { + super.init("DeallocateTnNssiTest") + } + + @Captor + static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class) + + @Test + void testPreProcessRequest() { + when(mockExecution.getVariable("msoRequestId")).thenReturn("4c614769-f58a-4556-8ad9-dcd903077c82") + when(mockExecution.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback") + when(mockExecution.getVariable("modelInvariantUuid")).thenReturn("f85cbcc0-ad74-45d7-a5a1-17c8744fdb71") + when(mockExecution.getVariable("modelUuid")).thenReturn("36a3a8ea-49a6-4ac8-b06c-89a54544b9b6") + when(mockExecution.getVariable("serviceInstanceID")).thenReturn("eb0863e9-a69b-4b17-8a56-f05ad110bef7") + when(mockExecution.getVariable("operationId")).thenReturn("998c2081-5a71-4a39-9ae6-d6b7c5bb50c0") + when(mockExecution.getVariable("operationType")).thenReturn("opTypeTest") + when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer") + when(mockExecution.getVariable("servicename")).thenReturn("5G-test") + when(mockExecution.getVariable("networkType")).thenReturn("5G-network") + when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G-service") + when(mockExecution.getVariable("nsiId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") + when(mockExecution.getVariable("jobId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") + when(mockExecution.getVariable("sliceParams")).thenReturn(""" + { + "sliceProfile": { + "snssaiList": [ + "001-100001" + ], + "sliceProfileId": "ab9af40f13f721b5f13539d87484098", + "plmnIdList": [ + "460-00", + "460-01" + ], + "perfReq": { + }, + "coverageAreaTAList": [ + ], + "latency": 2, + "maxBandwidth": 100, + "resourceSharingLevel": "non-shared" + }, + "transportSliceNetworks": [ + { + "connectionLinks": [ + { + "transportEndpointA": "tranportEp_ID_XXX", + "transportEndpointB": "tranportEp_ID_YYY" + }, + { + "transportEndpointA": "tranportEp_ID_AAA", + "transportEndpointB": "tranportEp_ID_BBB" + } + ] + }, + { + "connectionLinks": [ + { + "transportEndpointA": "tranportEp_ID_CCC", + "transportEndpointB": "tranportEp_ID_DDD" + }, + { + "transportEndpointA": "tranportEp_ID_EEE", + "transportEndpointB": "tranportEp_ID_FFF" + } + ] + } + ], + "nsiInfo": { + "nsiId": "NSI-M-001-HDBNJ-NSMF-01-A-ZX", + "nsiName": "eMBB-001" + }, + "scriptName": "AN1" + }""".replaceAll("\\\\s+", "")) + + DoDeallocateTnNssi runScript = new DoDeallocateTnNssi() + runScript.preProcessRequest(mockExecution) + Mockito.verify(mockExecution, times(1)).setVariable(eq("sliceServiceInstanceId"), captor.capture()) + String sliceServiceInstanceId = captor.getValue() + assertNotNull(sliceServiceInstanceId) + } + + @Test + void testDeleteServiceInstance() { + when(mockExecution.getVariable("serviceInstanceID")).thenReturn("5ad89cf9-0569-4a93-9306-d8324321e2be") + when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer") + when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G") + + AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "5GCustomer", "5G", "5ad89cf9-0569-4a93-9306-d8324321e2be") + DoDeallocateTnNssi obj = spy(DoDeallocateTnNssi.class) + when(obj.getAAIClient()).thenReturn(client) + doNothing().when(client).delete(serviceInstanceUri) + + obj.deleteServiceInstance(mockExecution) + Mockito.verify(client, times(1)).delete(serviceInstanceUri) + } +} diff --git a/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyTnNssiTest.groovy b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyTnNssiTest.groovy new file mode 100644 index 0000000000..bbbec3bb46 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-common/src/test/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyTnNssiTest.groovy @@ -0,0 +1,174 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + # + # Licensed under the Apache License, Version 2.0 (the "License") + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.so.bpmn.infrastructure.scripts + +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.junit.Before +import org.junit.Test +import org.mockito.ArgumentCaptor +import org.mockito.Captor +import org.mockito.Mockito +import org.onap.aaiclient.client.aai.AAIObjectType +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory +import org.onap.so.bpmn.common.scripts.MsoGroovyTest + +import static org.junit.Assert.assertNotNull +import static org.mockito.ArgumentMatchers.eq +import static org.mockito.Mockito.* + +class DoModifyTnNssiTest extends MsoGroovyTest { + @Before + void init() throws IOException { + super.init("DoModifyTnNssiTest") + } + + @Captor + static ArgumentCaptor<ExecutionEntity> captor = ArgumentCaptor.forClass(ExecutionEntity.class) + + @Test + void testPreProcessRequest() { + when(mockExecution.getVariable("msoRequestId")).thenReturn("4c614769-f58a-4556-8ad9-dcd903077c82") + when(mockExecution.getVariable("mso.workflow.sdncadapter.callback")).thenReturn("http://localhost:8090/SDNCAdapterCallback") + when(mockExecution.getVariable("modelInvariantUuid")).thenReturn("f85cbcc0-ad74-45d7-a5a1-17c8744fdb71") + when(mockExecution.getVariable("modelUuid")).thenReturn("36a3a8ea-49a6-4ac8-b06c-89a54544b9b6") + when(mockExecution.getVariable("serviceInstanceID")).thenReturn("eb0863e9-a69b-4b17-8a56-f05ad110bef7") + when(mockExecution.getVariable("operationId")).thenReturn("998c2081-5a71-4a39-9ae6-d6b7c5bb50c0") + when(mockExecution.getVariable("operationType")).thenReturn("opTypeTest") + when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer") + when(mockExecution.getVariable("servicename")).thenReturn("5G-test") + when(mockExecution.getVariable("networkType")).thenReturn("5G-network") + when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G-service") + when(mockExecution.getVariable("nsiId")).thenReturn("88f65519-9a38-4c4b-8445-9eb4a5a5af56") + when(mockExecution.getVariable("jobId")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") + when(mockExecution.getVariable("operationType")).thenReturn("activateInstance") + when(mockExecution.getVariable("sliceParams")).thenReturn(mockSliceParams()) + + DoModifyTnNssi obj = new DoModifyTnNssi() + obj.preProcessRequest(mockExecution) + Mockito.verify(mockExecution, times(1)).setVariable(eq("sliceServiceInstanceId"), captor.capture()) + String sliceServiceInstanceId = captor.getValue() + assertNotNull(sliceServiceInstanceId) + } + + @Test + void testUpdateServiceInstance() { + when(mockExecution.getVariable("sliceServiceInstanceId")).thenReturn("5ad89cf9-0569-4a93-9306-d8324321e2be") + when(mockExecution.getVariable("sliceServiceInstanceName")).thenReturn("5G-service") + when(mockExecution.getVariable("globalSubscriberId")).thenReturn("5GCustomer") + when(mockExecution.getVariable("subscriptionServiceType")).thenReturn("5G") + when(mockExecution.getVariable("sliceProfileId")).thenReturn("5ad89cf9-0569-4a93-9306-d8324321e2b1") + when(mockExecution.getVariable("modelInvariantUuid")).thenReturn("f85cbcc0-ad74-45d7-a5a1-17c8744fdb71") + when(mockExecution.getVariable("modelUuid")).thenReturn("36a3a8ea-49a6-4ac8-b06c-89a54544b9b6") + when(mockExecution.getVariable("sliceProfile")).thenReturn(mockSliceProfile()) + + AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, "5GCustomer", "5G", "5ad89cf9-0569-4a93-9306-d8324321e2be") + DoModifyTnNssi obj = spy(DoModifyTnNssi.class) + when(obj.getAAIClient()).thenReturn(client) + + obj.updateServiceInstance(mockExecution) + } + + + private String mockSliceParams() { + String expect = """{ + "sliceProfile": { + "snssaiList": [ + "001-100001" + ], + "sliceProfileId": "ab9af40f13f721b5f13539d87484098", + "plmnIdList": [ + "460-00", + "460-01" + ], + "perfReq": { + }, + "coverageAreaTAList": [ + ], + "latency": 2, + "maxBandwidth": 100, + "resourceSharingLevel": "non-shared" + }, + "transportSliceNetworks": [ + { + "connectionLinks": [ + { + "transportEndpointA": "tranportEp_ID_XXX", + "transportEndpointB": "tranportEp_ID_YYY" + }, + { + "transportEndpointA": "tranportEp_ID_AAA", + "transportEndpointB": "tranportEp_ID_BBB" + } + ] + }, + { + "connectionLinks": [ + { + "transportEndpointA": "tranportEp_ID_CCC", + "transportEndpointB": "tranportEp_ID_DDD" + }, + { + "transportEndpointA": "tranportEp_ID_EEE", + "transportEndpointB": "tranportEp_ID_FFF" + } + ] + } + ], + "nsiInfo": { + "nsiId": "NSI-M-001-HDBNJ-NSMF-01-A-ZX", + "nsiName": "eMBB-001" + }, + "scriptName": "AN1" + }""" + return expect.replaceAll("\\\\s+", "") + } + + private String mockSliceProfile() { + String expect = """{ + "snssaiList": [ + "001-100001" + ], + "sliceProfileId": "ab9af40f13f721b5f13539d87484098", + "plmnIdList": [ + "460-00", + "460-01" + ], + "perfReq": { + }, + "coverageAreaTAList": [ + ], + "latency": 2, + "maxBandwidth": 100, + "resourceSharingLevel": "non-shared" + }""" + return expect.replaceAll("\\\\s+", "") + } + + private String mockServiceModelInfo() { + String expect = """{ + "modelInvariantUuid":"f85cbcc0-ad74-45d7-a5a1-17c8744fdb71", + "modelUuid":"36a3a8ea-49a6-4ac8-b06c-89a54544b9b6", + "modelVersion":"" + }""" + return expect.replaceAll("\\\\s+", "") + } +} diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn new file mode 100644 index 0000000000..8ecce46ac0 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoActivateTransportNSSI.bpmn @@ -0,0 +1,207 @@ +<?xml version="1.0" encoding="UTF-8"?> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1wio50w" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1"> + <bpmn:process id="DoActivateTransportNSSI" name="DoActivateTransportNSSI" isExecutable="true"> + <bpmn:startEvent id="StartEvent_1nbljfd" name="Create Activate/Deactivate TN NSSMF Work Flow"> + <bpmn:outgoing>SequenceFlow_03s744c</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:subProcess id="SubProcess_1yv9i68" name="Sub-process for FalloutHandler and Rollback" triggeredByEvent="true"> + <bpmn:startEvent id="StartEvent_1omdx56"> + <bpmn:outgoing>SequenceFlow_1w67v6s</bpmn:outgoing> + <bpmn:errorEventDefinition id="ErrorEventDefinition_06xcioh" /> + </bpmn:startEvent> + <bpmn:endEvent id="EndEvent_1jx3026"> + <bpmn:incoming>SequenceFlow_08mlzwz</bpmn:incoming> + </bpmn:endEvent> + <bpmn:scriptTask id="ScriptTask_1swzdpw" name="Handle Unexpected Error" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1w67v6s</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_08mlzwz</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.common.scripts.* +ExceptionUtil ex = new ExceptionUtil() +ex.processJavaException(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_1w67v6s" sourceRef="StartEvent_1omdx56" targetRef="ScriptTask_1swzdpw" /> + <bpmn:sequenceFlow id="SequenceFlow_08mlzwz" sourceRef="ScriptTask_1swzdpw" targetRef="EndEvent_1jx3026" /> + </bpmn:subProcess> + <bpmn:endEvent id="EndEvent_05h01gx" name="End"> + <bpmn:incoming>Flow_1032bi1</bpmn:incoming> + </bpmn:endEvent> + <bpmn:scriptTask id="ScriptTask_1ssh2l9" name="Prepare Update Resource Oper Status((finish)" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0kixzdj</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1qv8qw1</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new DoActivateTnNssi() +runScript.prepareUpdateJobStatus(execution,"finished","100","Activate or Deactivate successfully")</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_03s744c" sourceRef="StartEvent_1nbljfd" targetRef="ScriptTask_1tc44ge" /> + <bpmn:sequenceFlow id="SequenceFlow_1qv8qw1" sourceRef="ScriptTask_1ssh2l9" targetRef="Activity_0nhxd67" /> + <bpmn:scriptTask id="ScriptTask_19uxoi8" name="Update AAI Status" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1jdb2oq</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0kixzdj</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def actionType = execution.getVariable("actionType") +execution.setVariable("orchestrationStatus", actionType) +def runScript = new DoActivateTnNssi() +runScript.updateAAIOrchStatus(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_0kixzdj" sourceRef="ScriptTask_19uxoi8" targetRef="ScriptTask_1ssh2l9" /> + <bpmn:scriptTask id="Activity_1tw8eyy" name="PreProcess SDNC Activate or Deactivate TN NSSI Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_07e12rt</bpmn:incoming> + <bpmn:outgoing>Flow_0cpctye</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new DoActivateTnNssi() +runScript.preprocessSdncActOrDeactTnNssiRequest(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="Flow_0cpctye" sourceRef="Activity_1tw8eyy" targetRef="Activity_0p20esb" /> + <bpmn:callActivity id="Activity_0p20esb" name="Call SDNC Adapter: Activate/Deactivate TN NSSI" calledElement="sdncAdapter"> + <bpmn:extensionElements> + <camunda:in source="TNNSSMF_SDNCRequest" target="sdncAdapterWorkflowRequest" /> + <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" /> + <camunda:in source="mso-request-id" target="mso-request-id" /> + <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="sdncAdapterResponse" target="TNNSSMF_SDNCAdapterResponse" /> + <camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" /> + </bpmn:extensionElements> + <bpmn:incoming>Flow_0cpctye</bpmn:incoming> + <bpmn:outgoing>Flow_0fuabjs</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="Flow_0fuabjs" sourceRef="Activity_0p20esb" targetRef="Activity_0phv8e5" /> + <bpmn:scriptTask id="Activity_0phv8e5" name="Postprocess SDNC Activate/Deactivate TN NSSI Request" scriptFormat="groovy"> + <bpmn:incoming>Flow_0fuabjs</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1jdb2oq</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* + +String response = execution.getVariable("TNNSSMF_SDNCAdapterResponse") + +def runScript = new DoActivateTnNssi() +runScript.validateSDNCResponse(execution, response)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_1jdb2oq" sourceRef="Activity_0phv8e5" targetRef="ScriptTask_19uxoi8" /> + <bpmn:scriptTask id="ScriptTask_1tc44ge" name="PreProcess Incoming Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_03s744c</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_07e12rt</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new DoActivateTnNssi() +runScript.preProcessRequest(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_07e12rt" sourceRef="ScriptTask_1tc44ge" targetRef="Activity_1tw8eyy" /> + <bpmn:serviceTask id="Activity_0nhxd67" name="Update Resource Operation Status"> + <bpmn:extensionElements> + <camunda:connector> + <camunda:inputOutput> + <camunda:inputParameter name="url">${dbAdapterEndpoint}</camunda:inputParameter> + <camunda:inputParameter name="headers"> + <camunda:map> + <camunda:entry key="content-type">application/soap+xml</camunda:entry> + <camunda:entry key="Authorization">Basic YnBlbDpwYXNzd29yZDEk</camunda:entry> + </camunda:map> + </camunda:inputParameter> + <camunda:inputParameter name="payload">${updateResourceOperationStatus}</camunda:inputParameter> + <camunda:inputParameter name="method">POST</camunda:inputParameter> + <camunda:outputParameter name="NSSMF_dbResponseCode">${statusCode}</camunda:outputParameter> + <camunda:outputParameter name="NSSMF_dbResponse">${response}</camunda:outputParameter> + </camunda:inputOutput> + <camunda:connectorId>http-connector</camunda:connectorId> + </camunda:connector> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_1qv8qw1</bpmn:incoming> + <bpmn:outgoing>Flow_1032bi1</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="Flow_1032bi1" sourceRef="Activity_0nhxd67" targetRef="EndEvent_05h01gx" /> + </bpmn:process> + <bpmn:message id="Message_0c4b2r5" name="SliceServiceTask" /> + <bpmn:error id="Error_03akl5v" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> + <bpmn:error id="Error_0p2naox" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoActivateTransportNSSI"> + <bpmndi:BPMNEdge id="SequenceFlow_07e12rt_di" bpmnElement="SequenceFlow_07e12rt"> + <di:waypoint x="385" y="121" /> + <di:waypoint x="509" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1jdb2oq_di" bpmnElement="SequenceFlow_1jdb2oq"> + <di:waypoint x="1080" y="121" /> + <di:waypoint x="1220" y="121" /> + <di:waypoint x="1220" y="210" /> + <di:waypoint x="335" y="210" /> + <di:waypoint x="335" y="310" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0fuabjs_di" bpmnElement="Flow_0fuabjs"> + <di:waypoint x="850" y="121" /> + <di:waypoint x="959" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0cpctye_di" bpmnElement="Flow_0cpctye"> + <di:waypoint x="630" y="121" /> + <di:waypoint x="729" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0kixzdj_di" bpmnElement="SequenceFlow_0kixzdj"> + <di:waypoint x="385" y="350" /> + <di:waypoint x="530" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1qv8qw1_di" bpmnElement="SequenceFlow_1qv8qw1"> + <di:waypoint x="630" y="350" /> + <di:waypoint x="740" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_03s744c_di" bpmnElement="SequenceFlow_03s744c"> + <di:waypoint x="214" y="121" /> + <di:waypoint x="285" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1032bi1_di" bpmnElement="Flow_1032bi1"> + <di:waypoint x="840" y="350" /> + <di:waypoint x="1002" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_1nbljfd_di" bpmnElement="StartEvent_1nbljfd"> + <dc:Bounds x="178" y="103" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="163" y="146" width="81" height="53" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0nhxd67_di" bpmnElement="Activity_0nhxd67"> + <dc:Bounds x="740" y="310" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="SubProcess_1yv9i68_di" bpmnElement="SubProcess_1yv9i68" isExpanded="true"> + <dc:Bounds x="685" y="1080" width="781" height="196" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_08mlzwz_di" bpmnElement="SequenceFlow_08mlzwz"> + <di:waypoint x="1079" y="1184" /> + <di:waypoint x="1353" y="1184" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1w67v6s_di" bpmnElement="SequenceFlow_1w67v6s"> + <di:waypoint x="751" y="1184" /> + <di:waypoint x="979" y="1184" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_1omdx56_di" bpmnElement="StartEvent_1omdx56"> + <dc:Bounds x="715" y="1166" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1jx3026_di" bpmnElement="EndEvent_1jx3026"> + <dc:Bounds x="1353" y="1166" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1swzdpw_di" bpmnElement="ScriptTask_1swzdpw"> + <dc:Bounds x="979" y="1144" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_05h01gx_di" bpmnElement="EndEvent_05h01gx"> + <dc:Bounds x="1002" y="332" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1010" y="375" width="20" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1ssh2l9_di" bpmnElement="ScriptTask_1ssh2l9"> + <dc:Bounds x="530" y="310" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_19uxoi8_di" bpmnElement="ScriptTask_19uxoi8"> + <dc:Bounds x="285" y="310" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1tw8eyy_di" bpmnElement="Activity_1tw8eyy"> + <dc:Bounds x="509" y="74" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0p20esb_di" bpmnElement="Activity_0p20esb"> + <dc:Bounds x="729" y="74" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0phv8e5_di" bpmnElement="Activity_0phv8e5"> + <dc:Bounds x="959" y="74" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1tc44ge_di" bpmnElement="ScriptTask_1tc44ge"> + <dc:Bounds x="285" y="81" width="100" height="80" /> + </bpmndi:BPMNShape> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn new file mode 100644 index 0000000000..f4886322c2 --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoAllocateTransportNSSI.bpmn @@ -0,0 +1,493 @@ +<?xml version="1.0" encoding="UTF-8"?> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1wio50w" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1"> + <bpmn:process id="DoAllocateTransportNSSI" name="DoAllocateTransportNSSI" isExecutable="true"> + <bpmn:startEvent id="StartEvent_1nbljfd" name="Create Allocate TN NSSMF Work Flow"> + <bpmn:outgoing>SequenceFlow_03s744c</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_0vilb24" name="OOF TN NSSI Selection"> + <bpmn:outgoing>SequenceFlow_1fk37v7</bpmn:outgoing> + <bpmn:linkEventDefinition id="LinkEventDefinition_197u5pe" name="OofTnNssiSelect" /> + </bpmn:intermediateCatchEvent> + <bpmn:scriptTask id="ScriptTask_1tc44ge" name="PreProcess Incoming Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_03s744c</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_07e12rt</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def css= new TnAllocateNssi() +css.preProcessRequest(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:scriptTask id="ScriptTask_1jgtb0y" name="Process OOF Selection" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1cv0wop</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_197cm2e</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def css = new TnAllocateNssi() +css.processOofSelection(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:exclusiveGateway id="ExclusiveGateway_0elbczl" name="Use Existing TN NSSI?" default="SequenceFlow_038lb9m"> + <bpmn:incoming>SequenceFlow_197cm2e</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_12t5exy</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_038lb9m</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:scriptTask id="ScriptTask_0l3d1ai" name="Process Decomposition" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1t19ips</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0jrclmc</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new TnAllocateNssi() +runScript.processDecomposition(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:exclusiveGateway id="ExclusiveGateway_18eld2o" name="Is Allocation Successful?" default="SequenceFlow_1c6ka9h"> + <bpmn:incoming>SequenceFlow_0mlrlbv</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1c6ka9h</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_0n4xku8</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:endEvent id="EndEvent_0x406rw"> + <bpmn:incoming>SequenceFlow_1c6ka9h</bpmn:incoming> + <bpmn:errorEventDefinition id="ErrorEventDefinition_0mlneuw" errorRef="Error_03akl5v" /> + </bpmn:endEvent> + <bpmn:subProcess id="SubProcess_1yv9i68" name="Sub-process for FalloutHandler and Rollback" triggeredByEvent="true"> + <bpmn:startEvent id="StartEvent_1omdx56"> + <bpmn:outgoing>SequenceFlow_1w67v6s</bpmn:outgoing> + <bpmn:errorEventDefinition id="ErrorEventDefinition_06xcioh" /> + </bpmn:startEvent> + <bpmn:endEvent id="EndEvent_1jx3026"> + <bpmn:incoming>SequenceFlow_08mlzwz</bpmn:incoming> + </bpmn:endEvent> + <bpmn:scriptTask id="ScriptTask_1swzdpw" name="Handle Unexpected Error" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1w67v6s</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_08mlzwz</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.common.scripts.* +ExceptionUtil ex = new ExceptionUtil() +ex.processJavaException(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_1w67v6s" sourceRef="StartEvent_1omdx56" targetRef="ScriptTask_1swzdpw" /> + <bpmn:sequenceFlow id="SequenceFlow_08mlzwz" sourceRef="ScriptTask_1swzdpw" targetRef="EndEvent_1jx3026" /> + </bpmn:subProcess> + <bpmn:endEvent id="EndEvent_05h01gx" name="End"> + <bpmn:incoming>Flow_06rrcwf</bpmn:incoming> + </bpmn:endEvent> + <bpmn:scriptTask id="ScriptTask_1xxag1o" name="Prepare Init Service Operation Status" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_07e12rt</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0t094g7</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def rupScript = new TnAllocateNssi() +runScript.prepareUpdateJobStatus(execution,"progress","10","Allocate TN NSSI started")</bpmn:script> + </bpmn:scriptTask> + <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_1ex8ke9" name="Goto OOF TN NSSI Selection"> + <bpmn:incoming>SequenceFlow_0jrclmc</bpmn:incoming> + <bpmn:linkEventDefinition id="LinkEventDefinition_0de65en" name="OofTnNssiSelect" /> + </bpmn:intermediateThrowEvent> + <bpmn:scriptTask id="ScriptTask_1ssh2l9" name="Prepare Update Resource Oper Status((finish)" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0kixzdj</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1qv8qw1</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new TnAllocateNssi() +runScript.prepareUpdateJobStatus(execution,"finished","100","Allocated TN NSSI successfully")</bpmn:script> + </bpmn:scriptTask> + <bpmn:callActivity id="CallActivity_1bnkmaz" name="Call Decompose Service" calledElement="DecomposeService"> + <bpmn:extensionElements> + <camunda:in source="msoRequestId" target="msoRequestId" /> + <camunda:in source="sliceServiceInstanceId" target="serviceInstanceId" /> + <camunda:in source="serviceModelInfo" target="serviceModelInfo" /> + <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" /> + <camunda:out source="serviceDecomposition" target="tnNsstServiceDecomposition" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_0q7yc2c</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1t19ips</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:scriptTask id="ScriptTask_0o2r07o" name="Prepare Decompose Service " scriptFormat="groovy"> + <bpmn:incoming>Flow_1k88aak</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0q7yc2c</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new TnAllocateNssi() +runScript.prepareDecomposeService(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:scriptTask id="ScriptTask_08wim95" name="Prepare OOF TN NSSI Selection" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1fk37v7</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0h2oree</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def css = new TnAllocateNssi() +css.prepareOofSelection(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:intermediateCatchEvent id="IntermediateCatchEvent_0pkvfun" name="Allocate TN NSSI"> + <bpmn:outgoing>SequenceFlow_1bevt3a</bpmn:outgoing> + <bpmn:linkEventDefinition id="LinkEventDefinition_1vlfclx" name="TnAllocateNssi" /> + </bpmn:intermediateCatchEvent> + <bpmn:intermediateThrowEvent id="IntermediateThrowEvent_0ktwpki" name="Goto Allocate TN NSSI"> + <bpmn:incoming>SequenceFlow_12t5exy</bpmn:incoming> + <bpmn:linkEventDefinition id="LinkEventDefinition_16f2ri9" name="TnAllocateNssi" /> + </bpmn:intermediateThrowEvent> + <bpmn:endEvent id="EndEvent_1oouvuh" name="End"> + <bpmn:incoming>Flow_0pbq5q0</bpmn:incoming> + </bpmn:endEvent> + <bpmn:callActivity id="CallActivity_0cxst1i" name="Call DoCreateTnNssiInstance " calledElement="DoCreateTnNssiInstance"> + <bpmn:extensionElements> + <camunda:in source="msoRequestId" target="msoRequestId" /> + <camunda:in source="sliceServiceInstanceId" target="sliceServiceInstanceId" /> + <camunda:in source="modelInvariantUuid" target="modelInvariantUuid" /> + <camunda:in source="modelUuid" target="modelUuid" /> + <camunda:in source="sliceServiceInstanceName" target="sliceServiceInstanceName" /> + <camunda:in source="globalSubscriberId" target="globalSubscriberId" /> + <camunda:in source="subscriptionServiceType" target="subscriptionServiceType" /> + <camunda:in source="operationId" target="operationId" /> + <camunda:in source="sliceProfile" target="sliceProfile" /> + <camunda:in source="transportSliceNetworks" target="transportSliceNetworks" /> + <camunda:in source="nsiInfo" target="nsiInfo" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="rollbackData" target="rollbackData" /> + <camunda:out source="rolledBack" target="rolledBack" /> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_1bevt3a</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0mlrlbv</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="SequenceFlow_03s744c" sourceRef="StartEvent_1nbljfd" targetRef="ScriptTask_1tc44ge" /> + <bpmn:sequenceFlow id="SequenceFlow_07e12rt" sourceRef="ScriptTask_1tc44ge" targetRef="ScriptTask_1xxag1o" /> + <bpmn:sequenceFlow id="SequenceFlow_1cv0wop" sourceRef="Activity_187hs2t" targetRef="ScriptTask_1jgtb0y" /> + <bpmn:sequenceFlow id="SequenceFlow_197cm2e" sourceRef="ScriptTask_1jgtb0y" targetRef="ExclusiveGateway_0elbczl" /> + <bpmn:sequenceFlow id="SequenceFlow_12t5exy" name="No" sourceRef="ExclusiveGateway_0elbczl" targetRef="IntermediateThrowEvent_0ktwpki"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{(execution.getVariable("isOofTnNssiSelected") == false)}</bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:sequenceFlow id="SequenceFlow_038lb9m" name="Yes" sourceRef="ExclusiveGateway_0elbczl" targetRef="Activity_1mh10j4" /> + <bpmn:sequenceFlow id="SequenceFlow_1t19ips" sourceRef="CallActivity_1bnkmaz" targetRef="ScriptTask_0l3d1ai" /> + <bpmn:sequenceFlow id="SequenceFlow_0mlrlbv" sourceRef="CallActivity_0cxst1i" targetRef="ExclusiveGateway_18eld2o" /> + <bpmn:sequenceFlow id="SequenceFlow_1c6ka9h" name="No" sourceRef="ExclusiveGateway_18eld2o" targetRef="EndEvent_0x406rw" /> + <bpmn:sequenceFlow id="SequenceFlow_0n4xku8" name="Yes" sourceRef="ExclusiveGateway_18eld2o" targetRef="ScriptTask_19uxoi8"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("WorkflowException") == null}</bpmn:conditionExpression> + </bpmn:sequenceFlow> + <bpmn:sequenceFlow id="SequenceFlow_0t094g7" sourceRef="ScriptTask_1xxag1o" targetRef="Activity_14an583" /> + <bpmn:sequenceFlow id="SequenceFlow_1qv8qw1" sourceRef="ScriptTask_1ssh2l9" targetRef="Activity_1xko5pk" /> + <bpmn:sequenceFlow id="SequenceFlow_0q7yc2c" sourceRef="ScriptTask_0o2r07o" targetRef="CallActivity_1bnkmaz" /> + <bpmn:sequenceFlow id="SequenceFlow_0h2oree" sourceRef="ScriptTask_08wim95" targetRef="Activity_187hs2t" /> + <bpmn:sequenceFlow id="SequenceFlow_1bevt3a" sourceRef="IntermediateCatchEvent_0pkvfun" targetRef="CallActivity_0cxst1i" /> + <bpmn:sequenceFlow id="SequenceFlow_1fk37v7" sourceRef="IntermediateCatchEvent_0vilb24" targetRef="ScriptTask_08wim95" /> + <bpmn:sequenceFlow id="SequenceFlow_0jrclmc" sourceRef="ScriptTask_0l3d1ai" targetRef="IntermediateThrowEvent_1ex8ke9" /> + <bpmn:scriptTask id="ScriptTask_19uxoi8" name="Update AAI Status" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0n4xku8</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0kixzdj</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +execution.setVariable("orchestrationStatus", "allocated") +def runScript = new TnAllocateNssi() +runScript.updateAAIOrchStatus(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_0kixzdj" sourceRef="ScriptTask_19uxoi8" targetRef="ScriptTask_1ssh2l9" /> + <bpmn:scriptTask id="Activity_1mh10j4" name="Prepare Update Resource Oper Status(finish)" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_038lb9m</bpmn:incoming> + <bpmn:outgoing>Flow_1853sgs</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new TnAllocateNssi() +runScript.prepareUpdateJobStatus(execution,"finished","100","Allocated TN NSSI successfully")</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="Flow_1853sgs" sourceRef="Activity_1mh10j4" targetRef="Activity_124z7q2" /> + <bpmn:callActivity id="Activity_187hs2t" name="Handle TN NSSI Selection OOF request" calledElement="DoHandleOofRequest"> + <bpmn:extensionElements> + <camunda:in source="nssiSelection_Url" target="apiPath" /> + <camunda:in source="nssiSelection_correlator" target="correlator" /> + <camunda:in source="nssiSelection_messageType" target="messageType" /> + <camunda:in source="nssiSelection_timeout" target="timeout" /> + <camunda:in source="nssiSelection_oofRequest" target="oofRequest" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="asyncCallbackResponse" target="nssiSelection_asyncCallbackResponse" /> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_0h2oree</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1cv0wop</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:serviceTask id="Activity_124z7q2" name="Update Resource Operation Status"> + <bpmn:extensionElements> + <camunda:connector> + <camunda:inputOutput> + <camunda:inputParameter name="url">${dbAdapterEndpoint}</camunda:inputParameter> + <camunda:inputParameter name="headers"> + <camunda:map> + <camunda:entry key="content-type">application/soap+xml</camunda:entry> + <camunda:entry key="Authorization">Basic YnBlbDpwYXNzd29yZDEk</camunda:entry> + </camunda:map> + </camunda:inputParameter> + <camunda:inputParameter name="payload">${updateResourceOperationStatus}</camunda:inputParameter> + <camunda:inputParameter name="method">POST</camunda:inputParameter> + <camunda:outputParameter name="NSSMF_dbResponseCode">${statusCode}</camunda:outputParameter> + <camunda:outputParameter name="NSSMF_dbResponse">${response}</camunda:outputParameter> + </camunda:inputOutput> + <camunda:connectorId>http-connector</camunda:connectorId> + </camunda:connector> + </bpmn:extensionElements> + <bpmn:incoming>Flow_1853sgs</bpmn:incoming> + <bpmn:outgoing>Flow_0pbq5q0</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="Flow_0pbq5q0" sourceRef="Activity_124z7q2" targetRef="EndEvent_1oouvuh" /> + <bpmn:serviceTask id="Activity_14an583" name="Update Resource Operation Status"> + <bpmn:extensionElements> + <camunda:connector> + <camunda:inputOutput> + <camunda:inputParameter name="url">${dbAdapterEndpoint}</camunda:inputParameter> + <camunda:inputParameter name="headers"> + <camunda:map> + <camunda:entry key="content-type">application/soap+xml</camunda:entry> + <camunda:entry key="Authorization">Basic YnBlbDpwYXNzd29yZDEk</camunda:entry> + </camunda:map> + </camunda:inputParameter> + <camunda:inputParameter name="payload">${updateResourceOperationStatus}</camunda:inputParameter> + <camunda:inputParameter name="method">POST</camunda:inputParameter> + <camunda:outputParameter name="NSSMF_dbResponseCode">${statusCode}</camunda:outputParameter> + <camunda:outputParameter name="NSSMF_dbResponse">${response}</camunda:outputParameter> + </camunda:inputOutput> + <camunda:connectorId>http-connector</camunda:connectorId> + </camunda:connector> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_0t094g7</bpmn:incoming> + <bpmn:outgoing>Flow_1k88aak</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="Flow_1k88aak" sourceRef="Activity_14an583" targetRef="ScriptTask_0o2r07o" /> + <bpmn:serviceTask id="Activity_1xko5pk" name="Update Resource Operation Status"> + <bpmn:extensionElements> + <camunda:connector> + <camunda:inputOutput> + <camunda:inputParameter name="url">${dbAdapterEndpoint}</camunda:inputParameter> + <camunda:inputParameter name="headers"> + <camunda:map> + <camunda:entry key="content-type">application/soap+xml</camunda:entry> + <camunda:entry key="Authorization">Basic YnBlbDpwYXNzd29yZDEk</camunda:entry> + </camunda:map> + </camunda:inputParameter> + <camunda:inputParameter name="payload">${updateResourceOperationStatus}</camunda:inputParameter> + <camunda:inputParameter name="method">POST</camunda:inputParameter> + <camunda:outputParameter name="NSSMF_dbResponseCode">${statusCode}</camunda:outputParameter> + <camunda:outputParameter name="NSSMF_dbResponse">${response}</camunda:outputParameter> + </camunda:inputOutput> + <camunda:connectorId>http-connector</camunda:connectorId> + </camunda:connector> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_1qv8qw1</bpmn:incoming> + <bpmn:outgoing>Flow_06rrcwf</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="Flow_06rrcwf" sourceRef="Activity_1xko5pk" targetRef="EndEvent_05h01gx" /> + </bpmn:process> + <bpmn:message id="Message_0c4b2r5" name="SliceServiceTask" /> + <bpmn:error id="Error_03akl5v" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> + <bpmn:error id="Error_0p2naox" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoAllocateTransportNSSI"> + <bpmndi:BPMNEdge id="Flow_06rrcwf_di" bpmnElement="Flow_06rrcwf"> + <di:waypoint x="1140" y="680" /> + <di:waypoint x="1252" y="680" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1k88aak_di" bpmnElement="Flow_1k88aak"> + <di:waypoint x="750" y="121" /> + <di:waypoint x="850" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0pbq5q0_di" bpmnElement="Flow_0pbq5q0"> + <di:waypoint x="1460" y="500" /> + <di:waypoint x="1562" y="500" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1853sgs_di" bpmnElement="Flow_1853sgs"> + <di:waypoint x="1270" y="500" /> + <di:waypoint x="1360" y="500" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0kixzdj_di" bpmnElement="SequenceFlow_0kixzdj"> + <di:waypoint x="770" y="680" /> + <di:waypoint x="860" y="680" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0jrclmc_di" bpmnElement="SequenceFlow_0jrclmc"> + <di:waypoint x="1420" y="121" /> + <di:waypoint x="1532" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1fk37v7_di" bpmnElement="SequenceFlow_1fk37v7"> + <di:waypoint x="214" y="330" /> + <di:waypoint x="320" y="330" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1bevt3a_di" bpmnElement="SequenceFlow_1bevt3a"> + <di:waypoint x="228" y="680" /> + <di:waypoint x="320" y="680" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0h2oree_di" bpmnElement="SequenceFlow_0h2oree"> + <di:waypoint x="420" y="330" /> + <di:waypoint x="540" y="330" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0q7yc2c_di" bpmnElement="SequenceFlow_0q7yc2c"> + <di:waypoint x="950" y="121" /> + <di:waypoint x="1090" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1qv8qw1_di" bpmnElement="SequenceFlow_1qv8qw1"> + <di:waypoint x="960" y="680" /> + <di:waypoint x="1040" y="680" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0t094g7_di" bpmnElement="SequenceFlow_0t094g7"> + <di:waypoint x="568" y="121" /> + <di:waypoint x="650" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0n4xku8_di" bpmnElement="SequenceFlow_0n4xku8"> + <di:waypoint x="538" y="680" /> + <di:waypoint x="670" y="680" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="585" y="662" width="19" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1c6ka9h_di" bpmnElement="SequenceFlow_1c6ka9h"> + <di:waypoint x="513" y="705" /> + <di:waypoint x="513" y="762" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="522" y="705" width="14" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0mlrlbv_di" bpmnElement="SequenceFlow_0mlrlbv"> + <di:waypoint x="420" y="680" /> + <di:waypoint x="488" y="680" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1t19ips_di" bpmnElement="SequenceFlow_1t19ips"> + <di:waypoint x="1190" y="121" /> + <di:waypoint x="1320" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_038lb9m_di" bpmnElement="SequenceFlow_038lb9m"> + <di:waypoint x="1090" y="355" /> + <di:waypoint x="1090" y="500" /> + <di:waypoint x="1170" y="500" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1100" y="413" width="19" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_12t5exy_di" bpmnElement="SequenceFlow_12t5exy"> + <di:waypoint x="1115" y="330" /> + <di:waypoint x="1292" y="330" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1183" y="313" width="14" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_197cm2e_di" bpmnElement="SequenceFlow_197cm2e"> + <di:waypoint x="890" y="330" /> + <di:waypoint x="1065" y="330" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1cv0wop_di" bpmnElement="SequenceFlow_1cv0wop"> + <di:waypoint x="640" y="330" /> + <di:waypoint x="790" y="330" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_07e12rt_di" bpmnElement="SequenceFlow_07e12rt"> + <di:waypoint x="385" y="121" /> + <di:waypoint x="468" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_03s744c_di" bpmnElement="SequenceFlow_03s744c"> + <di:waypoint x="214" y="121" /> + <di:waypoint x="285" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_1nbljfd_di" bpmnElement="StartEvent_1nbljfd"> + <dc:Bounds x="178" y="103" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="158" y="146" width="86" height="40" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="IntermediateCatchEvent_0vilb24_di" bpmnElement="IntermediateCatchEvent_0vilb24"> + <dc:Bounds x="178" y="312" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="162" y="355" width="71" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1tc44ge_di" bpmnElement="ScriptTask_1tc44ge"> + <dc:Bounds x="285" y="81" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1jgtb0y_di" bpmnElement="ScriptTask_1jgtb0y"> + <dc:Bounds x="790" y="290" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_0elbczl_di" bpmnElement="ExclusiveGateway_0elbczl" isMarkerVisible="true"> + <dc:Bounds x="1065" y="305" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1050" y="276" width="79" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_0l3d1ai_di" bpmnElement="ScriptTask_0l3d1ai"> + <dc:Bounds x="1320" y="81" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_18eld2o_di" bpmnElement="ExclusiveGateway_18eld2o" isMarkerVisible="true"> + <dc:Bounds x="488" y="655" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="482.5" y="617.5" width="61" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_0x406rw_di" bpmnElement="EndEvent_0x406rw"> + <dc:Bounds x="495" y="762" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="SubProcess_1yv9i68_di" bpmnElement="SubProcess_1yv9i68" isExpanded="true"> + <dc:Bounds x="685" y="1080" width="781" height="196" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_08mlzwz_di" bpmnElement="SequenceFlow_08mlzwz"> + <di:waypoint x="1079" y="1184" /> + <di:waypoint x="1353" y="1184" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1w67v6s_di" bpmnElement="SequenceFlow_1w67v6s"> + <di:waypoint x="751" y="1184" /> + <di:waypoint x="979" y="1184" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_1omdx56_di" bpmnElement="StartEvent_1omdx56"> + <dc:Bounds x="715" y="1166" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1jx3026_di" bpmnElement="EndEvent_1jx3026"> + <dc:Bounds x="1353" y="1166" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1swzdpw_di" bpmnElement="ScriptTask_1swzdpw"> + <dc:Bounds x="979" y="1144" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_05h01gx_di" bpmnElement="EndEvent_05h01gx"> + <dc:Bounds x="1252" y="662" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1260" y="705" width="20" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1xxag1o_di" bpmnElement="ScriptTask_1xxag1o"> + <dc:Bounds x="468" y="81" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="IntermediateThrowEvent_1ex8ke9_di" bpmnElement="IntermediateThrowEvent_1ex8ke9"> + <dc:Bounds x="1532" y="103" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1522" y="144" width="74" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1ssh2l9_di" bpmnElement="ScriptTask_1ssh2l9"> + <dc:Bounds x="860" y="640" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="CallActivity_1bnkmaz_di" bpmnElement="CallActivity_1bnkmaz"> + <dc:Bounds x="1090" y="81" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_0o2r07o_di" bpmnElement="ScriptTask_0o2r07o"> + <dc:Bounds x="850" y="81" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_08wim95_di" bpmnElement="ScriptTask_08wim95"> + <dc:Bounds x="320" y="290" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="IntermediateCatchEvent_0pkvfun_di" bpmnElement="IntermediateCatchEvent_0pkvfun"> + <dc:Bounds x="192" y="662" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="173" y="705" width="86" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="IntermediateThrowEvent_0ktwpki_di" bpmnElement="IntermediateThrowEvent_0ktwpki"> + <dc:Bounds x="1292" y="312" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1280" y="353" width="84" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1oouvuh_di" bpmnElement="EndEvent_1oouvuh"> + <dc:Bounds x="1562" y="482" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1570" y="525" width="20" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="CallActivity_0cxst1i_di" bpmnElement="CallActivity_0cxst1i"> + <dc:Bounds x="320" y="640" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_19uxoi8_di" bpmnElement="ScriptTask_19uxoi8"> + <dc:Bounds x="670" y="640" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1mh10j4_di" bpmnElement="Activity_1mh10j4"> + <dc:Bounds x="1170" y="460" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_187hs2t_di" bpmnElement="Activity_187hs2t"> + <dc:Bounds x="540" y="290" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_124z7q2_di" bpmnElement="Activity_124z7q2"> + <dc:Bounds x="1360" y="460" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_14an583_di" bpmnElement="Activity_14an583"> + <dc:Bounds x="650" y="81" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1xko5pk_di" bpmnElement="Activity_1xko5pk"> + <dc:Bounds x="1040" y="640" width="100" height="80" /> + </bpmndi:BPMNShape> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn new file mode 100644 index 0000000000..e9cbbb77cc --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateTnNssiInstance.bpmn @@ -0,0 +1,179 @@ +<?xml version="1.0" encoding="UTF-8"?> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1"> + <bpmn:process id="DoCreateTnNssiInstance" name="DoCreateTnNssiInstance" isExecutable="true"> + <bpmn:startEvent id="allocateTnNssi_StartEvent" name="allocateTnNssi_StartEvent"> + <bpmn:outgoing>SequenceFlow_1qo2pln</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:sequenceFlow id="SequenceFlow_1qo2pln" sourceRef="allocateTnNssi_StartEvent" targetRef="PreprocessIncomingRequest_task" /> + <bpmn:sequenceFlow id="SequenceFlow_0khtova" sourceRef="PreprocessIncomingRequest_task" targetRef="instantiate_NSTask" /> + <bpmn:scriptTask id="PreprocessIncomingRequest_task" name="Preprocess Incoming Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1qo2pln</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0khtova</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def dcsi = new DoCreateTnNssiInstance() +dcsi.preProcessRequest(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:scriptTask id="instantiate_NSTask" name="create Service Instance in AAI" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0khtova</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0g5bwvl</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def dcsi = new DoCreateTnNssiInstance() +dcsi.createServiceInstance(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_1uiz85h" sourceRef="Activity_16luyg1" targetRef="Event_1rsf7yb" /> + <bpmn:sequenceFlow id="SequenceFlow_0g5bwvl" sourceRef="instantiate_NSTask" targetRef="Activity_08tw2di" /> + <bpmn:scriptTask id="ScriptTask_18rzwzb" name="Create Allottedsource in AAI" scriptFormat="groovy"> + <bpmn:incoming>Flow_106ei42</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_17u69c4</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def dcsi = new DoCreateTnNssiInstance() +dcsi.createAllottedResource(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_17u69c4" sourceRef="ScriptTask_18rzwzb" targetRef="Event_1a9swwa" /> + <bpmn:intermediateCatchEvent id="Event_0l9vk9p" name="Start SDNC Operation"> + <bpmn:outgoing>Flow_1c8zr59</bpmn:outgoing> + <bpmn:linkEventDefinition id="LinkEventDefinition_0uwmpn2" name="SdncOperation" /> + </bpmn:intermediateCatchEvent> + <bpmn:scriptTask id="Activity_0eh82ds" name="PreProcess SDNC Allocate TN NSSI Request" scriptFormat="groovy"> + <bpmn:incoming>Flow_1c8zr59</bpmn:incoming> + <bpmn:outgoing>Flow_0pko5tm</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def dcsi = new DoCreateTnNssiInstance() +dcsi.preprocessSdncAllocateTnNssiRequest(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:callActivity id="Activity_1fs2182" name="Call SDNC Adapter: Allocate TN NSSI" calledElement="sdncAdapter"> + <bpmn:extensionElements> + <camunda:in source="TNNSSMF_SDNCRequest" target="sdncAdapterWorkflowRequest" /> + <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" /> + <camunda:in source="mso-request-id" target="mso-request-id" /> + <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="sdncAdapterResponse" target="TNNSSMF_SDNCAdapterResponse" /> + <camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" /> + </bpmn:extensionElements> + <bpmn:incoming>Flow_0pko5tm</bpmn:incoming> + <bpmn:outgoing>Flow_11kadz7</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:scriptTask id="Activity_16luyg1" name="Postprocess SDNC Allocate TN NSSI Request" scriptFormat="groovy"> + <bpmn:incoming>Flow_11kadz7</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1uiz85h</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* + +String response = execution.getVariable("TNNSSMF_SDNCAdapterResponse") + +def dcsi = new DoCreateTnNssiInstance() +dcsi.validateSDNCResponse(execution, response, "allocate")</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="Flow_1c8zr59" name="" sourceRef="Event_0l9vk9p" targetRef="Activity_0eh82ds" /> + <bpmn:sequenceFlow id="Flow_0pko5tm" name="" sourceRef="Activity_0eh82ds" targetRef="Activity_1fs2182" /> + <bpmn:sequenceFlow id="Flow_11kadz7" name="" sourceRef="Activity_1fs2182" targetRef="Activity_16luyg1" /> + <bpmn:endEvent id="Event_1rsf7yb"> + <bpmn:incoming>SequenceFlow_1uiz85h</bpmn:incoming> + </bpmn:endEvent> + <bpmn:intermediateThrowEvent id="Event_1a9swwa" name="Goto SDNC operation"> + <bpmn:incoming>SequenceFlow_17u69c4</bpmn:incoming> + <bpmn:linkEventDefinition id="LinkEventDefinition_1skl6p7" name="SdncOperation" /> + </bpmn:intermediateThrowEvent> + <bpmn:scriptTask id="Activity_08tw2di" name="create Slice Profile in AAI" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0g5bwvl</bpmn:incoming> + <bpmn:outgoing>Flow_106ei42</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def dcsi = new DoCreateTnNssiInstance() +dcsi.createSliceProfile(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="Flow_106ei42" sourceRef="Activity_08tw2di" targetRef="ScriptTask_18rzwzb" /> + </bpmn:process> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoCreateTnNssiInstance"> + <bpmndi:BPMNEdge id="Flow_11kadz7_di" bpmnElement="Flow_11kadz7"> + <di:waypoint x="610" y="375" /> + <di:waypoint x="719" y="375" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0pko5tm_di" bpmnElement="Flow_0pko5tm"> + <di:waypoint x="420" y="375" /> + <di:waypoint x="489" y="375" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1c8zr59_di" bpmnElement="Flow_1c8zr59"> + <di:waypoint x="211" y="375" /> + <di:waypoint x="299" y="375" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_17u69c4_di" bpmnElement="SequenceFlow_17u69c4"> + <di:waypoint x="930" y="129" /> + <di:waypoint x="1102" y="129" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0g5bwvl_di" bpmnElement="SequenceFlow_0g5bwvl"> + <di:waypoint x="574" y="129" /> + <di:waypoint x="650" y="129" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1uiz85h_di" bpmnElement="SequenceFlow_1uiz85h"> + <di:waypoint x="840" y="375" /> + <di:waypoint x="972" y="375" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="631" y="108" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0khtova_di" bpmnElement="SequenceFlow_0khtova"> + <di:waypoint x="393" y="129" /> + <di:waypoint x="474" y="129" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="436" y="108" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1qo2pln_di" bpmnElement="SequenceFlow_1qo2pln"> + <di:waypoint x="211" y="129" /> + <di:waypoint x="251" y="129" /> + <di:waypoint x="251" y="129" /> + <di:waypoint x="293" y="129" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="266" y="123" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_106ei42_di" bpmnElement="Flow_106ei42"> + <di:waypoint x="750" y="129" /> + <di:waypoint x="830" y="129" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="allocateTnNssi_StartEvent"> + <dc:Bounds x="175" y="111" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="153" y="147" width="86" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_03j6ogo_di" bpmnElement="PreprocessIncomingRequest_task"> + <dc:Bounds x="293" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1qmmew8_di" bpmnElement="instantiate_NSTask"> + <dc:Bounds x="474" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Event_0l9vk9p_di" bpmnElement="Event_0l9vk9p"> + <dc:Bounds x="175" y="357" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="165" y="400" width="58" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0eh82ds_di" bpmnElement="Activity_0eh82ds"> + <dc:Bounds x="299" y="328" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1fs2182_di" bpmnElement="Activity_1fs2182"> + <dc:Bounds x="489" y="328" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_16luyg1_di" bpmnElement="Activity_16luyg1"> + <dc:Bounds x="719" y="328" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Event_1rsf7yb_di" bpmnElement="Event_1rsf7yb"> + <dc:Bounds x="972" y="357" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Event_1a9swwa_di" bpmnElement="Event_1a9swwa"> + <dc:Bounds x="1102" y="111" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1093" y="154" width="59" height="27" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_18rzwzb_di" bpmnElement="ScriptTask_18rzwzb"> + <dc:Bounds x="830" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_08tw2di_di" bpmnElement="Activity_08tw2di"> + <dc:Bounds x="650" y="89" width="100" height="80" /> + </bpmndi:BPMNShape> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn new file mode 100644 index 0000000000..a800289aaa --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeallocateTransportNSSI.bpmn @@ -0,0 +1,221 @@ +<?xml version="1.0" encoding="UTF-8"?> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1wio50w" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1"> + <bpmn:process id="DoDeallocateTransportNSSI" name="DoDeallocateTransportNSSI" isExecutable="true"> + <bpmn:startEvent id="StartEvent_1nbljfd" name="Create Deallocate TN NSSMF Work Flow"> + <bpmn:outgoing>SequenceFlow_03s744c</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:subProcess id="SubProcess_1yv9i68" name="Sub-process for FalloutHandler and Rollback" triggeredByEvent="true"> + <bpmn:startEvent id="StartEvent_1omdx56"> + <bpmn:outgoing>SequenceFlow_1w67v6s</bpmn:outgoing> + <bpmn:errorEventDefinition id="ErrorEventDefinition_06xcioh" /> + </bpmn:startEvent> + <bpmn:endEvent id="EndEvent_1jx3026"> + <bpmn:incoming>SequenceFlow_08mlzwz</bpmn:incoming> + </bpmn:endEvent> + <bpmn:scriptTask id="ScriptTask_1swzdpw" name="Handle Unexpected Error" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1w67v6s</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_08mlzwz</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.common.scripts.* +ExceptionUtil ex = new ExceptionUtil() +ex.processJavaException(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_1w67v6s" sourceRef="StartEvent_1omdx56" targetRef="ScriptTask_1swzdpw" /> + <bpmn:sequenceFlow id="SequenceFlow_08mlzwz" sourceRef="ScriptTask_1swzdpw" targetRef="EndEvent_1jx3026" /> + </bpmn:subProcess> + <bpmn:endEvent id="EndEvent_05h01gx" name="End"> + <bpmn:incoming>Flow_0ca4l8d</bpmn:incoming> + </bpmn:endEvent> + <bpmn:scriptTask id="ScriptTask_1ssh2l9" name="Prepare Update Resource Oper Status((finish)" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0kixzdj</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1qv8qw1</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new TnAllocateNssi() +runScript.prepareUpdateJobStatus(execution,"finished","100","Deallocated TN NSSI successfully")</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_03s744c" sourceRef="StartEvent_1nbljfd" targetRef="ScriptTask_1tc44ge" /> + <bpmn:sequenceFlow id="SequenceFlow_1qv8qw1" sourceRef="ScriptTask_1ssh2l9" targetRef="Activity_0rgeefb" /> + <bpmn:scriptTask id="ScriptTask_19uxoi8" name="Update AAI Status" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1jygjln</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0kixzdj</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +execution.setVariable("orchestrationStatus", "deallocated") +def runScript = new DoDeallocateTnNssi() +runScript.updateAAIOrchStatus(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_0kixzdj" sourceRef="ScriptTask_19uxoi8" targetRef="ScriptTask_1ssh2l9" /> + <bpmn:scriptTask id="Activity_1tw8eyy" name="PreProcess SDNC Deallocate TN NSSI Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_07e12rt</bpmn:incoming> + <bpmn:outgoing>Flow_0cpctye</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new DoDeallocateTnNssi() +runScript.preprocessSdncDeallocateTnNssiRequest(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="Flow_0cpctye" sourceRef="Activity_1tw8eyy" targetRef="Activity_0p20esb" /> + <bpmn:callActivity id="Activity_0p20esb" name="Call SDNC Adapter: Deallocate TN NSSI" calledElement="sdncAdapter"> + <bpmn:extensionElements> + <camunda:in source="TNNSSMF_SDNCRequest" target="sdncAdapterWorkflowRequest" /> + <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" /> + <camunda:in source="mso-request-id" target="mso-request-id" /> + <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="sdncAdapterResponse" target="TNNSSMF_SDNCAdapterResponse" /> + <camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" /> + </bpmn:extensionElements> + <bpmn:incoming>Flow_0cpctye</bpmn:incoming> + <bpmn:outgoing>Flow_0fuabjs</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="Flow_0fuabjs" sourceRef="Activity_0p20esb" targetRef="Activity_0phv8e5" /> + <bpmn:scriptTask id="Activity_0phv8e5" name="Postprocess SDNC Deallocate TN NSSI Request" scriptFormat="groovy"> + <bpmn:incoming>Flow_0fuabjs</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1jdb2oq</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* + +String response = execution.getVariable("TNNSSMF_SDNCAdapterResponse") + +def runScript = new DoDeallocateTnNssi() +runScript.validateSDNCResponse(execution, response, "deallocate")</bpmn:script> + </bpmn:scriptTask> + <bpmn:scriptTask id="Activity_013rjwc" name="Delete Service Instance (TN NSSI) in AAI" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1jdb2oq</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1jygjln</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new DoDeallocateTnNssi() +runScript.deleteServiceInstance(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_1jdb2oq" sourceRef="Activity_0phv8e5" targetRef="Activity_013rjwc" /> + <bpmn:scriptTask id="ScriptTask_1tc44ge" name="PreProcess Incoming Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_03s744c</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_07e12rt</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new DoDeallocateTnNssi() +runScript.preProcessRequest(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_07e12rt" sourceRef="ScriptTask_1tc44ge" targetRef="Activity_1tw8eyy" /> + <bpmn:sequenceFlow id="SequenceFlow_1jygjln" sourceRef="Activity_013rjwc" targetRef="ScriptTask_19uxoi8" /> + <bpmn:serviceTask id="Activity_0rgeefb" name="Update Resource Operation Status"> + <bpmn:extensionElements> + <camunda:connector> + <camunda:inputOutput> + <camunda:inputParameter name="url">${dbAdapterEndpoint}</camunda:inputParameter> + <camunda:inputParameter name="headers"> + <camunda:map> + <camunda:entry key="content-type">application/soap+xml</camunda:entry> + <camunda:entry key="Authorization">Basic YnBlbDpwYXNzd29yZDEk</camunda:entry> + </camunda:map> + </camunda:inputParameter> + <camunda:inputParameter name="payload">${updateResourceOperationStatus}</camunda:inputParameter> + <camunda:inputParameter name="method">POST</camunda:inputParameter> + <camunda:outputParameter name="NSSMF_dbResponseCode">${statusCode}</camunda:outputParameter> + <camunda:outputParameter name="NSSMF_dbResponse">${response}</camunda:outputParameter> + </camunda:inputOutput> + <camunda:connectorId>http-connector</camunda:connectorId> + </camunda:connector> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_1qv8qw1</bpmn:incoming> + <bpmn:outgoing>Flow_0ca4l8d</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="Flow_0ca4l8d" sourceRef="Activity_0rgeefb" targetRef="EndEvent_05h01gx" /> + </bpmn:process> + <bpmn:message id="Message_0c4b2r5" name="SliceServiceTask" /> + <bpmn:error id="Error_03akl5v" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> + <bpmn:error id="Error_0p2naox" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoDeallocateTransportNSSI"> + <bpmndi:BPMNEdge id="Flow_1jygjln_di" bpmnElement="SequenceFlow_1jygjln"> + <di:waypoint x="360" y="350" /> + <di:waypoint x="520" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_07e12rt_di" bpmnElement="SequenceFlow_07e12rt"> + <di:waypoint x="385" y="121" /> + <di:waypoint x="509" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1jdb2oq_di" bpmnElement="SequenceFlow_1jdb2oq"> + <di:waypoint x="1080" y="121" /> + <di:waypoint x="1220" y="121" /> + <di:waypoint x="1220" y="210" /> + <di:waypoint x="310" y="210" /> + <di:waypoint x="310" y="310" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0fuabjs_di" bpmnElement="Flow_0fuabjs"> + <di:waypoint x="850" y="121" /> + <di:waypoint x="959" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0cpctye_di" bpmnElement="Flow_0cpctye"> + <di:waypoint x="630" y="121" /> + <di:waypoint x="729" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0kixzdj_di" bpmnElement="SequenceFlow_0kixzdj"> + <di:waypoint x="620" y="350" /> + <di:waypoint x="740" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1qv8qw1_di" bpmnElement="SequenceFlow_1qv8qw1"> + <di:waypoint x="840" y="350" /> + <di:waypoint x="990" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_03s744c_di" bpmnElement="SequenceFlow_03s744c"> + <di:waypoint x="214" y="121" /> + <di:waypoint x="285" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_0ca4l8d_di" bpmnElement="Flow_0ca4l8d"> + <di:waypoint x="1090" y="350" /> + <di:waypoint x="1202" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_1nbljfd_di" bpmnElement="StartEvent_1nbljfd"> + <dc:Bounds x="178" y="103" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="166" y="146" width="70" height="53" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0rgeefb_di" bpmnElement="Activity_0rgeefb"> + <dc:Bounds x="990" y="310" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="SubProcess_1yv9i68_di" bpmnElement="SubProcess_1yv9i68" isExpanded="true"> + <dc:Bounds x="685" y="1080" width="781" height="196" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_08mlzwz_di" bpmnElement="SequenceFlow_08mlzwz"> + <di:waypoint x="1079" y="1184" /> + <di:waypoint x="1353" y="1184" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1w67v6s_di" bpmnElement="SequenceFlow_1w67v6s"> + <di:waypoint x="751" y="1184" /> + <di:waypoint x="979" y="1184" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_1omdx56_di" bpmnElement="StartEvent_1omdx56"> + <dc:Bounds x="715" y="1166" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1jx3026_di" bpmnElement="EndEvent_1jx3026"> + <dc:Bounds x="1353" y="1166" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1swzdpw_di" bpmnElement="ScriptTask_1swzdpw"> + <dc:Bounds x="979" y="1144" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_05h01gx_di" bpmnElement="EndEvent_05h01gx"> + <dc:Bounds x="1202" y="332" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1210" y="375" width="20" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1ssh2l9_di" bpmnElement="ScriptTask_1ssh2l9"> + <dc:Bounds x="740" y="310" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_19uxoi8_di" bpmnElement="ScriptTask_19uxoi8"> + <dc:Bounds x="520" y="310" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1tw8eyy_di" bpmnElement="Activity_1tw8eyy"> + <dc:Bounds x="509" y="74" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0p20esb_di" bpmnElement="Activity_0p20esb"> + <dc:Bounds x="729" y="74" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0phv8e5_di" bpmnElement="Activity_0phv8e5"> + <dc:Bounds x="959" y="74" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_013rjwc_di" bpmnElement="Activity_013rjwc"> + <dc:Bounds x="260" y="310" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1tc44ge_di" bpmnElement="ScriptTask_1tc44ge"> + <dc:Bounds x="285" y="81" width="100" height="80" /> + </bpmndi:BPMNShape> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyTransportNSSI.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyTransportNSSI.bpmn new file mode 100644 index 0000000000..d70bed68cb --- /dev/null +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoModifyTransportNSSI.bpmn @@ -0,0 +1,222 @@ +<?xml version="1.0" encoding="UTF-8"?> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1wio50w" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1"> + <bpmn:process id="DoModifyTransportNSSI" name="DoModifyTransportNSSI" isExecutable="true"> + <bpmn:startEvent id="StartEvent_1nbljfd" name="Create Modify TN NSSMF Work Flow"> + <bpmn:outgoing>SequenceFlow_03s744c</bpmn:outgoing> + </bpmn:startEvent> + <bpmn:subProcess id="SubProcess_1yv9i68" name="Sub-process for FalloutHandler and Rollback" triggeredByEvent="true"> + <bpmn:startEvent id="StartEvent_1omdx56"> + <bpmn:outgoing>SequenceFlow_1w67v6s</bpmn:outgoing> + <bpmn:errorEventDefinition id="ErrorEventDefinition_06xcioh" /> + </bpmn:startEvent> + <bpmn:endEvent id="EndEvent_1jx3026"> + <bpmn:incoming>SequenceFlow_08mlzwz</bpmn:incoming> + </bpmn:endEvent> + <bpmn:scriptTask id="ScriptTask_1swzdpw" name="Handle Unexpected Error" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1w67v6s</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_08mlzwz</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.common.scripts.* +ExceptionUtil ex = new ExceptionUtil() +ex.processJavaException(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_1w67v6s" sourceRef="StartEvent_1omdx56" targetRef="ScriptTask_1swzdpw" /> + <bpmn:sequenceFlow id="SequenceFlow_08mlzwz" sourceRef="ScriptTask_1swzdpw" targetRef="EndEvent_1jx3026" /> + </bpmn:subProcess> + <bpmn:endEvent id="EndEvent_05h01gx" name="End"> + <bpmn:incoming>Flow_1akxvak</bpmn:incoming> + </bpmn:endEvent> + <bpmn:scriptTask id="ScriptTask_1ssh2l9" name="Prepare Update Resource Oper Status((finish)" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_0kixzdj</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1qv8qw1</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new DoActivateTnNssi() +runScript.prepareUpdateJobStatus(execution,"finished","100","Modified TN NSSI successfully")</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_03s744c" sourceRef="StartEvent_1nbljfd" targetRef="ScriptTask_1tc44ge" /> + <bpmn:sequenceFlow id="SequenceFlow_1qv8qw1" sourceRef="ScriptTask_1ssh2l9" targetRef="Activity_0ziz3ti" /> + <bpmn:scriptTask id="ScriptTask_19uxoi8" name="Update AAI Status" scriptFormat="groovy"> + <bpmn:incoming>Flow_0h5rwlh</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0kixzdj</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +execution.setVariable("orchestrationStatus", "modified") +def runScript = new DoModifyTnNssi() +runScript.updateAAIOrchStatus(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_0kixzdj" sourceRef="ScriptTask_19uxoi8" targetRef="ScriptTask_1ssh2l9" /> + <bpmn:scriptTask id="Activity_0phv8e5" name="Modify TN NSSI in AAI" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_07e12rt</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_1jdb2oq</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* + +def runScript = new DoModifyTnNssi() +runScript.updateTnNssiInAAI(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_1jdb2oq" sourceRef="Activity_0phv8e5" targetRef="Activity_0h1vr2l" /> + <bpmn:scriptTask id="ScriptTask_1tc44ge" name="PreProcess Incoming Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_03s744c</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_07e12rt</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new DoModifyTnNssi() +runScript.preProcessRequest(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="SequenceFlow_07e12rt" sourceRef="ScriptTask_1tc44ge" targetRef="Activity_0phv8e5" /> + <bpmn:scriptTask id="Activity_0h1vr2l" name="PreProcess SDNC Modify TN NSSI Request" scriptFormat="groovy"> + <bpmn:incoming>SequenceFlow_1jdb2oq</bpmn:incoming> + <bpmn:outgoing>Flow_1dvo5ih</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* +def runScript = new DoModifyTnNssi() +runScript.preprocessSdncModifyTnNssiRequest(execution)</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="Flow_1dvo5ih" sourceRef="Activity_0h1vr2l" targetRef="Activity_14ab476" /> + <bpmn:callActivity id="Activity_14ab476" name="Call SDNC Adapter: Modify TN NSSI" calledElement="sdncAdapter"> + <bpmn:extensionElements> + <camunda:in source="TNNSSMF_SDNCRequest" target="sdncAdapterWorkflowRequest" /> + <camunda:in source="isDebugLogEnabled" target="isDebugLogEnabled" /> + <camunda:in source="mso-request-id" target="mso-request-id" /> + <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="sdncAdapterResponse" target="TNNSSMF_SDNCAdapterResponse" /> + <camunda:out source="SDNCA_SuccessIndicator" target="SDNCA_SuccessIndicator" /> + </bpmn:extensionElements> + <bpmn:incoming>Flow_1dvo5ih</bpmn:incoming> + <bpmn:outgoing>Flow_139j3yd</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="Flow_139j3yd" sourceRef="Activity_14ab476" targetRef="Activity_1vtz33q" /> + <bpmn:scriptTask id="Activity_1vtz33q" name="Postprocess SDNC Modify TN NSSI Request" scriptFormat="groovy"> + <bpmn:incoming>Flow_139j3yd</bpmn:incoming> + <bpmn:outgoing>Flow_0h5rwlh</bpmn:outgoing> + <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.* + +String response = execution.getVariable("TNNSSMF_SDNCAdapterResponse") + +def runScript = new DoModifyTnNssi() +runScript.validateSDNCResponse(execution, response, "modify")</bpmn:script> + </bpmn:scriptTask> + <bpmn:sequenceFlow id="Flow_0h5rwlh" sourceRef="Activity_1vtz33q" targetRef="ScriptTask_19uxoi8" /> + <bpmn:serviceTask id="Activity_0ziz3ti" name="Update Resource Operation Status"> + <bpmn:extensionElements> + <camunda:connector> + <camunda:inputOutput> + <camunda:inputParameter name="url">${dbAdapterEndpoint}</camunda:inputParameter> + <camunda:inputParameter name="headers"> + <camunda:map> + <camunda:entry key="content-type">application/soap+xml</camunda:entry> + <camunda:entry key="Authorization">Basic YnBlbDpwYXNzd29yZDEk</camunda:entry> + </camunda:map> + </camunda:inputParameter> + <camunda:inputParameter name="payload">${updateResourceOperationStatus}</camunda:inputParameter> + <camunda:inputParameter name="method">POST</camunda:inputParameter> + <camunda:outputParameter name="NSSMF_dbResponseCode">${statusCode}</camunda:outputParameter> + <camunda:outputParameter name="NSSMF_dbResponse">${response}</camunda:outputParameter> + </camunda:inputOutput> + <camunda:connectorId>http-connector</camunda:connectorId> + </camunda:connector> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_1qv8qw1</bpmn:incoming> + <bpmn:outgoing>Flow_1akxvak</bpmn:outgoing> + </bpmn:serviceTask> + <bpmn:sequenceFlow id="Flow_1akxvak" sourceRef="Activity_0ziz3ti" targetRef="EndEvent_05h01gx" /> + </bpmn:process> + <bpmn:message id="Message_0c4b2r5" name="SliceServiceTask" /> + <bpmn:error id="Error_03akl5v" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> + <bpmn:error id="Error_0p2naox" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DoModifyTransportNSSI"> + <bpmndi:BPMNEdge id="Flow_0h5rwlh_di" bpmnElement="Flow_0h5rwlh"> + <di:waypoint x="1240" y="121" /> + <di:waypoint x="1380" y="121" /> + <di:waypoint x="1380" y="210" /> + <di:waypoint x="335" y="210" /> + <di:waypoint x="335" y="310" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_139j3yd_di" bpmnElement="Flow_139j3yd"> + <di:waypoint x="1010" y="121" /> + <di:waypoint x="1119" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1dvo5ih_di" bpmnElement="Flow_1dvo5ih"> + <di:waypoint x="806" y="121" /> + <di:waypoint x="889" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_07e12rt_di" bpmnElement="SequenceFlow_07e12rt"> + <di:waypoint x="385" y="121" /> + <di:waypoint x="479" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1jdb2oq_di" bpmnElement="SequenceFlow_1jdb2oq"> + <di:waypoint x="600" y="121" /> + <di:waypoint x="685" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0kixzdj_di" bpmnElement="SequenceFlow_0kixzdj"> + <di:waypoint x="385" y="350" /> + <di:waypoint x="530" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1qv8qw1_di" bpmnElement="SequenceFlow_1qv8qw1"> + <di:waypoint x="630" y="350" /> + <di:waypoint x="740" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_03s744c_di" bpmnElement="SequenceFlow_03s744c"> + <di:waypoint x="214" y="121" /> + <di:waypoint x="285" y="121" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="Flow_1akxvak_di" bpmnElement="Flow_1akxvak"> + <di:waypoint x="840" y="350" /> + <di:waypoint x="1002" y="350" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_1nbljfd_di" bpmnElement="StartEvent_1nbljfd"> + <dc:Bounds x="178" y="103" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="161" y="146" width="86" height="40" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0ziz3ti_di" bpmnElement="Activity_0ziz3ti"> + <dc:Bounds x="740" y="310" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="SubProcess_1yv9i68_di" bpmnElement="SubProcess_1yv9i68" isExpanded="true"> + <dc:Bounds x="685" y="1080" width="781" height="196" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_08mlzwz_di" bpmnElement="SequenceFlow_08mlzwz"> + <di:waypoint x="1079" y="1184" /> + <di:waypoint x="1353" y="1184" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1w67v6s_di" bpmnElement="SequenceFlow_1w67v6s"> + <di:waypoint x="751" y="1184" /> + <di:waypoint x="979" y="1184" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="StartEvent_1omdx56_di" bpmnElement="StartEvent_1omdx56"> + <dc:Bounds x="715" y="1166" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_1jx3026_di" bpmnElement="EndEvent_1jx3026"> + <dc:Bounds x="1353" y="1166" width="36" height="36" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1swzdpw_di" bpmnElement="ScriptTask_1swzdpw"> + <dc:Bounds x="979" y="1144" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_05h01gx_di" bpmnElement="EndEvent_05h01gx"> + <dc:Bounds x="1002" y="332" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1010" y="375" width="20" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1ssh2l9_di" bpmnElement="ScriptTask_1ssh2l9"> + <dc:Bounds x="530" y="310" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_19uxoi8_di" bpmnElement="ScriptTask_19uxoi8"> + <dc:Bounds x="285" y="310" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0phv8e5_di" bpmnElement="Activity_0phv8e5"> + <dc:Bounds x="479" y="74" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ScriptTask_1tc44ge_di" bpmnElement="ScriptTask_1tc44ge"> + <dc:Bounds x="285" y="81" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_0h1vr2l_di" bpmnElement="Activity_0h1vr2l"> + <dc:Bounds x="685" y="74" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_14ab476_di" bpmnElement="Activity_14ab476"> + <dc:Bounds x="889" y="74" width="121" height="94" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="Activity_1vtz33q_di" bpmnElement="Activity_1vtz33q"> + <dc:Bounds x="1119" y="74" width="121" height="94" /> + </bpmndi:BPMNShape> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn:definitions> |