/// <summary>
        /// This method runs each task of the OperationGroup, handling the iteration and sleep elements.
        /// </summary>
        /// <param name="task">task to run</param>
        /// <returns>Returns true if successful, otherwise returns false </returns>
        private void ProcessTask(MailSimSequenceOperationGroupTask task)
        {
            int iterations = GetIterationCount(task.Iterations);

            for (int count = 1; count <= iterations; count++)
            {
                Log.Out(Log.Severity.Info, task.Name, "Running task {0}", count);

                try
                {
                    if (ExecuteTask(task.Name))
                    {
                        Log.Out(Log.Severity.Info, task.Name, "Completed task run {0}", count);
                    }
                    else
                    {
                        Log.Out(Log.Severity.Error, task.Name, "Failed to run task");
                    }
                }
                catch (Exception ex)
                {
                    Log.Out(Log.Severity.Error, task.Name, "Exception encountered\n{0}", ex);
                }

                SleepOrStop(task.Name, task.Sleep);
            }
        }
Пример #2
0
        /// <summary>
        /// This method runs each task of the OperationGroup, handling the iteration and sleep elements.
        /// </summary>
        /// <param name="task">task to run</param>
        /// <returns>Returns true if successful, otherwise returns false </returns>
        private void ProcessTask(MailSimSequenceOperationGroupTask task)
        {
            int iterations = GetIterationCount(task.Iterations);

            for (int count = 1; count <= iterations; count++)
            {
                Log.Out(Log.Severity.Info, task.Name, "Running task {0}", count);

                try
                {
                    if (ExecuteTask(task.Name))
                    {
                        Log.Out(Log.Severity.Info, task.Name, "Completed task run {0}", count);
                    }
                    else
                    {
                        Log.Out(Log.Severity.Error, task.Name, "Failed to run task");
                    }
                }
                catch (Exception ex)
                {
                    Log.Out(Log.Severity.Error, task.Name, "Exception encountered\n{0}", ex);
                }

                SleepOrStop(task.Name, task.Sleep);
            }
        }