ValueType modifications to satisfy compilation of SCL-expressions
[simantics/platform.git] / bundles / org.simantics.document.server / src / org / simantics / document / server / request / ServerSCLValueRequest.java
index e6cdf6ff5b43712b098594d172a91b7595de63cb..68602de69022bc6eeaf4f24375c1ff3c01bcf763 100644 (file)
@@ -91,8 +91,7 @@ public class ServerSCLValueRequest extends AbstractExpressionCompilationRequest<
                SCLContext sclContext = SCLContext.getCurrent();
         Object oldGraph = sclContext.get("graph");
                try {
-                       Function1<Variable,Object> exp = graph.syncRequest(new ServerSCLValueRequest(graph, context),
-                                       TransientCacheListener.<Function1<Variable,Object>>instance());
+                       Function1<Variable,Object> exp = compile(graph, context);
                        sclContext.put("graph", graph);
                        return exp.apply(context);
                } catch (DatabaseException e) {
@@ -103,6 +102,10 @@ public class ServerSCLValueRequest extends AbstractExpressionCompilationRequest<
             sclContext.put("graph", oldGraph);
                }
        }
+       
+       public static Function1<Variable, Object> compile(ReadGraph graph, Variable context) throws DatabaseException {
+           return graph.syncRequest(new ServerSCLValueRequest(graph, context), TransientCacheListener.<Function1<Variable,Object>>instance());
+       }
 
        @Override
        protected String getExpressionText(ReadGraph graph)