Exemple #1
0
        private IReadOnlyDictionary <string, object> RunProcess(string processName, IDictionary <string, object> inputValues)
        {
            var client = new RobotClient();
            var task1  = client.GetProcesses();

            task1.Wait();
            var processes = task1.Result;
            var myProcess = processes.Single(process => process.Name == processName);
            var job       = myProcess.ToJob();

            job.InputArguments = inputValues;
            var task2 = client.RunJob(job);

            task2.Wait();
            return(task2.Result.Arguments);
        }
Exemple #2
0
        /// <summary>
        /// Runs the designated process asynchronously.
        /// </summary>
        /// <param name="processName">Name of the process to run</param>
        /// <returns>Task with JobOutput</returns>
        private static async Task <JobOutput> RunAsync(string processName)
        {
            try
            {
                var client    = new RobotClient();
                var processes = await client.GetProcesses();

                var myProcess = processes.Single(process => process.Name == processName);
                var job       = myProcess.ToJob();
                return(await client.RunJob(job));
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine("{0}", ex.ToString());
                return(null);
            }
        }