public override TaskResult OnExecute(TaskExecutionContext context) { Input.Open(); TransformedReader reader = new TransformedReader(Input.Reader); reader.Maps = this.Mapping; reader.ScriptingLanguage = "VBScript"; reader.TransformationScript = BuildScript(); reader.Init(); Output.Write(reader, TableName, context); return null; }
private void OnExecute(TaskExecutionContext context, TaskResult result) { if (result.Output != null) { Type type = NextTask.GetType(); foreach( string key in TaskPipe.Keys) { PropertyInfo pi = type.GetProperty(key); pi.SetValue(NextTask, result.Output[TaskPipe[key]], (object[])null); } } }
public override TaskResult OnExecute(TaskExecutionContext context) { if (this.OnCodedExecute != null) { return this.OnCodedExecute(context); } return new TaskResult() { IsSuccess = true, Message = "Blank coded task executed.", Output = null }; }
public virtual TaskResult Execute(TaskExecutionContext context) { if (this.OnBeforeExecution != null) { this.OnBeforeExecution(context, null); } TaskResult result = this.OnExecute ( context); if (this.OnAfterExecution != null) { this.OnAfterExecution(context, result); } context.LastTaskResult = result; return result; }
public void Write(IDataReader source, string table, TaskExecutionContext context) { SqlConnection conn = ((SqlDataLink)_link).Connection as SqlConnection; if ( conn.State== ConnectionState.Closed) { conn.Open(); } SqlBulkCopy sc = new SqlBulkCopy(conn); sc.DestinationTableName = table; sc.SqlRowsCopied += delegate(object sender, SqlRowsCopiedEventArgs e) { context.Events.Log (ExecutionEventListener.LogLevel.Verbose, context.Current.Name, "Progress",string.Format("{0} row(s) copied", e.RowsCopied)); }; sc.NotifyAfter = 100; sc.WriteToServer(source); }
public override TaskResult OnExecute(TaskExecutionContext context) { if (!this.Link.IsConnected) { this.Link.Connect(); } ColumnDefinition[] columns = this.Link.GetSchema(Query); TaskResult result = new TaskResult() { IsSuccess = true, Message = "Discovered schema for " + this.Query, Output = new Dictionary<string,object>() }; result.Output["Columns"] = columns; return result; }
public override TaskResult OnExecute(TaskExecutionContext context) { TaskResult result = new TaskResult() { IsSuccess = false, Message = "Failed to create table " + TableName }; if (Link != null) { if (!Link.IsConnected) { Link.Connect(); } result.IsSuccess = Link.CreateTable( TableName, this.Columns, this.ShouldDropExisting); result.Message = "Successfully created table " + TableName; result.Output = new Dictionary<string, object>(); } return result; }
public void Execute(ExecutionEventListener eventListener) { TaskExecutionContext context = new TaskExecutionContext(); context.LastTaskResult = null; context.Events = eventListener; eventListener.Log(ExecutionEventListener.LogLevel.Info, "Main", "Start", "Reflow engine started execution"); eventListener.Log(ExecutionEventListener.LogLevel.Verbose, "Main", "Start", string.Format("There are {0} task(s) to be executed.", this.Tasks.Count)); eventListener.Log(ExecutionEventListener.LogLevel.Debug, "Main", "Start", "Starting tasks ..."); // Lots of TODO: here foreach (ITask task in this.Tasks) { eventListener.Log(ExecutionEventListener.LogLevel.Info, task.Name, "Begin", string.Format("Starting task {0}... ", task.Name)); context.Current = task; TaskResult result = task.Execute(context); eventListener.Log(ExecutionEventListener.LogLevel.Info, task.Name, "End", string.Format("Task {0} Complete. ", task.Name)); context.LastTaskResult = result; } context.Current = null; eventListener.Log(ExecutionEventListener.LogLevel.Info, "Main", "End", "Reflow engine execution complete"); }
public override TaskResult OnExecute(TaskExecutionContext context) { throw new NotImplementedException(); }
public void Write(IDataReader source, string table, TaskExecutionContext context) { throw new NotImplementedException(); }
public abstract TaskResult OnExecute(TaskExecutionContext context);