diff options
author | Harry Huang <huangxiangyu5@huawei.com> | 2020-03-04 11:23:03 +0800 |
---|---|---|
committer | Harry Huang <huangxiangyu5@huawei.com> | 2020-03-04 11:23:03 +0800 |
commit | cfd82c988c78f909115f7af76b374d348944d7e8 (patch) | |
tree | b2708707e05250beed6963d2bc2a416192f97ffc /bpmn/MSOCommonBPMN | |
parent | f2c39570e2d1f602e72b169ebf796b93d162b3c4 (diff) |
Add method to prepare OOF request body for NST selection
Issue-ID: SO-2368
Change-Id: I2dcc8a0a439ba87d461b96460780bd4c43d13c26
Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy | 21 |
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() + } } |