Пример #1
0
        private void CancelAllAbout(Process process, int depth)
        {
            if (depth++ >= 100)
            {
                throw new InvalidOperationException("递归执行CancelAllAbout时超出了允许的最大深度100");
            }

            //1.取消所有调度运行时数据
            this._schedulerService.CancelAll(process);
            //2.取消所有任务
            _workItemRepository.CancelAll(process);

            this._log.InfoFormat("取消流程实例“{0}”#{1}相关的运行时信息"
                                 , process.Title
                                 , process.ID);

            //撤销所有子流程
            _repository.FindSubProcesses(process).ToList().ForEach(o =>
                                                                   this.CancelAllAbout(process, o, depth));
        }