X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics%2Fsrc%2Forg%2Fsimantics%2FSimanticsPlatform.java;h=2504ba62d8f9ae04f4111bfbdaafa0086409d8f1;hp=a4206e7da3e677a947a6b1db5e7033f547f32eaa;hb=refs%2Fheads%2Frelease%2F1.37.0;hpb=822e1250b400a6a8d473a69e11da78f80a873eb8 diff --git a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java index a4206e7da..2504ba62d 100644 --- a/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java +++ b/bundles/org.simantics/src/org/simantics/SimanticsPlatform.java @@ -153,7 +153,7 @@ public class SimanticsPlatform implements LifecycleListener { * It is applied when the ontology in the database of a workspace doesn't match * a newer ontology in the Eclipse workspace. */ - public static enum OntologyRecoveryPolicy { ThrowError, Merge, ReinstallDatabase } + public static enum OntologyRecoveryPolicy { ThrowError, Merge, ReinstallDatabase, Bypass} /** * This policy dictates how the Simantics platform startup should react if @@ -346,7 +346,7 @@ public class SimanticsPlatform implements LifecycleListener { session.getService(XSupport.class).setServiceMode(true, true); // Throw error - if (ontologyPolicy == OntologyRecoveryPolicy.ThrowError) { + if (ontologyPolicy == OntologyRecoveryPolicy.ThrowError || ontologyPolicy == OntologyRecoveryPolicy.Bypass) { StringBuilder sb = new StringBuilder("The following graphs are not installed in the database: "); if (!installTGs.isEmpty()) { int i = 0; @@ -367,8 +367,12 @@ public class SimanticsPlatform implements LifecycleListener { sb.append(" Database/Platform Bundle version mismatch.\n"); } sb.append("Hint: Use -fixErrors to install the graphs."); - throw new PlatformException(sb.toString()); + if (ontologyPolicy == OntologyRecoveryPolicy.ThrowError) + throw new PlatformException(sb.toString()); + else + log.log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, sb.toString())); } + // Reinstall database if (ontologyPolicy == OntologyRecoveryPolicy.ReinstallDatabase) { log.log(new Status(IStatus.INFO, Activator.PLUGIN_ID, "Reinstalling the database."));