For some reason, a state variable does not seem to be updating as expected, even within the same execution instance of the app. Here's the code:
def eventHandler(evt) {
state.variable[id] = evt.getValue()
log.debug "Value of state variable is ${state.variable[id]}"
methodCall(id)
}
def methodCall(id) {
log.debug "Value of state variable is ${state.variable[id]}"
}
Is there any apparent reason why state.variable[id] would have a different value in methodCall(id) than when it was set in the eventHandler? The log shows the value in methodCall is the value BEFORE it was set in the eventHandler. I assume the methodCall makes it to where this is the SAME execution instance of the app, and not a situation where a different instance is trying to access a state variable that another instance has not yet written out, right?