예제 #1
0
        protected void ValidateInputArguments(CodeActivityContext context)
        {
            ValidateWorkingDirectory(context);
            ValidateFilename(context, true); // For processes we want to look in directories from PATH

            if (WaitForExit.Get(context) && WaitForExitTimeout.Get(context) == 0)
            {
                throw new ArgumentException("WaitForExit is set to True but the WaitForExitTimeout is 0.");
            }
        }
예제 #2
0
        protected override void Execute(CodeActivityContext context)
        {
            ValidateInputArguments(context);

            var processInvokeWrapper = new RunProcessWrapper(FileName.Get(context),
                                                             Arguments.Get(context),
                                                             WorkingDirectory.Get(context),
                                                             CaptureOutput.Get(context),
                                                             WaitForExit.Get(context),
                                                             WaitForExitTimeout.Get(context),
                                                             KillAtTimeout.Get(context));

            processInvokeWrapper.StartProcess();

            ProcessId.Set(context, processInvokeWrapper.ProcessId);
            Finished.Set(context, processInvokeWrapper.Finished);
            Output.Set(context, processInvokeWrapper.StandardOutput);
            Error.Set(context, processInvokeWrapper.StandardError);
            ExitCode.Set(context, processInvokeWrapper.ExitCode);
        }