I have a rather complex model and want to show only parts of that model inside the diagram editor.
Currently I am able to show a specific part of the model but I'd like to know what I
have to do if I want to change the displayed model part at runtime?
I tried to recreate the diagram and editing domain and set this as input and it displays the figures correctly but I am not able to interact with the diagram (move etc) any longer afterwards as it spits always
!MESSAGE GFCommandStack.execute(Command) java.lang.IllegalStateException: Cannot modify resource set without a write transaction
Hernan Gonzalez Messages: 180 Registered: October 2010 Location: Buenos Aires, Argentina
To have a diagram that includes part of the model is doable (and noy unusual) in Graphiti. But I'm not clear about what relation this requirement has with your problem. Are you saying that you can manipulate your diagram ok when it comprises all the model, but you get that error when it's a partial view? That would be strange. Are you interacting with the model by the standard Graphiti ways (features), or are you manipulating it programatically? If so, are you aware that all modifications must be done inside a EMF transaction ? (when you modify the diagram inside a Graphiti feature, the framework takes care of this, elsewhere you must do that explicitly)
I always only show parts of the model. With the initial loaded diagram all works fine but when I switch to another part of the model it causes that issue.
What you say about the transactions sounds interesting. What I was really wondering about is that after "recreating" the diagram the move / layout features for example do not work any longer and spit that transaction error. I guess I have done something wrong when switching the diagram.