1 package org.simantics.db.layer0.request;
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.Resource;
5 import org.simantics.db.common.request.ResourceRead;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.layer0.Layer0;
8 import org.simantics.simulation.ontology.SimulationResource;
10 public class PossibleExperiment extends ResourceRead<Resource> {
12 public PossibleExperiment(Resource partOfExperiment) {
13 super(partOfExperiment);
17 public Resource perform(ReadGraph graph) throws DatabaseException {
20 SimulationResource SIMU = SimulationResource.getInstance(graph);
21 Layer0 L0 = Layer0.getInstance(graph);
23 if (graph.isInstanceOf(resource, SIMU.Experiment))
26 Resource parent = graph.getPossibleObject(resource, L0.PartOf);
30 else return graph.syncRequest(new PossibleExperiment(parent));