X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fadapter%2FSCLComputationalValue.java;h=743f8e4454600edd28e8e33847616e8ddbfa5a82;hp=83382adb3325eaa128087ff3161c44f18755b54c;hb=e807368d0e75809e0797d9cea1063b046fabf352;hpb=9712014e959584157b02e594be8719c151b8f5b0 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/SCLComputationalValue.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/SCLComputationalValue.java index 83382adb3..743f8e445 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/SCLComputationalValue.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/SCLComputationalValue.java @@ -24,11 +24,14 @@ import org.simantics.scl.runtime.function.Function1; */ public class SCLComputationalValue extends ContextualRelatedValue { + // TODO: unify and merge CompileValueRequest and CompileResourceValueRequest as one @Override public Function1 getFunction(ReadGraph graph, Resource s, Resource o, Resource p) throws DatabaseException { - if (s != null && p != null && o != null) { - return CompileValueRequest.compile(graph, s, o, p); + if (p != null && o != null) { + // we are now at Variable context + return CompileValueRequest.compile(graph, o, p); } else if (o != null) { + // we are now at Resource context return CompileResourceValueRequest.compile(graph, o); } else { throw new DatabaseException("Could not compile SCL expression: s=" + s + " p=" + p + " o=" + o);