]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ProxyVariables.java
Adopt spreadsheet changes made in Balas development
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / variable / ProxyVariables.java
index ddfe108cb713a409f1da67df7e688748bdb94606..cd38064a89be00e83c4cf085ad8e83eaa2102c4b 100644 (file)
@@ -52,25 +52,9 @@ public class ProxyVariables {
        }
        
     public static Variable proxySessionVariable(ReadGraph graph, Variable variable) throws DatabaseException {
-       
-       try {
-               
-               Variable child = variable.getParent(graph);
-               Variable parent = child.getParent(graph);
 
-               if(parent instanceof ProxyChildVariable) {
-                       Variable var = ((ProxyChildVariable)parent).other();
-                       if(var.getParent(graph) == null) {
-                               return null;
-                       }
-                       return var;
-               } else {
-                       Variable input = parent.getPossiblePropertyValue(graph, "session");
-                       if(input == null) {
-                           System.out.println("null input for: " + parent.getURI(graph));
-                       }
-                       return input;
-               }
+        try {
+            return proxyVariableInput(graph, variable);
         } catch (Throwable t) {
             LOGGER.error("proxySessionVariable failed", t);
             return null;
@@ -109,7 +93,7 @@ public class ProxyVariables {
                } else {
                        Variable parent = variable.getParent(graph);
                        if(parent == null) return null;
-                       else return proxyVariableBase(graph, parent);
+                       else return proxyVariableInput(graph, parent);
                }
        
     }