use of org.talend.dataprofiler.migration.manager.MigrationTaskManager in project tdq-studio-se by Talend.
the class FileSystemImportWriter method migration.
/*
* (non-Javadoc)
*
* @see org.talend.dataprofiler.core.ui.imex.model.IImexWriter#migration(org.eclipse.core.runtime.IProgressMonitor)
*/
public void migration(IProgressMonitor monitor) {
List<IMigrationTask> modelTasks = new ArrayList<IMigrationTask>();
if (versionFile != null && versionFile.exists()) {
ProductVersion version = WorkspaceVersionHelper.getVesion(new Path(versionFile.getAbsolutePath()));
MigrationTaskManager manager = new MigrationTaskManager(version, MigrationTaskType.FILE);
List<IMigrationTask> taskList = manager.getValidTasks();
if (!taskList.isEmpty()) {
for (IMigrationTask task : taskList) {
if (task.isModelTask()) {
((AbstractWorksapceUpdateTask) task).setWorkspacePath(basePath);
modelTasks.add(task);
} else {
// MOD msjian TDQ-7365 2013-5-27: only added the not inclued tasks
if (!commTasks.contains(task)) {
commTasks.add(task);
}
// TDQ-7365~
}
}
}
}
if (!modelTasks.isEmpty()) {
MigrationTaskManager.doMigrationTask(modelTasks, monitor);
}
}
Aggregations