import org.simantics.db.layer0.internal.SimanticsInternal;
import org.simantics.db.layer0.util.Layer0Utils;
import org.simantics.db.layer0.util.ModelTransferableGraphSourceRequest;
+import org.simantics.db.layer0.util.TGTransferableGraphSource;
import org.simantics.db.layer0.util.TransferableGraphConfiguration2;
import org.simantics.db.request.Read;
import org.simantics.db.service.ManagementSupport;
import org.simantics.db.service.SerialisationSupport;
import org.simantics.graph.db.IImportAdvisor;
import org.simantics.graph.db.IImportAdvisor2;
+import org.simantics.graph.db.ImportResult;
import org.simantics.graph.db.StreamingTransferableGraphFileReader;
import org.simantics.graph.db.TGStatusMonitor;
import org.simantics.graph.db.TransferableGraphImporter;
};
// Make sure that the supplied advisor is redirected to temp
advisor.redirect(indexRoot);
-
- TransferableGraphs.importGraph1WithMonitor(session, tg, advisor, new TGStatusMonitor() {
+
+ ImportResult ir = TransferableGraphs.importGraph1(session, new TGTransferableGraphSource(tg), advisor, new TGStatusMonitor() {
@Override
public void status(int percentage) {
monitor.subTask("Importing model from file (" + percentage + "%)");
return monitor.isCanceled();
}
});
-
+
+ setProperty(MigrationStateKeys.IMPORT_RESULT, ir);
setProperty(MigrationStateKeys.CURRENT_RESOURCE, indexRoot);
setProperty(MigrationStateKeys.CURRENT_ROOT_RESOURCES, new ArrayList<>(advisor.getRoots()));
setProperty(MigrationStateKeys.DATABASE_REVISION_AFTER_TG_IMPORT, session.getService(ManagementSupport.class).getHeadRevisionId());
// Make sure that the supplied advisor is redirected to temp
advisor.redirect(indexRoot);
- TransferableGraphs.importGraph1(session, tgs, advisor, new TGStatusMonitor() {
+ ImportResult ir = TransferableGraphs.importGraph1(session, tgs, advisor, new TGStatusMonitor() {
@Override
public void status(int percentage) {
monitor.subTask("Importing model from file (" + percentage + "%)");
}
});
+ setProperty(MigrationStateKeys.IMPORT_RESULT, ir);
setProperty(MigrationStateKeys.CURRENT_RESOURCE, indexRoot);
setProperty(MigrationStateKeys.CURRENT_ROOT_RESOURCES, new ArrayList<>(advisor.getRoots()));
setProperty(MigrationStateKeys.DATABASE_REVISION_AFTER_TG_IMPORT, session.getService(ManagementSupport.class).getHeadRevisionId());