-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathStatefulJS.js
More file actions
30 lines (25 loc) · 844 Bytes
/
StatefulJS.js
File metadata and controls
30 lines (25 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
var stage1 = function(doc){
var System = java.lang.System;
if(System.getProperties().get("stateful_key") == null){
System.getProperties().put("stateful_key", "foobar");
logger.info("SET stateful key foobar");
} else {
logger.info("NOT SETTING stateful key... already set");
}
return doc;
}
var stage2 = function(doc){
var System = java.lang.System;
if(System.getProperties().get("stateful_key") != null){
var val = System.getProperties().getProperty("stateful_key")
logger.info("GET stateful key "+val);
} else {
logger.warn("STATEFUL KEY NOT FOUND IN STAGE 2");
}
return doc;
}