1 package org.simantics.district.network.profile;
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.Resource;
5 import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;
6 import org.simantics.db.common.request.IndexRoot;
7 import org.simantics.db.common.request.ResourceRead;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.diagram.stubs.DiagramResource;
10 import org.simantics.district.network.visualisations.model.DynamicVisualisation;
13 * @author Jani Simomaa
15 public class RuntimeDynamicVisualisationsRequest extends ResourceRead<DynamicVisualisation> {
17 public RuntimeDynamicVisualisationsRequest(Resource runtimeDiagram) {
18 super(runtimeDiagram);
22 public DynamicVisualisation perform(ReadGraph graph) throws DatabaseException {
23 DiagramResource DIA = DiagramResource.getInstance(graph);
24 Resource diagram = graph.getPossibleObject(resource, DIA.RuntimeDiagram_HasConfiguration);
25 if (diagram != null) {
26 Resource model = graph.syncRequest(new IndexRoot(diagram));
27 return graph.syncRequest(new ActiveDynamicVisualisationsRequest(model), TransientCacheAsyncListener.instance());