예제 #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;
 }
예제 #2
0
파일: TaskLink.cs 프로젝트: raasiel/Reflow
 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);
         }
     }
 }
예제 #3
0
파일: CodedTask.cs 프로젝트: raasiel/Reflow
        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
            };
        }
예제 #4
0
파일: TaskBase.cs 프로젝트: raasiel/Reflow
 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;
 }
예제 #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);
 }
예제 #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;
        }
예제 #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;
 }
예제 #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");
        }
예제 #9
0
 public override TaskResult OnExecute(TaskExecutionContext context)
 {
     throw new NotImplementedException();
 }
예제 #10
0
 public void Write(IDataReader source, string table, TaskExecutionContext context)
 {
     throw new NotImplementedException();
 }
예제 #11
0
파일: TaskBase.cs 프로젝트: raasiel/Reflow
 public abstract TaskResult OnExecute(TaskExecutionContext context);