From: jsimomaa Date: Wed, 12 Jul 2017 11:18:41 +0000 (+0300) Subject: AbstractCompileStructuralValueRequest uses wrong RuntimeEnvironment X-Git-Tag: v1.31.0~264^2~50^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F12%2F712%2F1;p=simantics%2Fplatform.git AbstractCompileStructuralValueRequest uses wrong RuntimeEnvironment refs #7363 Change-Id: I4b60a5cc4aefc65c86b88ff93fe8951f40bd1238 --- diff --git a/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/AbstractCompileStructuralValueRequest.java b/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/AbstractCompileStructuralValueRequest.java index e4f08db10..283e1b5dd 100644 --- a/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/AbstractCompileStructuralValueRequest.java +++ b/bundles/org.simantics.structural2/src/org/simantics/structural2/scl/AbstractCompileStructuralValueRequest.java @@ -7,6 +7,7 @@ import org.simantics.databoard.Bindings; 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; @@ -62,8 +63,10 @@ abstract public class AbstractCompileStructuralValueRequest extends AbstractExpr 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(); }