* 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
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;
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."));