public IDatastore LoadDataFromSource(DesignerItemBase sourceItem, IDatastore dataStore, ReportProgressMethod reportProgressMethod) { IModule sourceObject = objectResolver.GetModule(sourceItem.ID, sourceItem.ModuleDescription.ModuleType); IConnection connectionObject = objectResolver.GetConnection(sourceItem.ID); if (connectionObject == null) { if (runLog != null) { string label = String.IsNullOrEmpty(sourceItem.ItemLabel) ? "-- No Label --" : sourceItem.ItemLabel; throw new Exception("No connection was selected for the source '" + label + "'."); } dataStore = null; } ItemLog itemLog = ItemLog.CreateNew(sourceItem.ID, sourceItem.ItemLabel, sourceItem.ModuleDescription.ModuleType.Name, null); if (runLog != null) { var databaseInterface = SqliteWrapper.GetSqliteWrapper(runLog.RunLogPath, sourceItem.ID, sourceItem.ItemLabel); itemLog.DatabasePath = runLog.RunLogPath + "\\" + databaseInterface.GetDatabaseName(); parentItemLog.SubFlowLogs.Add(itemLog); } ((IDataSource)sourceObject).LoadData(connectionObject, dataStore, reportProgressMethod); itemLog.EndTime = DateTime.Now; return(dataStore); }
public void Execute() { var designerItem = itemWorker.DesignerItem; IModule stepModule = objectResolver.GetModule(designerItem.ID, designerItem.ModuleDescription.ModuleType); IConnection connectionObject = null; if (designerItem.ModuleDescription.Attributes.RequiresConnection) { connectionObject = objectResolver.GetConnection(designerItem.ID); } IDatabaseInterface databaseInterface = SqliteWrapper.GetSqliteWrapper(runLog.RunLogPath, designerItem.ID, designerItem.ItemLabel); ((IStep)stepModule).Execute(connectionObject, databaseInterface, ReportProgressMethod); }
public IDatastore WriteToTarget(DesignerItemBase targetItem, IDatastore dataStore, ReportProgressMethod reportProgressMethod) { IModule targetModule = objectResolver.GetModule(targetItem.ID, targetItem.ModuleDescription.ModuleType); IConnection connectionObject = objectResolver.GetConnection(targetItem.ID); IDatabaseInterface databaseInterface = SqliteWrapper.GetSqliteWrapper(runLog.RunLogPath, targetItem.ID, targetItem.ItemLabel); ItemLog itemLog = ItemLog.CreateNew(targetItem.ID, targetItem.ItemLabel, targetItem.ModuleDescription.ModuleType.Name, runLog.RunLogPath + "\\" + databaseInterface.GetDatabaseName()); ((IDataTarget)targetModule).WriteData(connectionObject, databaseInterface, dataStore, reportProgressMethod); itemLog.EndTime = DateTime.Now; parentItemLog.SubFlowLogs.Add(itemLog); return(dataStore); }