Example #1
0
            private static Dictionary <string, List <Row> > GetDataSets(TflProcess process)
            {
                var dataSets = new Dictionary <string, List <Row> >();

                if (!process.DataSets.Any())
                {
                    return(dataSets);
                }

                foreach (var dataSet in process.DataSets)
                {
                    dataSets[dataSet.Name] = new List <Row>();
                    var rows = dataSets[dataSet.Name];
                    foreach (var r in dataSet.Rows)
                    {
                        var row = new Row();
                        foreach (var pair in r)
                        {
                            row[pair.Key] = pair.Value;
                        }
                        rows.Add(row);
                    }
                }
                return(dataSets);
            }
Example #2
0
 public ProcessReader(TflProcess process, ILogger logger, Options options)
 {
     _configuration = process;
     _logger        = logger;
     _options       = options;
     _runner        = GetRunner(DetermineMode());
 }
        public void Start(TflProcess process)
        {
            if (!_reportedHost)
            {
                EntityInfo(".", "Orchard version: {0}", _orchardVersion);
                EntityInfo(".", "Transformalize.Orchard version: {0}", _moduleVersion);
                EntityInfo(".", GetHost());
                _reportedHost = true;
            }
            if (_level != "none")
            {
                Info("{0} entit{1} in {2} mode.", process.Entities.Count, process.Entities.Count.Pluralize(), process.Mode == string.Empty ? "Default" : process.Mode);
                Info("Running {0} with a {1} pipeline.", process.Parallel ? "Parallel" : "Serial", GetPipelineDescription(process));
            }

            if (!_orchardLogger.IsEnabled(LogLevel.Information))
            {
                return;
            }
            _orchardLogger.Information("TFL started logging process {0}.", Name);
        }
Example #4
0
        public void Start(TflProcess process)
        {
            if (_started)
            {
                return;
            }

            _started = true;
            Name     = process.Name;
            foreach (var log in process.Log)
            {
                switch (log.Provider)
                {
                case "file":
                    log.Folder = log.Folder.Replace('/', '\\');
                    log.File   = log.File.Replace('/', '\\');
                    log.Folder = (log.Folder.Equals(Common.DefaultValue) ? "logs" : log.Folder).TrimEnd('\\') + "\\";
                    log.File   = (log.File.Equals(Common.DefaultValue) ? "tfl-" + process.Name + ".log" : log.File).TrimStart('\\');

                    var fileListener = new ObservableEventListener();
                    fileListener.EnableEvents(TflEventSource.Log, (EventLevel)Enum.Parse(typeof(EventLevel), log.Level));
                    SinkSubscriptions.Add(fileListener.LogToRollingFlatFile(log.Folder + log.File, 5000, "yyyy-MM-dd", RollFileExistsBehavior.Increment, RollInterval.Day, new LegacyLogFormatter(), 0, log.Async));
                    EventListeners.Add(fileListener);
                    break;

                case "mail":
                    if (log.Subject.Equals(Common.DefaultValue))
                    {
                        log.Subject = process.Name + " " + log.Level;
                    }
                    var mailListener = new ObservableEventListener();
                    mailListener.EnableEvents(TflEventSource.Log, EventLevel.Error);
                    SinkSubscriptions.Add(mailListener.LogToEmail(log));
                    EventListeners.Add(mailListener);
                    break;
                }
            }
        }
        private static string GetPipelineDescription(TflProcess process)
        {
            var pipeline = process.PipelineThreading;

            if (pipeline != "Default")
            {
                return(pipeline);
            }

            if (process.Entities.All(e => e.PipelineThreading == "SingleThreaded"))
            {
                pipeline = "SingleThreaded";
            }
            else if (process.Entities.All(e => e.PipelineThreading == "MultiThreaded"))
            {
                pipeline = "MultiThreaded";
            }
            else
            {
                pipeline = "Mixed";
            }
            return(pipeline);
        }
 public TransformFieldsMoveAdapter(TflProcess process)
 {
     _process = process;
 }
Example #7
0
 public NinjectBindings(TflProcess process, ILogger logger)
 {
     _process = process;
     _logger  = logger;
 }
 public TransformFieldsToParametersAdapter(TflProcess process)
 {
     _process = process;
 }
Example #9
0
 public ProcessBuilder(TflProcess element) {
     _process = element;
 }
Example #10
0
 public ProcessBuilder(string name) {
     _process = new TflRoot().GetDefaultOf<TflProcess>(p => { p.Name = name; });
 }
Example #11
0
 public ProcessBuilder(TflProcess element)
 {
     _process = element;
 }
Example #12
0
 public ProcessBuilder(string name)
 {
     _process = new TflRoot().GetDefaultOf <TflProcess>(p => { p.Name = name; });
 }
 public ProcessBuilder(string name) {
     _process = new TflProcess { Name = name }.WithDefaults();
 }
Example #14
0
 public void Start(TflProcess process)
 {
     Name = process.Name;
     Info("Start logging {0}!", process.Name);
 }
Example #15
0
 public void Start(TflProcess process)
 {
 }
Example #16
0
 public static Process CreateSingle(TflProcess process, ILogger logger, Options options = null)
 {
     return(Create(new List <TflProcess> {
         process
     }, logger, options)[0]);
 }