-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathevent_handler.js
More file actions
34 lines (31 loc) · 853 Bytes
/
event_handler.js
File metadata and controls
34 lines (31 loc) · 853 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
31
32
33
34
/**
* This script implements com.serotonin.m2m2.rt.event.handlers.EventHandlerInterface
* Add this script to a "Script" type event handler and choose the Graal.js or Nashorn engine.
*/
/**
* Called when the Mango event is raised.
* You must implement this method.
*
* @param event
*/
function eventRaised(event) {
console.log('Raised', event);
}
/**
* Called when the Mango event is acknowledged (the event may still be active).
* Supported as of Mango v4.0.0-beta.14, you are not required to implement this method.
*
* @param event
*/
function eventAcknowledged(event) {
console.log('Acknowledged', event);
}
/**
* Called when the Mango event returns to normal or is deactivated (e.g. on shutdown).
* You must implement this method.
*
* @param event
*/
function eventInactive(event) {
console.log('Inactive', event);
}