コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="jobGroup"></param>
        /// <returns></returns>
        public bool IsJobCompleted(Guid jobId, out int ruleCount)
        {
            ruleCount = 0;

            try
            {
                while (true)
                {
                    using (var ctx = SuiteEntitiesUtility.GetODataValidationSuiteEntities())
                    {
                        var job = (from j in ctx.ExtValidationJobs
                                   where j.ID == jobId
                                   select j).FirstOrDefault();

                        if (job != null && job.Complete.HasValue && job.Complete == true)
                        {
                            ruleCount = job.RuleCount.Value;
                            return(true);
                        }
                        else
                        {
                            Thread.Sleep(5000);
                        }
                    }
                }
            }
            catch (System.Data.OptimisticConcurrencyException)
            {
                return(false);
                // error occured while trying to mark operation as complete.  This is not a terminal error for this system and
                // this is on a threadpool thread so swallow the exception
            }
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="jobGroup"></param>
        /// <returns></returns>
        public List <TestResult> GetTestResults(Guid jobId)
        {
            List <TestResult> testResults = new List <TestResult>();

            try
            {
                using (var ctx = SuiteEntitiesUtility.GetODataValidationSuiteEntities())
                {
                    var results = from j in ctx.TestResults
                                  where j.ValidationJobID == jobId
                                  select j;

                    testResults = results.ToList();
                }
            }
            catch (System.Data.OptimisticConcurrencyException)
            {
                // error occured while trying to mark operation as complete.  This is not a terminal error for this system and
                // this is on a threadpool thread so swallow the exception
            }

            return(testResults);
        }