I'm working on a plugin on eclipse that allows transformations (QVTo) on the underlying UML files for a diagram. If the transformation deletes an entity from the UML file, the entity is still present in the diagram with a "deleted" emblem on it. Is there any way to force the diagram to update based on the UML file?
to remove the invalid views, you will find in the contextual menu of diagrams (right click on the diagram) the action "Edit" > "Clean Invalid Views ".
This will remove these invalid views from the diagram. Otherwise, in the latest versions of Papyrus, there should be a listener on model files when Papyrus is opened on the model, which ask you for reloading when the UML file is modified outside Papyrus itself. This could do also the job.
for the listener, you should look in the plugin org.eclipse.papyrus.diagram.common, the class org.eclipse.papyrus.diagram.common.resourceupdate.ResourceUp dateService. It listens for resource modification and asks for updates when required.
I'm facing the same problem as Haffi.
I programatically add/remove elements to/from underlying UML model of Papyrus diagram.
After modifications are done .uml is updated automatically and contains all the modifications as it should.
.di is updated after accepting the update suggestion from a dialog when I attempt to close the editor. But here I face the 1st problem: the updated diagram doesn't show the added elements and the removed ones are still visible with a mark (implying removed) on them.
Remi's suggestion ("Edit" > "Clean Invalid Views ") doesn't hide the removed elements.
By drag-and-drop I can finally make the diagram look the way I should but here arises the 2nd problem: the edge Realization is shown as a Dependency in .di.
Is there other then drag-and-drop way to update the .di?
I have the same problem. I'm making some m2m transformations to underlying UML model (add and remove elements) of Papyrus diagram but I don't know how to update the .di and .notation files. "Edit-> Clean Invalid Views" doesn't work.