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); }