aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/groovy/org/onap
diff options
context:
space:
mode:
authorhetengjiao <hetengjiao@chinamobile.com>2020-09-25 16:17:33 +0800
committerhetengjiao <hetengjiao@chinamobile.com>2020-09-25 16:18:15 +0800
commit3e4d7035ff7fc105465840bfaec14da47f64b3aa (patch)
treeb2fd30b4e6d773cca3258ce91e899835318ac5a6 /bpmn/MSOCommonBPMN/src/main/groovy/org/onap
parent2505a543b0e45c1c3c2fe2fb8b85664b08bf2fca (diff)
Update NSMF workflow of allocate
Issue-ID: SO-2963 Signed-off-by: hetengjiao <hetengjiao@chinamobile.com> Change-Id: I4ab9272501a76c93e1c56d4bf0ed646699363ecb
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/groovy/org/onap')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy31
1 files changed, 31 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 44188b462b..bd70ee79b7 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
@@ -23,6 +23,7 @@
package org.onap.so.bpmn.common.scripts
import org.onap.so.beans.nsmf.oof.NsiReqBody
+import org.onap.so.beans.nsmf.oof.NssiReqBody
import org.onap.so.beans.nsmf.oof.RequestInfo
import org.onap.so.beans.nsmf.oof.SubnetCapability
import org.onap.so.beans.nsmf.oof.TemplateInfo
@@ -661,6 +662,7 @@ return json.toString()
List<SubnetCapability> subnetCapabilities, Integer timeOut){
def transactionId = requestId
+ String correlator = requestId
logger.debug( "transactionId is: " + transactionId)
String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
@@ -686,4 +688,33 @@ return json.toString()
return objectMapper.writeValueAsString(nsiReqBody)
}
+
+ public <T> String buildSelectNSSIRequest(String requestId, TemplateInfo nsstInfo, String messageType,
+ T sliceProfile, Integer timeOut){
+
+ def transactionId = requestId
+ String correlator = requestId
+ logger.debug( "transactionId is: " + transactionId)
+
+ String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
+
+ NssiReqBody nssiReqBody = new NssiReqBody()
+
+ RequestInfo requestInfo = new RequestInfo()
+ requestInfo.setRequestId(requestId)
+ requestInfo.setTransactionId(transactionId)
+ requestInfo.setCallbackUrl(callbackUrl)
+ requestInfo.setSourceId("so")
+ requestInfo.setTimeout(timeOut)
+ //requestInfo.setNumSolutions()
+
+ nssiReqBody.setRequestInfo(requestInfo)
+ nssiReqBody.setSliceProfile(sliceProfile)
+ nssiReqBody.setNSSTInfo(nsstInfo)
+
+
+ ObjectMapper objectMapper = new ObjectMapper()
+
+ return objectMapper.writeValueAsString(nssiReqBody)
+ }
}