From a737222ca2fa0fcf87c2062c52fca8577aab87b9 Mon Sep 17 00:00:00 2001 From: Eric Multanen Date: Fri, 31 May 2019 06:44:05 -0700 Subject: Remove oof_directives from user_directives BB path Remove oof_directives from user_directives in the BB code path (as was done for the groovy code path). Change-Id: I018c3c85cc4a68ab128a2be869567b44fda08e48 Issue-ID: SO-1939 Signed-off-by: Eric Multanen --- .../vnf/mapper/VnfAdapterVfModuleObjectMapper.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'bpmn') diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java index 94e95687db..b0ba0595d5 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java @@ -205,14 +205,22 @@ public class VnfAdapterVfModuleObjectMapper { private void buildDirectivesParamFromMap(Map paramsMap, String directive, Map srcMap) { StringBuilder directives = new StringBuilder(); - if (srcMap.size() > 0) { + int no_directives_size = 0; + if (directives.equals(MsoMulticloudUtils.USER_DIRECTIVES) + && srcMap.containsKey(MsoMulticloudUtils.OOF_DIRECTIVES)) { + no_directives_size = 1; + } + if (srcMap.size() > no_directives_size) { directives.append("{ \"attributes\": [ "); int i = 0; for (String attributeName : srcMap.keySet()) { - directives.append(new AttributeNameValue(attributeName, srcMap.get(attributeName).toString())); - if (i < (srcMap.size() - 1)) - directives.append(", "); - i++; + if (!(MsoMulticloudUtils.USER_DIRECTIVES.equals(directives) + && attributeName.equals(MsoMulticloudUtils.OOF_DIRECTIVES))) { + directives.append(new AttributeNameValue(attributeName, srcMap.get(attributeName).toString())); + if (i < (srcMap.size() - 1 + no_directives_size)) + directives.append(", "); + i++; + } } directives.append("] }"); } else { -- cgit 1.2.3-korg