]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/scl/CompileValueRequest.java
Fix errors with procedural user components for computational values
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / scl / CompileValueRequest.java
index 1eb01aa393b688d0809f95dbef56d3f2d848fda2..11f3ad1854b29e28dbc9724a7149d489b508e310 100644 (file)
@@ -34,19 +34,15 @@ public class CompileValueRequest extends AbstractExpressionCompilationRequest<Co
     }
 
     protected final Resource relation;
-    protected final Resource component;
     protected final Resource literal;
 
-    public CompileValueRequest(Resource component, Resource literal, Resource relation) {
+    public CompileValueRequest(Resource literal, Resource relation) {
         this.relation = relation;
-        this.component = component;
         this.literal = literal;
     }
 
     public CompileValueRequest(ReadGraph graph, Variable context) throws DatabaseException {
-        this(context.getParent(graph).getRepresents(graph),
-                context.getRepresents(graph),
-                context.getPredicateResource(graph));
+        this(context.getRepresents(graph), context.getPredicateResource(graph));
     }
 
     public static Object compileAndEvaluate(ReadGraph graph, Variable context) throws DatabaseException {
@@ -66,12 +62,11 @@ public class CompileValueRequest extends AbstractExpressionCompilationRequest<Co
         }
     }
 
-    public static Function1<Object,Object> compile(ReadGraph graph, Resource component, Resource literal, Resource predicate) throws DatabaseException {
+    public static Function1<Object,Object> compile(ReadGraph graph, Resource literal, Resource predicate) throws DatabaseException {
         SCLContext sclContext = SCLContext.getCurrent();
         Object oldGraph = sclContext.get("graph");
         try {
-            Function1<Object,Object> exp = graph.syncRequest(new CompileValueRequest(component, literal, predicate),
-                    TransientCacheListener.instance());
+            Function1<Object,Object> exp = graph.syncRequest(new CompileValueRequest(literal, predicate), TransientCacheListener.instance());
             sclContext.put("graph", graph);
             return exp;
         } catch (DatabaseException e) {