X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.document.server%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fserver%2FFunctions.java;h=2ba85b733adc1d10d8888afe9cb0f27f6161c1bd;hb=72fb2b54adeee15fa47deb223e69d2dbfb2ab83f;hp=2fd422f5eb5447df01bbe491fd5349e5b861f0c8;hpb=96bb7ef9cbe42d82eb58306d8f9b62392cc29ba8;p=simantics%2Fplatform.git 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));