]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java
foobaz
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / graph / ReadGraphImpl.java
index 3feb22e00ebda688379b6ed7c8785b09fb8035ca..61a312e9e185f6c3429d13cc5c65f0e7dca9b667 100644 (file)
@@ -45,6 +45,7 @@ import org.simantics.databoard.type.Datatype;
 import org.simantics.databoard.util.binary.BinaryFile;
 import org.simantics.databoard.util.binary.RandomAccessBinary;
 import org.simantics.db.AsyncReadGraph;
+import org.simantics.db.ComputationalValue;
 import org.simantics.db.DevelopmentKeys;
 import org.simantics.db.ExternalValueSupport;
 import org.simantics.db.ReadGraph;
@@ -181,7 +182,6 @@ import org.simantics.layer0.Layer0;
 import org.simantics.scl.compiler.types.Type;
 import org.simantics.scl.compiler.types.exceptions.SCLTypeParseException;
 import org.simantics.scl.reflection.ReflectionUtils;
-import org.simantics.scl.reflection.ValueNotFoundException;
 import org.simantics.scl.runtime.function.Function3;
 import org.simantics.utils.DataContainer;
 import org.simantics.utils.Development;
@@ -6102,13 +6102,22 @@ public class ReadGraphImpl implements AsyncReadGraph {
                        return getValue(r, binding);
                }
        } else if(types.contains(L0.ExternalValue)) {
-               try {
-                       return (T)ReflectionUtils.getValue(getURI(r)).getValue();
-               } catch(ValueNotFoundException e) {
-                       throw new DatabaseException(e);
-               } catch(ClassCastException e) {
-                       throw new DatabaseException(e);
-               }
+            try {
+                ComputationalValue cv = adapt(r, ComputationalValue.class);
+                return cv.getValue(this, r);
+                //return (T)ReflectionUtils.getValue(getURI(r)).getValue();
+//          } catch(ValueNotFoundException e) {
+//              throw new DatabaseException(e);
+            } catch(ClassCastException e) {
+                throw new DatabaseException(e);
+            }
+//             try {
+//                     return (T)ReflectionUtils.getValue(getURI(r)).getValue();
+//             } catch(ValueNotFoundException e) {
+//                     throw new DatabaseException(e);
+//             } catch(ClassCastException e) {
+//                     throw new DatabaseException(e);
+//             }
        }
        else {
            Function3<ReadGraph,Resource,Object,T> function = requestValueFunction(r);