summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuanyu Chen <chenchuanyu@huawei.com>2020-03-04 07:36:24 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-04 07:36:24 +0000
commit2505c09848cf548d20bc53970c114c5a94c7f42d (patch)
treece65facfd1c81f1d4fbe6e354ebd4ee07403be2e
parent7efebc4bbf823699b8462636a58b0af09520e1e6 (diff)
parentcfd82c988c78f909115f7af76b374d348944d7e8 (diff)
Merge "Add method to prepare OOF request body for NST selection"
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy21
1 files changed, 21 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 606b97bec2..34cbb00735 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,7 @@
package org.onap.so.bpmn.common.scripts
+import com.fasterxml.jackson.databind.ObjectMapper
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
import org.onap.so.bpmn.common.scripts.ExceptionUtil
@@ -529,4 +530,24 @@ class OofUtils {
return UriBuilder.fromPath("").host(msbHost).port(msbPort).scheme("http").build().toString()
}
+
+ public String buildSelectNSTRequest(String requestId, Map<String, Object> profileInfo) {
+ def transactionId = requestId
+ logger.debug( "transactionId is: " + transactionId)
+ ObjectMapper objectMapper = new ObjectMapper()
+ String json = objectMapper.writeValueAsString(profileInfo)
+ StringBuilder response = new StringBuilder()
+ response.append(
+ "{\n" +
+ " \"requestInfo\": {\n" +
+ " \"transactionId\": \"${transactionId}\",\n" +
+ " \"requestId\": \"${requestId}\",\n" +
+ " \"sourceId\": \"so\",\n" +
+ " \"timeout\": 600\n" +
+ " },\n")
+ response.append(",\n \"serviceInfo\": \n")
+ response.append(json);
+ response.append("\n }\n")
+ return response.toString()
+ }
}