summaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common/src
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-10-11 23:24:28 +0000
committerGerrit Code Review <gerrit@onap.org>2018-10-11 23:24:28 +0000
commitea7f1ce7584deb1e4896ffcddb8c45e64422a9d0 (patch)
tree583c3aa77dcd3344c90f58738b3335c9163ddfa0 /bpmn/so-bpmn-infrastructure-common/src
parent58c1d90a787979e507f559d7075aac8a1428df42 (diff)
parentcbea6d143050276e024fc710450a028afc7a102f (diff)
Merge "Fix UserInput Exception"
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src')
-rwxr-xr-xbpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy66
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy9
2 files changed, 64 insertions, 11 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
index 968612301d..9763960bfd 100755
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy
@@ -142,12 +142,37 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
Map<String, String> inputMap = [:]
if (userParams) {
userParams.each {
- userParam -> inputMap.put(userParam.name, userParam.value.toString())
+ userParam ->
+ if ("Customer_Location".equals(userParam?.name)) {
+ msoLogger.debug("User Input customerLocation: " + userParam.value.toString())
+ Map<String, String> customerMap = [:]
+ userParam.value.each {
+ param ->
+
+ inputMap.put(param.key, param.value)
+ customerMap.put(param.key, param.value)
+ }
+ execution.setVariable("customerLocation", customerMap)
+ }
+ if ("Homing_Solution".equals(userParam?.name)) {
+ msoLogger.debug("User Input Homing_Solution: " + userParam.value.toString())
+ execution.setVariable("homingService", userParam.value)
+ execution.setVariable("callHoming", true)
+ inputMap.put("Homing_Solution", userParam.value)
+ }
+ if (!"Homing_Solution".equals(userParam?.name) && !"Customer_Location".equals(userParam?.name))
+ {
+ msoLogger.debug("User Input Parameter " + userParam.name + ": " + userParam.value.toString())
+ inputMap.put(userParam.name, userParam.value)
+ }
}
}
msoLogger.debug("User Input Parameters map: " + userParams.toString())
- execution.setVariable("serviceInputParams", inputMap)
+ msoLogger.debug("User Input Map: " + inputMap.toString())
+ if (inputMap.toString() != "[:]") {
+ execution.setVariable("serviceInputParams", inputMap)
+ }
//TODO
//execution.setVariable("failExists", true)
@@ -231,7 +256,7 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
}
public void processDecomposition(DelegateExecution execution) {
- def isDebugEnabled = execution.getVariable(DebugFlag)
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
msoLogger.trace("Inside processDecomposition() of CreateGenericALaCarteServiceInstance ")
@@ -241,7 +266,6 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
// VNFs
List<VnfResource> vnfList = serviceDecomposition.getVnfResources()
- filterVnfs(vnfList)
serviceDecomposition.setVnfResources(vnfList)
execution.setVariable("vnfList", vnfList)
@@ -290,18 +314,44 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro
def jsonOutput = new JsonOutput()
def siRequest = execution.getVariable("bpmnRequest")
Map reqMap = jsonSlurper.parseText(siRequest)
+
//InputParams
def userParams = reqMap.requestDetails?.requestParameters?.userParams
+
Map<String, String> inputMap = [:]
- if (userParams != null) {
+ if (userParams) {
userParams.each {
- userParam -> inputMap.put(userParam.name, userParam.value)
+ userParam ->
+ if ("Customer_Location".equals(userParam?.name)) {
+ msoLogger.debug("User Input customerLocation: " + userParam.value.toString())
+ Map<String, String> customerMap = [:]
+ userParam.value.each {
+ param ->
+
+ inputMap.put(param.key, param.value)
+ customerMap.put(param.key, param.value)
+ }
+ execution.setVariable("customerLocation", customerMap)
+ }
+ if ("Homing_Solution".equals(userParam?.name)) {
+ msoLogger.debug("User Input Homing_Solution: " + userParam.value.toString())
+ execution.setVariable("homingService", userParam.value)
+ execution.setVariable("callHoming", true)
+ inputMap.put("Homing_Solution", userParam.value)
+ }
+ if (!"Homing_Solution".equals(userParam?.name) && !"Customer_Location".equals(userParam?.name))
+ {
+ msoLogger.debug("User Input Parameter " + userParam.name + ": " + userParam.value.toString())
+ inputMap.put(userParam.name, userParam.value)
+ }
}
}
msoLogger.debug("User Input Parameters map: " + userParams.toString())
- execution.setVariable("serviceInputParams", inputMap)
-
+ msoLogger.debug("User Input Map: " + inputMap.toString())
+ if (inputMap.toString() != "[:]") {
+ execution.setVariable("serviceInputParams", inputMap)
+ }
ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
String serviceInstanceId = execution.getVariable("serviceInstanceId")
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
index c5f712cafc..beac679691 100644
--- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
+++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/vcpe/scripts/CreateVcpeResCustService.groovy
@@ -202,12 +202,15 @@ public class CreateVcpeResCustService extends AbstractServiceTaskProcessor {
userParams.each {
userParam ->
if ("Customer_Location".equals(userParam?.name)) {
- execution.setVariable("customerLocation", userParam.value)
- userParam.value.each {
+ Map<String, String> customerMap = [:]
+ userParam.value.each {
param ->
+
inputMap.put(param.key, param.value)
+ customerMap.put(param.key, param.value)
}
- }
+ execution.setVariable("customerLocation", customerMap)
+ }
if ("Homing_Model_Ids".equals(userParam?.name)) {
utils.log("DEBUG", "Homing_Model_Ids: " + userParam.value.toString() + " ---- Type is:" +
userParam.value.getClass() , isDebugEnabled)