summaryrefslogtreecommitdiffstats
path: root/examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@bell.ca>2022-07-25 10:46:57 +0100
committera.sreekumar <ajith.sreekumar@bell.ca>2022-07-26 10:18:58 +0100
commit751aa0f3c7f090bc10bc59f74aaace1f297a7c2c (patch)
treeacc983fd58594b56b24846e3ee6becb8c494418c /examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js
parentcfa642373420fa2bc429c94f17e4f0c0798e5791 (diff)
Update APEX example to use JSON Schema plugin
Change-Id: Ic8b412ce0ca71b4452d67b1e4445e423b0ec5b54 Issue-ID: POLICY-4292 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js')
-rw-r--r--examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js b/examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js
index 85e7ae2e9..4cacf81e0 100644
--- a/examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js
+++ b/examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js
@@ -1,6 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Nordix. All rights reserved.
+ * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,7 +23,7 @@ executor.logger.info(executor.subject.id);
var pmSubscriptionInfo = executor.getContextAlbum("PMSubscriptionAlbum").get(executor.inFields.get("albumID").toString())
-var payloadProperties = executor.subject.getOutFieldSchemaHelper("payload").createNewSubInstance("create_DasH_subscription_DasH_properties_record");
+var payloadProperties = new java.util.HashMap();
payloadProperties.put("nfName", pmSubscriptionInfo.get("nfName"))
payloadProperties.put("subscriptionName", pmSubscriptionInfo.get("subscription").get("subscriptionName"))
@@ -31,12 +32,12 @@ payloadProperties.put("fileBasedGP", pmSubscriptionInfo.get("subscription").get
payloadProperties.put("fileLocation", pmSubscriptionInfo.get("subscription").get("fileLocation"))
payloadProperties.put("measurementGroups", pmSubscriptionInfo.get("subscription").get("measurementGroups"))
-var payloadEntry = executor.subject.getOutFieldSchemaHelper("payload").createNewSubInstance("CDSRequestPayloadEntry");
-payloadEntry.put("create_DasH_subscription_DasH_properties", payloadProperties)
+var payloadEntry = new java.util.HashMap();
+payloadEntry.put("create-subscription-properties", payloadProperties)
-var payload = executor.subject.getOutFieldSchemaHelper("payload").createNewInstance();
+var payload = new java.util.HashMap();
var payloadSchemaHelper = executor.subject.getOutFieldSchemaHelper("payload");
-payload.put("create_DasH_subscription_DasH_request", payloadEntry);
+payload.put("create-subscription-request", payloadEntry);
executor.logger.info("CDS payload - " + executor.stringify2Json( payload, payloadSchemaHelper));