diff options
author | liamfallon <liam.fallon@est.tech> | 2020-11-16 12:35:57 +0000 |
---|---|---|
committer | Liam Fallon <liam.fallon@est.tech> | 2020-11-16 17:04:19 +0000 |
commit | 937561509d22d265838368165d534636ebd0c70b (patch) | |
tree | db5d89dea249ab6066913b12ccdc5e1c401c8dea /examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js | |
parent | 84d0f41eba6884cc8e75e920e766abd785c06f2b (diff) |
Update gRPC example for JSON Stringify
The JSON.stringify() call in the Rhino Javascript interpreter is not
working correctly. A previous patch introduced a method into the Apex
execution context to provide an alternative method for stringifying
JSON.
This patch updates the gRPC example in apex to use that new method.
Issue-ID: POLICY-2463
Change-Id: I7f789c000d53dec60020fda2a6fccd71ef18edc3
Signed-off-by: liamfallon <liam.fallon@est.tech>
(cherry picked from commit fd5ee076b2ecf9fc5151090cf8a9b49fac6cf055)
Diffstat (limited to 'examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js')
-rw-r--r-- | examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js b/examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js index 48f31847b..85e7ae2e9 100644 --- a/examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js +++ b/examples/examples-grpc/src/main/resources/logic/CreateSubscriptionPayloadTask.js @@ -35,11 +35,14 @@ var payloadEntry = executor.subject.getOutFieldSchemaHelper("payload").createNew payloadEntry.put("create_DasH_subscription_DasH_properties", payloadProperties) var payload = executor.subject.getOutFieldSchemaHelper("payload").createNewInstance(); +var payloadSchemaHelper = executor.subject.getOutFieldSchemaHelper("payload"); payload.put("create_DasH_subscription_DasH_request", payloadEntry); -executor.outFields.put("albumID", executor.inFields.get("albumID")) +executor.logger.info("CDS payload - " + executor.stringify2Json( payload, payloadSchemaHelper)); + +executor.outFields.put("albumID", executor.inFields.get("albumID")); executor.outFields.put("payload", payload); -executor.logger.info("Sending Create Subscription Event to CDS") +executor.logger.info("Sending Create Subscription Event to CDS"); -true; +true;
\ No newline at end of file |