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.ResourceRead;
7 import org.simantics.db.exception.DatabaseException;
8 import org.simantics.diagram.stubs.DiagramResource;
9 import org.simantics.district.network.visualisations.model.DynamicVisualisation;
12 * @author Jani Simomaa
14 public class RuntimeDynamicVisualisationsRequest extends ResourceRead<DynamicVisualisation> {
16 public RuntimeDynamicVisualisationsRequest(Resource runtimeDiagram) {
17 super(runtimeDiagram);
21 public DynamicVisualisation perform(ReadGraph graph) throws DatabaseException {
22 DiagramResource DIA = DiagramResource.getInstance(graph);
23 Resource diagram = graph.getPossibleObject(resource, DIA.RuntimeDiagram_HasConfiguration);
24 if (diagram != null) {
25 return graph.syncRequest(new DynamicVisualisationsRequest(diagram), TransientCacheAsyncListener.instance());