From 938108832179d5ca9b28e5cb981ce5602ca59344 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 10 Mar 2020 21:09:28 +0000 Subject: Adapt vCPE example for Rhino Javascript Minor changes to Javascript source for execution under the Rhino script engine. Issue-ID: POLICY-2106 Change-Id: Ib7e30ce0067a11ea1bb3ca8d197c796dba9ea091 Signed-off-by: liamfallon --- .../logic/standalone/ConfigureBlackWhiteListTask.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js') diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js index 2d41e5f90..b16404292 100644 --- a/examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js +++ b/examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js @@ -1,6 +1,7 @@ /* * ============LICENSE_START======================================================= * Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,21 +30,24 @@ var targetType = executor.inFields.get("targetType"); var target = executor.inFields.get("target"); var black = executor.inFields.get("black"); -var returnValue = executor.isTrue; +var returnValue = true; -if (targetType === "VNF") { +if (targetType == "VNF") { executor.getContextAlbum("VnfIdWhiteBlackListAlbum").put(target, black); executor.logger.info("added VNF ID \"" + target + "\" with black flag \"" + black + "\" to VNF ID list"); } -else if (targetType === "Service") { +else if (targetType == "Service") { executor.getContextAlbum("ServiceIdWhiteBlackListAlbum").put(target, black); executor.logger.info("added Service ID \"" + target + "\" with black flag \"" + black + "\" to Service ID list"); } -else if (targetType === "VServer") { +else if (targetType == "VServer") { executor.getContextAlbum("VServerIdWhiteBlackListAlbum").put(target, black); executor.logger.info("added VServer ID \"" + target + "\" with black flag \"" + black + "\" to VServer ID list"); } else { executor.logger.warn("unknown target type \"" + targetType + "\" specified"); - returnValue = executor.isFalse; + returnValue = false; } + +returnValue; + -- cgit 1.2.3-korg