aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN
diff options
context:
space:
mode:
authorhetengjiao <hetengjiao@chinamobile.com>2020-09-18 10:08:26 +0800
committerhetengjiao <hetengjiao@chinamobile.com>2020-09-18 16:02:55 +0800
commit177987a9c3bc89a61e211f0fa31781f7abdc3ce8 (patch)
treee45d266b6eda77c403454f08712c4a7b5d3311a5 /bpmn/MSOCommonBPMN
parent27d9076c191384779c76151c119c69e763bc6c35 (diff)
Update NSMF workflow to for the E2E Network Slicing requirements
Issue-ID: SO-2963 Signed-off-by: hetengjiao <hetengjiao@chinamobile.com> Change-Id: Ic792896cc3e7b23f02fd7f8b8305402271eb0d78
Diffstat (limited to 'bpmn/MSOCommonBPMN')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy36
1 files changed, 36 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
index 040fc26f23..44188b462b 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
@@ -22,6 +22,11 @@
package org.onap.so.bpmn.common.scripts
+import org.onap.so.beans.nsmf.oof.NsiReqBody
+import org.onap.so.beans.nsmf.oof.RequestInfo
+import org.onap.so.beans.nsmf.oof.SubnetCapability
+import org.onap.so.beans.nsmf.oof.TemplateInfo
+
import static org.onap.so.bpmn.common.scripts.GenericUtils.*
import javax.ws.rs.core.UriBuilder
@@ -650,4 +655,35 @@ json.add("requestInfo", requestInfo)
return json.toString()
}
+
+ public String buildSelectNSIRequest(String requestId, TemplateInfo nstInfo, List<TemplateInfo> nsstInfo,
+ String messageType, Map<String, Object> serviceProfile,
+ List<SubnetCapability> subnetCapabilities, Integer timeOut){
+
+ def transactionId = requestId
+ logger.debug( "transactionId is: " + transactionId)
+
+ String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
+
+ NsiReqBody nsiReqBody = new NsiReqBody()
+
+ RequestInfo requestInfo = new RequestInfo()
+ requestInfo.setRequestId(requestId)
+ requestInfo.setTransactionId(transactionId)
+ requestInfo.setCallbackUrl(callbackUrl)
+ requestInfo.setSourceId("so")
+ requestInfo.setTimeout(timeOut)
+ //requestInfo.setNumSolutions()
+
+ nsiReqBody.setRequestInfo(requestInfo)
+ nsiReqBody.setNSTInfo(nstInfo)
+ nsiReqBody.setServiceProfile(serviceProfile)
+ nsiReqBody.setSubnetCapabilities(subnetCapabilities)
+ nsiReqBody.setNSSTInfo(nsstInfo)
+
+
+ ObjectMapper objectMapper = new ObjectMapper()
+
+ return objectMapper.writeValueAsString(nsiReqBody)
+ }
}