aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/groovy
diff options
context:
space:
mode:
authorShailendra Borale <sb8915@att.com>2017-10-24 14:41:30 -0400
committerShailendra Borale <sb8915@att.com>2017-10-24 14:41:30 -0400
commitba489a051763c4d4f9a5ff36644d40144f887873 (patch)
tree46d79a90600fa0987e063680691c514fbcffbced /bpmn/MSOInfrastructureBPMN/src/main/groovy
parent0f8457a9f13aaad6de8c597abee6795a7c6f8e3f (diff)
Fixed bug to parse json userParams array
BPMN request - userParams is an array of maps, rather than a map. Each map has name and value elements. Changed code to parse the array correctly. Change-Id: Ie06ba22b03fa5c5ceb103c42daa3bbf7e6e252db Issue-Id: SO-262 Signed-off-by: Shailendra Borale <sb8915@att.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/groovy')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy48
1 files changed, 26 insertions, 22 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
index 87cf6fbd0f..fc6293c11f 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
+++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
@@ -156,29 +156,33 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
execution.setVariable("subscriberInfo", subscriberInfo)
utils.log("DEBUG", "Incoming subscriberInfo is: " + subscriberInfo, isDebugEnabled)
- /*
- * Extracting User Parameters from incoming Request and converting into a Map
- */
- def jsonSlurper = new JsonSlurper()
- def jsonOutput = new JsonOutput()
+ /*
+ * Extracting User Parameters from incoming Request and converting into a Map
+ */
+ def jsonSlurper = new JsonSlurper()
+ def jsonOutput = new JsonOutput()
+
+ Map reqMap = jsonSlurper.parseText(createVcpeServiceRequest)
+
+ //InputParams
+ def userParams = reqMap.requestDetails?.requestParameters?.userParams
- Map reqMap = jsonSlurper.parseText(createVcpeServiceRequest)
-
- //InputParams
- def userParams = reqMap.requestDetails?.requestParameters?.userParams
-
- Map<String, String> inputMap = [:]
- if (userParams) {
- userParams.each {
- name, value -> inputMap.put(name, value)
- if (name.equals("BRG_WAN_MAC_Address"))
- execution.setVariable("brgWanMacAddress", value)
- }
- }
-
- utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
- execution.setVariable("serviceInputParams", inputMap)
-
+ Map<String, String> inputMap = [:]
+
+
+ if (userParams) {
+ userParams.each {
+ userParam ->
+ if("BRG_WAN_MAC_Address".equals(userParam?.name)) {
+ execution.setVariable("brgWanMacAddress", userParam.value)
+ inputMap.put("BRG_WAN_MAC_Address", userParam.value)
+ }
+ }
+ }
+
+ utils.log("DEBUG", "User Input Parameters map: " + userParams.toString(), isDebugEnabled)
+ execution.setVariable("serviceInputParams", inputMap)
+
utils.log("DEBUG", "Incoming brgWanMacAddress is: " + execution.getVariable('brgWanMacAddress'), isDebugEnabled)
//For Completion Handler & Fallout Handler