I need to run a TS sequence just before exiting my operator interface (a modified version of the full featured OI). I use InvokeNode to call it in my "Exit" case, using the CallFrontEndCallbackEx method. I wire the Execution output from the method to invoke Execution.WaitForEndEx, with a timeout of -1 (no timeout), and I expect for it not to come back before the callback completes. But it does come back before completion, apparently, and since the next thing I do is request a shutdown, I get a message 'Cannot exit while a sequence is running' and the application hangs. If I force a delay or simply remove the code that calls the callback, I don't get
the same problem.
(In the attached code example, ignore the fact that we're getting the Execution.Id and not using it - we know that should be removed.)
So, if I'm using the wrong code to wait for completion, do you have an example of something that would wait for the callback to complete? If it's the right code, then what is going wrong?