1 /////////////////////////////////////////////////////////////////////
2 def eventHandler(LinkedHashMap eventDataMap) {
3 def value = eventDataMap["value"]
4 def name = eventDataMap["name"]
5 def deviceId = eventDataMap["deviceId"]
6 def descriptionText = eventDataMap["descriptionText"]
7 def displayed = eventDataMap["displayed"]
8 def linkText = eventDataMap["linkText"]
9 def isStateChange = eventDataMap["isStateChange"]
10 def unit = eventDataMap["unit"]
11 def data = eventDataMap["data"]
12 def manualEventsName = ["Touched", "button", "nfcTouch", "threeAxis"]
14 def event = new Event(value, name, deviceId, descriptionText, displayed, linkText, linkText, isStateChange, unit, data)
16 stack.push(manualEventsName.contains(name))
17 event.setManualTransaction(stack[0])
19 for (int i = 0;i < app2.eventList.size();i++) {
20 if (app2.eventList[i] == name &&
21 (app2.valueList[i] == "" || app2.valueList[i] == value)) {
22 if (app2.functionList[i] instanceof String) {
23 String toCall = app2.functionList[i]
27 app2.functionList[i](event)
31 for (int i = 0;i < app1.eventList.size();i++) {
32 if (app1.eventList[i] == name &&
33 (app1.valueList[i] == "" || app1.valueList[i] == value)) {
34 if (app1.functionList[i] instanceof String) {
35 String toCall = app1.functionList[i]
39 app1.functionList[i](event)
45 event.setManualTransaction(stack[0])