use of org.talend.mdm.repository.ui.dialogs.impact.ImpactResultDialog in project tmdm-studio-se by Talend.
the class ModelImpactAnalyseService method analyzeModelImpact.
public static Map<IRepositoryViewObject, ImpactOperation> analyzeModelImpact(MDMServerDef serverDef, List<IRepositoryViewObject> modelViewObjs) throws InterruptedException {
try {
Map<IRepositoryViewObject, Result> changes = analyzeModelChanges(serverDef, modelViewObjs);
if (!changes.isEmpty()) {
Shell shell = Display.getDefault().getActiveShell();
ImpactResultDialog dialog = new ImpactResultDialog(shell, changes);
if (dialog.open() == IDialogConstants.OK_ID) {
Map<IRepositoryViewObject, ImpactOperation> configuration = dialog.getImpactConfiguration();
return configuration;
} else {
Map<IRepositoryViewObject, ImpactOperation> configuration = new HashMap<IRepositoryViewObject, ModelImpactAnalyseService.ImpactOperation>(changes.size());
for (IRepositoryViewObject viewObj : changes.keySet()) {
configuration.put(viewObj, ImpactOperation.CANCEL);
}
return configuration;
}
}
} catch (XtentisException e) {
log.error(e.getMessage(), e);
}
return null;
}
Aggregations