summaryrefslogtreecommitdiffstats
path: root/examples/examples-grpc/src/main/resources/logic
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples-grpc/src/main/resources/logic')
-rw-r--r--examples/examples-grpc/src/main/resources/logic/ResponseTask.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/examples/examples-grpc/src/main/resources/logic/ResponseTask.js b/examples/examples-grpc/src/main/resources/logic/ResponseTask.js
index 04517763a..dc4948990 100644
--- a/examples/examples-grpc/src/main/resources/logic/ResponseTask.js
+++ b/examples/examples-grpc/src/main/resources/logic/ResponseTask.js
@@ -1,6 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Nordix. All rights reserved.
+ * Modifications Copyright (C) 2021 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.
@@ -25,7 +26,7 @@ var albumID = uuidType.fromString("d0050623-18e5-46c9-9298-9a567990cd7c");
var pmSubscriptionInfo = executor.getContextAlbum("PMSubscriptionAlbum").get(albumID.toString());
-var responseStatus = executor.subject.getOutFieldSchemaHelper("status").createNewInstance();
+var responseStatus = executor.subject.getOutFieldSchemaHelper("CDSResponseStatusEvent", "status").createNewInstance();
responseStatus.put("subscriptionName", pmSubscriptionInfo.get("subscription").get("subscriptionName"))
responseStatus.put("nfName", pmSubscriptionInfo.get("nfName"))
@@ -39,6 +40,12 @@ if ("failure".equals(response.get("create_DasH_subscription_DasH_response").get(
responseStatus.put("message", "success")
}
-executor.outFields.put("status", responseStatus)
+var cdsResponseEventFields = java.util.HashMap();
+cdsResponseEventFields.put("status", responseStatus);
+executor.addFieldsToOutput(cdsResponseEventFields);
+var logEventFields = java.util.HashMap();
+logEventFields.put("final_status", "FINAL_SUCCESS");
+logEventFields.put("message", "Operation successfully completed.");
+executor.addFieldsToOutput(logEventFields);
true;