I have programmed a lot in the past primarily C++ , but no Java and no groovy. I know this is a basic question. Lets say I have an app and I need to know if the Alarm has been activated. I want to have access to "alarmactive" value in the different functions of my app. How do I make alarmactive global to my app? ( I have tried @Field I get an unable to resolve class error). For my real life example I actually want to also save the last_evt object values, to use if the alarm was armed and triggered. How do I make that object global, is there a simple answer, what I found in the threads went to more higher level discussions of performance and divers methods of declarations such as @Field, none which worked in this simple case.
def AlarmActivated()
{
alarmactive = TRUE
notifyalarmandtriggerevent( last_evt)
......
}
def DeviceEventHandler(evt) {
if (alarmactive = FALSE)
{ last_evt = evt
/* Need this when the alarm actually triggers, this will have been its trigger /
/ Don't send unless armed and triggered. /
.....
}
else
{
/ send these follow on events to monitor station until no longer active*/
}
}
< Last question is there a link to where scope of variables and the connections between Drivers, Apps, Initialization code and Dashboards is defined, as well as the persistence of their values... Thank you>