protected ConfigureAndExecutePipelineUI GetConfigureAndExecuteControl(CohortCreationRequest request, string description) { var catalogueRepository = Activator.RepositoryLocator.CatalogueRepository; ConfigureAndExecutePipelineUI configureAndExecuteDialog = new ConfigureAndExecutePipelineUI(request, Activator); configureAndExecuteDialog.Dock = DockStyle.Fill; configureAndExecuteDialog.PipelineExecutionFinishedsuccessfully += (o, args) => OnCohortCreatedSuccessfully(configureAndExecuteDialog, request); //add in the logging server var loggingServer = catalogueRepository.GetServerDefaults().GetDefaultFor(PermissableDefaults.LiveLoggingServer_ID); if (loggingServer != null) { var logManager = new LogManager(loggingServer); logManager.CreateNewLoggingTaskIfNotExists(ExtractableCohort.CohortLoggingTask); //create a db listener var toDbListener = new ToLoggingDatabaseDataLoadEventListener(this, logManager, ExtractableCohort.CohortLoggingTask, description); //make all messages go to both the db and the UI configureAndExecuteDialog.SetAdditionalProgressListener(toDbListener); //after executing the pipeline finalise the db listener table info records configureAndExecuteDialog.PipelineExecutionFinishedsuccessfully += (s, e) => toDbListener.FinalizeTableLoadInfos(); } return(configureAndExecuteDialog); }
public override IPipelineRunner GetPipelineRunner(IPipelineUseCase useCase, IPipeline pipeline) { ConfigureAndExecutePipelineUI configureAndExecuteDialog = new ConfigureAndExecutePipelineUI(useCase, this); configureAndExecuteDialog.Dock = DockStyle.Fill; return(configureAndExecuteDialog); }
public CreateNewCatalogueByImportingFileUI_Advanced(IActivateItems activator, DiscoveredDatabase database, FileInfo file, bool alsoForwardEngineerCatalogue, Project projectSpecific) { _repositoryLocator = activator.RepositoryLocator; _activator = activator; _database = database; _alsoForwardEngineerCatalogue = alsoForwardEngineerCatalogue; _projectSpecific = projectSpecific; InitializeComponent(); configureAndExecutePipeline1 = new ConfigureAndExecutePipelineUI(new UploadFileUseCase(file, database), activator); _file = file; // // configureAndExecutePipeline1 // configureAndExecutePipeline1.Dock = System.Windows.Forms.DockStyle.Fill; configureAndExecutePipeline1.Location = new System.Drawing.Point(0, 0); configureAndExecutePipeline1.Name = "configureAndExecutePipeline1"; configureAndExecutePipeline1.Size = new System.Drawing.Size(979, 894); configureAndExecutePipeline1.TabIndex = 14; Controls.Add(this.configureAndExecutePipeline1); configureAndExecutePipeline1.PipelineExecutionFinishedsuccessfully += ConfigureAndExecutePipeline1OnPipelineExecutionFinishedsuccessfully; }
public override void Execute() { base.Execute(); if (_aggregateConfiguration == null) { _aggregateConfiguration = SelectOne <AggregateConfiguration>(Activator.RepositoryLocator.CatalogueRepository); } if (_aggregateConfiguration == null) { return; } if (_aggregateConfiguration.IsJoinablePatientIndexTable()) { var dr = MessageBox.Show("Would you like to constrain the records to only those in a committed cohort?", "Cohort Records Only", MessageBoxButtons.YesNoCancel); if (dr == DialogResult.Cancel) { return; } if (dr == DialogResult.Yes) { _cohort = SelectOne <ExtractableCohort>(Activator.RepositoryLocator.DataExportRepository); if (_cohort == null) { return; } } if (_cohort != null) { var externalData = _cohort.GetExternalData(); if (externalData != null) { var projNumber = externalData.ExternalProjectNumber; var projs = Activator.RepositoryLocator.DataExportRepository.GetAllObjects <Project>().Where(p => p.ProjectNumber == projNumber).ToArray(); if (projs.Length == 1) { _projectSpecific = projs[0]; } } } } _table = SelectTable(true, "Choose destination table name"); if (_table == null) { return; } var useCase = new CreateTableFromAggregateUseCase(_aggregateConfiguration, _cohort, _table); var ui = new ConfigureAndExecutePipelineUI(useCase, Activator); ui.PipelineExecutionFinishedsuccessfully += ui_PipelineExecutionFinishedsuccessfully; Activator.ShowWindow(ui, true); }