示例#1
0
        public IEnumerable <Row> Run(Process process)
        {
            var result = Enumerable.Empty <Row>();

            if (!process.IsReady())
            {
                return(result);
            }

            var timer = new Stopwatch();

            timer.Start();

            process.Setup();
            process.PerformActions(a => a.Before);

            new InitializationProcess(process).Execute();
            new TemplateManager(process).Manage();

            process.PerformActions(a => a.After);

            timer.Stop();
            process.Logger.Info("Initialized output in {0}.", timer.Elapsed);

            process.Complete = true;
            return(result);
        }
        public IEnumerable<Row> Run(Process process) {

            var result = Enumerable.Empty<Row>();
            if (!process.IsReady()) {
                return result;
            }

            var timer = new Stopwatch();
            timer.Start();

            process.Setup();
            process.IsFirstRun = process.MasterEntity == null || !process.OutputConnection.RecordsExist(process.MasterEntity);
            process.PerformActions(a => a.Before);

            if (!process.IsFirstRun) {
                ProcessDeletes(process);
            }

            ProcessEntities(process);

            if (process.StarEnabled && !process.OutputConnection.Is.Internal()) {
                ProcessMaster(process);
            }

            if (process.OutputConnection.Is.Internal()) {
                if (process.Relationships.Any()) {
                    var collector = new CollectorOperation();
                    new MasterJoinProcess(process, ref collector).Execute();
                    process.Results = collector.Rows;
                } else {
                    process.Results = process.MasterEntity == null ? Enumerable.Empty<Row>() : process.MasterEntity.Rows;
                }
            } else {
                process.Results = Enumerable.Empty<Row>();
            }

            if (process.OutputConnection.Is.Internal()) {
                ProcessTransforms(process, new RowsOperation(process.Results));
            } else {
                ProcessTransforms(process, new ParametersExtract(process));
            }

            new TemplateManager(process).Manage();

            process.PerformActions(a => a.After);

            timer.Stop();
            process.Logger.Info( "Process affected {0} records in {1}.", process.Anything, timer.Elapsed);

            process.Complete = true;
            return process.Results;
        }
        public IEnumerable<Row> Run(Process process) {

            var result = Enumerable.Empty<Row>();
            if (!process.IsReady()) {
                return result;
            }

            var timer = new Stopwatch();
            timer.Start();

            process.Setup();
            process.PerformActions(a => a.Before);

            new InitializationProcess(process).Execute();
            new TemplateManager(process).Manage();

            process.PerformActions(a => a.After);

            timer.Stop();
            process.Logger.Info("Initialized output in {0}.", timer.Elapsed);

            process.Complete = true;
            return result;
        }
示例#4
0
        public IEnumerable <Row> Run(Process process)
        {
            var result = Enumerable.Empty <Row>();

            if (!process.IsReady())
            {
                return(result);
            }

            var timer = new Stopwatch();

            timer.Start();

            process.Setup();
            process.IsFirstRun = process.MasterEntity == null || !process.OutputConnection.RecordsExist(process.MasterEntity);
            process.PerformActions(a => a.Before);

            if (!process.IsFirstRun)
            {
                ProcessDeletes(process);
            }

            ProcessEntities(process);

            if (process.StarEnabled && !process.OutputConnection.Is.Internal())
            {
                ProcessMaster(process);
            }

            if (process.OutputConnection.Is.Internal())
            {
                if (process.Relationships.Any())
                {
                    var collector = new CollectorOperation();
                    new MasterJoinProcess(process, ref collector).Execute();
                    process.Results = collector.Rows;
                }
                else
                {
                    process.Results = process.MasterEntity == null?Enumerable.Empty <Row>() : process.MasterEntity.Rows;
                }
            }
            else
            {
                process.Results = Enumerable.Empty <Row>();
            }

            if (process.OutputConnection.Is.Internal())
            {
                ProcessTransforms(process, new RowsOperation(process.Results));
            }
            else
            {
                ProcessTransforms(process, new ParametersExtract(process));
            }

            new TemplateManager(process).Manage();

            process.PerformActions(a => a.After);

            timer.Stop();
            process.Logger.Info("Process affected {0} records in {1}.", process.Anything, timer.Elapsed);

            process.Complete = true;
            return(process.Results);
        }