enhancement
major
minor
major
minor
The cause is that a GraphPart does not remove its dependency on the graph when it is deleted.
The graph in the Model Editor is a `tl:DefaultGraphModel`, which is itself a `tl:SharedObjectData`.
- The `tl:DefaultGraphModel` contains a mapping from a business object to the corresponding `tl:GraphPart`. This allows the developer to quickly access the graph object using the `tl:GraphModel` and the business object.
See the API methods getNode(businessObject) and getGraphPart(businessObject) in `tl:DefaultGraphModel`.
- The `tl:SharedObjectData` provides a mapping to easily determine the referrers of certain properties (e.g., ` OWNER`, `LABEL_TYPE`, `PARENT`, etc.) of a `tl:SharedObjectData`.
This mechanism is used to determine all nodes in a graph. In `tl:DefaultGraphModel`, the `getNodes() ` API is implemented as {{{#!java filterNodes(getReferrers(DefaultGraphPart.class, DefaultGraphPart.GRAPH))
}}}
all tl:GraphPart instances whose DefaultGraphPart.GRAPH property holds the current graph (tl:GraphModel) as its value.
The set of referrers is cached and, specifically for the DefaultGraphPart.GRAPH property, is not updated if a tl:GraphPart is removed from the graph.
Test
- Create a new module M.
- In M, create type `A` with subtype `B `.
- Then delete `B` via the details view or directly in the diagram.
- Drag an external type (e.g., Person) into the diagram.
- The error message "Object already deleted" must not appear.