Control NT service action errors when variable is defined in the action group

 I'm using the 'control NT service' action to get the state of a service on a remote server and store it in a local variable (var is defined in my action group)

the log outputs:

Getting state Services Name
Service in state: Stopped
Variable : svcTest - is not defined!
Variable not defined

In the property window of the service action i can see and select this variable from the drop down list. If i move the vaiable from the action group to a project level var, it works fine. 
 
 

Hi Jason

This error indicates that the action cannot find the variable specified. Can you please confirm that the ‘Control NT Service’ action is a child action (indented underneath) of the Action Group that you defined your local variable within?

Regards,
Steve

 i think i finally tracked down the issue! 

I have reproduced this error in a different project with different action types. 

if you have an Action group with a local variable defined and have an Async action group inside, any action under the async that trys to use the variable will fail. if i turn off async the same actions work.

this was a pita to track down... i hope you guys can fix it

Hi Jason

Thanks for additional information. I can reproduce this here, so we will look into it and get back to you.

Regards,
Steve

This is unfortunately a limitation of how async groups work. Each immediate child action of the async group is actually inserted into a psuedo actionlist and then run in a separate thread with it’s own actionlist runner. The problem there is that it disconnects the child action from the async group, and that means that local variables cannot be resolved up the tree. It may be possible to fix this, however it’s a major change (with potentially serious side effects) and not one I’m prepared to risk in a minor update. I will add an r&d task for the development of the next major version and see what can be done then.