Hello UiPath Developer Team,
here a tiny suggestion for your Start Process Activity:
This activity executes applications or opens documents asynchronously. After the process is started, the automation workflow continues without waiting for a possible result of the process. My suggestion is to add a checkbox to decide if this activity is asynchronously or synchronously and to add an int32 field for a time out.
At the moment I use this Invoke Code as workaround:
//-Begin----------------------------------------------------------------
//-
//- Launches a specific application or file synchronlously
//-
//- Arguments:
//- string FileName = The full path and name of the application to
//- execute or file to be opened
//- string Arguments = The parameters that can be passed to the
//- application at startup
//- string WorkingDirectory = Path of the current working directory
//- int32 TimeOut = System.Threading.Timeout.Infinite (-1) or
//- milliseconds to wait for the process to exit
//-
//----------------------------------------------------------------------
string currentWorkingDirectory = Environment.CurrentDirectory;
if(!string.IsNullOrWhiteSpace(WorkingDirectory)) {
Environment.CurrentDirectory = @WorkingDirectory;
}
ProcessStartInfo processStartInfo = new ProcessStartInfo();
processStartInfo.FileName = @FileName;
processStartInfo.Arguments = @Arguments;
processStartInfo.UseShellExecute = true;
Process process = Process.Start(processStartInfo);
if(process.WaitForExit(TimeOut) == false) {
//-Optional to avoid endless processes--------------------------------
//process.Kill();
};
Environment.CurrentDirectory = currentWorkingDirectory;
//-End------------------------------------------------------------------
It uses exactly the same interface as the Start Process activity with an additional time out parameter.
Thanks for your support and best regards
Stefan