use of org.guvnor.common.services.project.service.WorkspaceProjectService in project kie-wb-common by kiegroup.
the class FormsMigrationTool method run.
@Override
public void run(ToolConfig config, SystemAccess system) {
this.config = config;
this.system = system;
this.niogitDir = config.getTarget();
system.out().println("\nStarting Forms migration");
if (projectMigrationWasExecuted()) {
try {
MigrationSetup.configureProperties(system, niogitDir);
weldContainer = new Weld().initialize();
cdiWrapper = weldContainer.instance().select(MigrationServicesCDIWrapper.class).get();
if (systemMigrationWasExecuted()) {
pipeline = new MigrationPipeline();
if (!config.isBatch()) {
system.out().println(pipeline.getAllInfo());
Collection<String> validResponses = Arrays.asList("yes", "no");
String response;
do {
response = system.console().readLine("\nDo you want to continue? [yes/no]: ").toLowerCase();
} while (!validResponses.contains(response));
if ("no".equals(response)) {
return;
}
}
WorkspaceProjectService service = weldContainer.instance().select(WorkspaceProjectService.class).get();
service.getAllWorkspaceProjects().forEach(this::processWorkspaceProject);
}
} finally {
if (weldContainer != null) {
try {
cdiWrapper = null;
weldContainer.close();
} catch (Exception ex) {
}
}
}
}
}
Aggregations