Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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);
         }
     }
 }
Exemplo n.º 3
0
        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
            };
        }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
        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;
        }
Exemplo n.º 7
0
 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;
 }
Exemplo n.º 8
0
        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");
        }
Exemplo n.º 9
0
 public override TaskResult OnExecute(TaskExecutionContext context)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 10
0
 public void Write(IDataReader source, string table, TaskExecutionContext context)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 11
0
 public abstract TaskResult OnExecute(TaskExecutionContext context);