\r
}\r
\r
- public static org.simantics.db.layer0.variable.Variable lastValue2(ReadGraph graph, org.simantics.db.layer0.variable.Variable run, String path) throws DatabaseException {\r
+ public static org.simantics.db.layer0.variable.Variable lastValue2(ReadGraph graph, org.simantics.db.layer0.variable.Variable input, String path) throws DatabaseException {\r
\r
- if(run == null) return null;\r
+ if(input == null) return null;\r
+ \r
+ org.simantics.db.layer0.variable.Variable context = Variables.getPossibleContext(graph, input);\r
+ if(context == null) {\r
+ context = Variables.getConfigurationContext(graph, input);\r
+ if(context == null) return null;\r
+ }\r
\r
- org.simantics.db.layer0.variable.Variable v = run.browsePossible(graph, "/" + path);\r
+ org.simantics.db.layer0.variable.Variable v = context.browsePossible(graph, "/" + path);\r
if(v == null) return null;\r
\r
org.simantics.db.layer0.variable.Variable p = v.browsePossible(graph, "#value#$0");\r
\r
}\r
\r
+ public static org.simantics.db.layer0.variable.Variable currentValue(ReadGraph graph, org.simantics.db.layer0.variable.Variable input, String path) throws DatabaseException {\r
+ \r
+ if(input == null) return null;\r
+ \r
+ org.simantics.db.layer0.variable.Variable context = Variables.getPossibleContext(graph, input);\r
+ if(context == null) {\r
+ context = Variables.getConfigurationContext(graph, input);\r
+ if(context == null) return null;\r
+ }\r
+\r
+ org.simantics.db.layer0.variable.Variable v = context.browsePossible(graph, "/" + path);\r
+ if(v == null) return null;\r
+\r
+ org.simantics.db.layer0.variable.Variable p = v.browsePossible(graph, "#value#$0");\r
+ if(p == null) return null;\r
+ \r
+ return p;\r
+ \r
+ }\r
+ \r
/**\r
* Splits indexed variable reference into name and indices part.\r
* \r
return v;\r
} \r
\r
- public static org.simantics.db.layer0.variable.Variable equation(ReadGraph graph, org.simantics.db.layer0.variable.Variable run, String path) throws DatabaseException {\r
+ public static org.simantics.db.layer0.variable.Variable equation(ReadGraph graph, org.simantics.db.layer0.variable.Variable input, String path) throws DatabaseException {\r
\r
- if(run == null) return null;\r
+ if(input == null) return null;\r
+ \r
+ org.simantics.db.layer0.variable.Variable context = Variables.getPossibleContext(graph, input);\r
+ if(context == null) {\r
+ context = Variables.getConfigurationContext(graph, input);\r
+ if(context == null) return null;\r
+ }\r
\r
- org.simantics.db.layer0.variable.Variable v = run.browsePossible(graph, "/" + path);\r
+ org.simantics.db.layer0.variable.Variable v = context.browsePossible(graph, "/" + path);\r
if(v == null) return null;\r
\r
org.simantics.db.layer0.variable.Variable p = v.browsePossible(graph, "#equation");\r