public Variable perform(ReadGraph graph) throws DatabaseException {\r
\r
DiagramResource DIA = DiagramResource.getInstance(graph);\r
+ ModelingResources MOD = ModelingResources.getInstance(graph);\r
\r
String uri = graph.getPossibleRelatedValue(resource, DIA.RuntimeDiagram_HasVariable);\r
if (uri == null)\r
if (var == null)\r
return null;\r
\r
- Resource config = graph.getPossibleObject(resource2, ModelingResources.getInstance(graph).ElementToComponent);\r
- if (config == null)\r
+ Resource config = graph.getPossibleObject(resource2, MOD.ElementToComponent);\r
+ if (config == null) {\r
+ // Apros #9646: if resource2 is the diagram\r
+ // itself, return the diagram composite variable\r
+ // since it is generally more useful than the\r
+ // variable to the diagram.\r
+ Resource composite = graph.getPossibleObject(resource2, MOD.DiagramToComposite);\r
+ if (composite != null && composite.equals(var.getPossibleRepresents(graph))) {\r
+ //return Variables.getPossibleVariable(graph, resource2);\r
+ return var;\r
+ }\r
+\r
return null;\r
+ }\r
\r
return var.browsePossible(graph, config);\r
\r