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); }
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); }
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; }
public NinjectBindings(TflProcess process, ILogger logger) { _process = process; _logger = logger; }
public TransformFieldsToParametersAdapter(TflProcess process) { _process = process; }
public ProcessBuilder(TflProcess element) { _process = element; }
public ProcessBuilder(string name) { _process = new TflRoot().GetDefaultOf<TflProcess>(p => { p.Name = name; }); }
public ProcessBuilder(string name) { _process = new TflRoot().GetDefaultOf <TflProcess>(p => { p.Name = name; }); }
public ProcessBuilder(string name) { _process = new TflProcess { Name = name }.WithDefaults(); }
public void Start(TflProcess process) { Name = process.Name; Info("Start logging {0}!", process.Name); }
public void Start(TflProcess process) { }
public static Process CreateSingle(TflProcess process, ILogger logger, Options options = null) { return(Create(new List <TflProcess> { process }, logger, options)[0]); }