summaryrefslogtreecommitdiffstats
path: root/examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js')
-rw-r--r--examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js
index a8b1fe8e4..f37b6f1b5 100644
--- a/examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js
+++ b/examples/examples-onap-vcpe/src/main/resources/logic/AbatedTask.js
@@ -21,11 +21,20 @@
executor.logger.info(executor.subject.id);
executor.logger.info(executor.inFields);
-var vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get(
+var vcpeClosedLoopStatus = null;
+if( executor.inFields.get("vnfID") == null) {
+ executor.logger.info("AbatedTask: vnfID is null");
+ var vnfName = executor.inFields.get("vnfName");
+ vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get(
+ executor.inFields.get("vnfName"));
+} else {
+ vcpeClosedLoopStatus = executor.getContextAlbum("VCPEClosedLoopStatusAlbum").get(
executor.inFields.get("vnfID").toString());
+}
-vcpeClosedLoopStatus.put("notification", "VCPE NOTIFICATION HAS BEEN ABATED");
-vcpeClosedLoopStatus.put("notificationTime", new Date().toISOString());
+vcpeClosedLoopStatus.put("notification", "FINAL_SUCCESS");
+vcpeClosedLoopStatus.put("notificationTime", java.lang.System.currentTimeMillis());
+vcpeClosedLoopStatus.put("message", "situation has been abated");
executor.logger.info(executor.outFields);