X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.document.server%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fserver%2FFunctions.java;h=2ba85b733adc1d10d8888afe9cb0f27f6161c1bd;hp=2fd422f5eb5447df01bbe491fd5349e5b861f0c8;hb=4a2d762e1e33404d77eeec4542a4a10bfa738dd2;hpb=ad8333027322fda6b9a8a524c7a7e15a54c52f38 diff --git a/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java b/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java index 2fd422f5e..2ba85b733 100644 --- a/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java +++ b/bundles/org.simantics.document.server/src/org/simantics/document/server/Functions.java @@ -185,6 +185,13 @@ public class Functions { return Variables.getVariable(graph, uri); } + public static Variable stateVariable(ReadGraph graph, Variable self) throws DatabaseException { + Variable session = graph.syncRequest(new ProxySessionRequest(self)); + if (session == null) + throw new DatabaseException("No state for " + self.getURI(graph)); + return session.getPossibleChild(graph, "__scl__"); + } + @SCLValue(type = "ReadGraph -> Resource -> Variable -> Variable") public static Variable state(ReadGraph graph, Resource converter, Variable context) throws DatabaseException { Variable session = graph.syncRequest(new ProxySessionRequest(context));