1 Reply Latest reply on Mar 8, 2012 6:53 AM by Carol L. Frampton

    How to detect when a NativeProcess finish?

    RafaelViana_ Level 1



      I'm starting a native process to start an embedded Tomcat.


      How can I know when is it finished? To execute a next command?

        • 1. Re: How to detect when a NativeProcess finish?
          Carol L. Frampton Level 2

          You add event handlers to the native process.  For exit, use NativeProcessExitEvent.EXIT.


               process.addEventListener(NativeProcessExitEvent.EXIT, onExitFunction);


               process.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onErrorDataFunction);

               process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputDataFunction);


              process.addEventListener(IOErrorEvent.STANDARD_OUTPUT_IO_ERROR, onIOError);

              process.addEventListener(IOErrorEvent.STANDARD_ERROR_IO_ERROR, onIOError);