
Transformation rule node: Script
// Create new map
var map = {
"temperature": 42,
"smth": 22,
"nonExistingKey": {
"smth": 22
}
};
// Null-Safe expressions using ?
if (map.?nonExistingKey.smth > 10) {
map.smth_check = true;
} else {
map.smth_check = false;
}
// Iterate through the map
foreach(element: map.entrySet()) {
// str = " " +str+ " "+ element.key+" "+element.value
// Get the key
element.key
// // Get the value
element.value;
}
// get map size
map.size();
return {msg: map};
Transformation rule node: Script