- RuntimeDiagramManager rtdm = runtimeDiagramManager;
- Resource runtimeDiagram = rtdm != null ? rtdm.getRuntimeDiagram() : null;
- IDiagramLoader loader = synchronizer;
- if (rtdm == null || runtimeDiagram == null || loader == null)
- return null;
- IDiagram d = sessionContext.getSession().syncRequest(
- DiagramRequests.loadDiagram(monitor, getResourceInput2().getModel(null), diagram,
- runtimeDiagram, null, loader, initialHints));
+ RuntimeDiagramManager rtdm = runtimeDiagramManager;
+ Resource runtimeDiagram = rtdm != null ? rtdm.getRuntimeDiagram() : null;
+ IDiagramLoader loader = synchronizer;
+ if (rtdm == null || runtimeDiagram == null || loader == null)
+ return null;
+ IDiagram d = sessionContext.getSession().syncRequest((Read<IDiagram>) graph -> {
+ IDiagram result = DiagramRequests.loadDiagram(monitor, getResourceInput2().getModel(null), diagram,
+ runtimeDiagram, null, loader, initialHints).perform(graph);
+
+ // #399: Enable certain PropertyTester implementation without database transactions
+ ModelingResources MOD = ModelingResources.getInstance(graph);
+ Resource composite = graph.getPossibleObject(diagram, MOD.DiagramToComposite);
+ result.setHint(
+ DiagramModelHints.KEY_DIAGRAM_RESOURCE_TYPE_URIS,
+ graph.syncRequest(new TypeURIs(diagram)));
+ result.setHint(
+ DiagramModelHints.KEY_MAPPED_COMPOSITE_RESOURCE_TYPE_URIS,
+ composite != null ? graph.syncRequest(new TypeURIs(composite)) : Collections.emptySet());
+
+ Resource diagramSource = graph.syncRequest(
+ new PossibleObject(diagram, MOD.HasDiagramSource),
+ hasDiagramSourceListener = new HasDiagramSourceListener(sourceDiagramContainer));
+ ElementUtils.setOrRemoveHint(
+ result,
+ DiagramModelHints.KEY_HAS_DIAGRAM_SOURCE,
+ diagramSource);
+
+ return result;
+ });