1 package org.simantics.db.layer0.request;
3 import java.util.Collection;
5 import org.simantics.db.ReadGraph;
6 import org.simantics.db.Resource;
7 import org.simantics.db.common.request.ResourceRead;
8 import org.simantics.db.exception.DatabaseException;
11 * Returns the active model or null if no single active model is available.
13 public class PossibleActiveModel extends ResourceRead<Resource> {
15 public PossibleActiveModel(Resource project) {
20 public Resource perform(ReadGraph graph) throws DatabaseException {
21 Collection<Resource> actives = graph.syncRequest(new ActiveModels(resource));
22 if (actives.size() == 1)
23 return actives.iterator().next();