From c2bd11fb8844c2d02d73218f8b330acb731ff2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Bergmann?= Date: Thu, 25 Mar 2021 21:31:30 +0100 Subject: [PATCH] #70 Force initialization of default Viatra query backends --- .../com/incquerylabs/v4md/ViatraQueryAdapter.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/ViatraQueryAdapter.java b/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/ViatraQueryAdapter.java index c88a466..8379b1c 100644 --- a/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/ViatraQueryAdapter.java +++ b/com.incquerylabs.v4md/src/main/com/incquerylabs/v4md/ViatraQueryAdapter.java @@ -18,6 +18,8 @@ import org.eclipse.viatra.query.runtime.api.IQuerySpecification; import org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions; import org.eclipse.viatra.query.runtime.exception.ViatraQueryException; +import org.eclipse.viatra.query.runtime.localsearch.matcher.integration.LocalSearchEMFBackendFactory; +import org.eclipse.viatra.query.runtime.rete.matcher.ReteBackendFactory; import com.incquerylabs.v4md.internal.MagicDrawProjectScope; import com.incquerylabs.v4md.internal.NopQueryBackend; @@ -37,6 +39,16 @@ public class ViatraQueryAdapter extends AdapterImpl { "Cannot initialize VIATRA Query Engine until the project is loaded."; private static final Logger LOGGER = Logger.getLogger(ViatraQueryAdapter.class); + + static { + ViatraQueryEngineOptions.setSystemDefaultBackends( + ReteBackendFactory.INSTANCE, + ReteBackendFactory.INSTANCE, + LocalSearchEMFBackendFactory.INSTANCE + ); + } + + private Optional engine = Optional.empty(); private Project project; private boolean engineDisposable = true;