-package org.simantics.db.layer0.request;\r
-\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.common.request.ResourceRead;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.layer0.Layer0;\r
-import org.simantics.simulation.ontology.SimulationResource;\r
-\r
-public class PossibleExperiment extends ResourceRead<Resource> {\r
-\r
- public PossibleExperiment(Resource partOfExperiment) {\r
- super(partOfExperiment);\r
- }\r
-\r
- @Override\r
- public Resource perform(ReadGraph graph) throws DatabaseException {\r
-\r
-\r
- SimulationResource SIMU = SimulationResource.getInstance(graph);\r
- Layer0 L0 = Layer0.getInstance(graph);\r
- \r
- if (graph.isInstanceOf(resource, SIMU.Experiment))\r
- return resource;\r
- \r
- Resource parent = graph.getPossibleObject(resource, L0.PartOf);\r
- if (parent == null)\r
- return null;\r
- \r
- else return graph.syncRequest(new PossibleExperiment(parent));\r
-\r
- }\r
-\r
-}\r
+package org.simantics.db.layer0.request;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.common.request.ResourceRead;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.layer0.Layer0;
+import org.simantics.simulation.ontology.SimulationResource;
+
+public class PossibleExperiment extends ResourceRead<Resource> {
+
+ public PossibleExperiment(Resource partOfExperiment) {
+ super(partOfExperiment);
+ }
+
+ @Override
+ public Resource perform(ReadGraph graph) throws DatabaseException {
+
+
+ SimulationResource SIMU = SimulationResource.getInstance(graph);
+ Layer0 L0 = Layer0.getInstance(graph);
+
+ if (graph.isInstanceOf(resource, SIMU.Experiment))
+ return resource;
+
+ Resource parent = graph.getPossibleObject(resource, L0.PartOf);
+ if (parent == null)
+ return null;
+
+ else return graph.syncRequest(new PossibleExperiment(parent));
+
+ }
+
+}