import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.common.procedure.adapter.TransientCacheListener;
+import org.simantics.db.common.request.PossibleIndexRoot;
import org.simantics.db.common.request.ResourceRead2;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.scl.AbstractExpressionCompilationContext;
Layer0 L0 = Layer0.getInstance(graph);
String valueType = graph.getPossibleRelatedValue(relation, L0.RequiresValueType, Bindings.STRING);
if(valueType != null) {
+ Resource relationIndexRoot = graph.syncRequest(new PossibleIndexRoot(relation));
+ RuntimeEnvironment relationRuntimeEnvironment = relationIndexRoot != null ? graph.syncRequest(new RuntimeEnvironmentRequest(relationIndexRoot)) : context.runtimeEnvironment;
try {
- return Environments.getType(context.runtimeEnvironment.getEnvironment(), valueType);
+ return Environments.getType(relationRuntimeEnvironment.getEnvironment(), valueType);
} catch (SCLExpressionCompilationException e) {
e.printStackTrace();
}