import org.simantics.scl.compiler.source.ModuleSource;
import org.simantics.scl.compiler.source.PrecompiledModuleSource;
import org.simantics.scl.compiler.source.repository.ModuleSourceRepository;
-import org.simantics.scl.runtime.SCLContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
if(!moduleName.startsWith("http://"))
return null; // Don't do a graph request if this cannot be a resource
- ReadGraph graph = (ReadGraph)SCLContext.getCurrent().get("graph");
-
try {
- if(graph != null) {
- return new PrecompiledModuleSource(new OntologyModule(graph, moduleName), -1.0);
- }
-
- return Simantics.getSession().syncRequest(new ModuleSourceRequest(moduleName));
+ return Simantics.getAvailableRequestProcessor().syncRequest(new ModuleSourceRequest(moduleName));
} catch(DatabaseException e) {
LOGGER.error("Failed to read ontology module " + moduleName + ".", e);
return null;