1 package org.simantics.db.layer0.request;
3 import java.util.ArrayList;
4 import java.util.Collection;
6 import org.simantics.db.ReadGraph;
7 import org.simantics.db.Resource;
8 import org.simantics.db.common.request.ObjectsWithType;
9 import org.simantics.db.common.request.ResourceRead;
10 import org.simantics.db.exception.DatabaseException;
11 import org.simantics.layer0.Layer0;
12 import org.simantics.simulation.ontology.SimulationResource;
15 * Returns a set of active models.
17 * @author Tuukka Lehtonen
19 public class ProjectModels extends ResourceRead<Collection<Resource>> {
21 public ProjectModels(Resource project) {
26 public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {
27 Layer0 L0 = Layer0.getInstance(graph);
28 SimulationResource SIMU = SimulationResource.getInstance(graph);
29 ArrayList<Resource> result = new ArrayList<Resource>();
30 for (Resource model : graph.syncRequest(new ObjectsWithType(resource, L0.ConsistsOf, SIMU.Model))) {