public override void Execute(Process process)
        {
            var state = process.ProcessState ?? _readyState;
            state.Execute(process);

            foreach (var childProcess in process.Children ?? new List<Process>())
            {
                Execute(childProcess);
            }
        }
        public void Execute(Process process)
        {
            if (process.HasFailingPreCondition)
            {
                Console.WriteLine(process.Name + " - Has failing pre condition stays at state stays at ready state");
                return;
            }

            Console.WriteLine(process.Name + " - Executing Ready Process");
            process.ProcessState = _inProgressState;
        }
        static void Main(string[] args)
        {
            var container = ContainerFactory.Create();
            var processExecuter = container.Resolve<ProcessExecuterBase>();

            var process = new Process("Parent")
                {
                    Children = new List<Process>()
                        {
                            new Process("Child 1", true),
                            new Process("Child 2")
                        }
                };

            processExecuter.Execute(process);
            processExecuter.Execute(process);
            processExecuter.Execute(process);

            Console.ReadLine();
        }
 public void Execute(Process process)
 {
     Console.WriteLine(process.Name + " - Executing Ready In Progress");
     process.ProcessState = _completeState;
 }
 public void Execute(Process process)
 {
     Console.WriteLine(process.Name + " - Executing CompleteState");
 }