Remove oof_directives from user_directives 45/88845/1
authorEric Multanen <eric.w.multanen@intel.com>
Thu, 30 May 2019 14:35:13 +0000 (07:35 -0700)
committerEric Multanen <eric.w.multanen@intel.com>
Thu, 30 May 2019 17:56:22 +0000 (10:56 -0700)
Oof_directives - when populated with a json
string, breaks the parsing of the user_directives.
Since it is not needed in the user_directives,
remove it.

Change-Id: I0e2c3deef8266df52ac73b95209843ac31f986ef
Issue-ID: SO-1939
Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VfModuleBase.groovy

index 07d8ec9..e261fb9 100644 (file)
@@ -519,12 +519,14 @@ public abstract class VfModuleBase extends AbstractServiceTaskProcessor {
                 String vnfKey = entry.getKey()
                 String vnfValue = entry.getValue()
                 paramsMap.put("$vnfKey", "$vnfValue")
-                if (pcnt > 0) {
-                    userDirectivesBuilder.append(",")
+                if (!"oof_directives".equals(vnfKey)) {
+                    if (pcnt > 0) {
+                        userDirectivesBuilder.append(",")
+                    }
+                    pcnt++
+                    userDirectivesBuilder.append("{\"attribute_name\":\"${vnfKey}\",")
+                    userDirectivesBuilder.append("\"attribute_value\":\"${vnfValue}\"}")
                 }
-                pcnt++
-                userDirectivesBuilder.append("{\"attribute_name\":\"${vnfKey}\",")
-                userDirectivesBuilder.append("\"attribute_value\":\"${vnfValue}\"}")
             }
             if (pcnt > 0) {
                 userDirectives = userDirectivesBuilder.append("]}").toString()