Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » How to add several use-case diagrams to one model file?
How to add several use-case diagrams to one model file? [message #624872] Sat, 19 September 2009 16:25 Go to next message
No real name is currently offline No real name
Messages: 2
Registered: September 2009
Junior Member
Dear all,

I am fairly new to UML2tools and have stumbled on a problem that dramatically reduces the usefullness of UML2tools - it seems to be possible to only have one diagram of the same type in a certain UML model.

I am able to create a new diagram using the File, New menu, and a model file is created along with the first diagram file I create.

By right clicking on the model file in the Project explorer, I can create several more diagrams that are connected to the same model (if I use the File, New menu to create a new diagram, every new diagram comes with its own new model file as well) using the "Initialize...." context menu commands.

However, whenever I create more than one diagram of the same type for a model file, the second diagram is autopopulated with the contents of the first diagram, and they do in general interfere with each other.

Creating every diagram with its own model file appears to break the connections between the diagrams, ie the OnEnter action in a statechart state, can for example not find an activity defined in an activity diagram.

So, what is the recommended way to create several diagram files of the same type for a model file, such that the diagrams can find each other's information?

Any information most welcome!

Kind regards,
Goran
Re: How to add several use-case diagrams to one model file? [message #624874 is a reply to message #624872] Thu, 24 September 2009 12:10 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 61
Registered: July 2009
Member
Hello Goran,

Yes, it is possible to create several diagrams of the same kind for the same model.

All UML2 Tools diagrams are in synchronized mode by default. To be in synchronized mode means, that changes in the model are reflected on the diagramimmediately and vise versa. The opposite to 'synchronized' is 'semi-synchronized' mode, when the user can manage content of the diagram, e.g. delete an element from the diagram or add an existing element to the diagram. This semi-synchronized mode is what you actually need. As I mentioned above, the diagrams are synchronized by default. How to make them semi-synchronozed?

Just invoke the context menu of the diagram, select 'Synchronize...' action. In the dialog opened select the root element (model or package), invoke context menu for it and select 'Disable Synchronization' action. Now press 'OK' for the 'Synchronize...' diagram and that's it.
Reapeat this procedure with all diagrams you would like to have semi-synchronized.

A bit more information on how to work with semi-synchronized diagrams can be found here - http://wiki.eclipse.org/MDT/UML2Tools/New_and_Noteworthy/Gal ileo#Class_diagram_synchronization

Best wishes,
Tanya.
Re: How to add several use-case diagrams to one model file? [message #625104 is a reply to message #624874] Fri, 23 October 2009 18:54 Go to previous messageGo to next message
Johan  is currently offline Johan
Messages: 39
Registered: July 2009
Member
Thank you very much, it seems as this is the feature I need to use, to create several different diagrams of the same type, over the same UML model file!

However, when I follow your description, this is not really working well.

First of all, it is very un-intuitive after clicking the "Synchronise..." command in the context menu. It took me a long while to realise that I need to right-click on the root item in the dialog box, to change the synchronisation method. Some toolbar buttons would be needed here!

Secondly, even if I disable synchronisation in class diagrams, there isn't a good way to create several different diagrams stored in the same uml model file. If I use the File, New menu, I always need to enter diagram filename and model filename. The dialog box does not allow me to use the filename of an existing model file. Therefore, the File, New menu can't be used to create several (different) diagrams of the same type, to be stored in the same UML model file.

The second approach was to create the first class diagram using the File, New menu. Then I wanted to create a second UML class diagram, so I tried the "New diagram" command in the context menu of the first class diagram. This wizard requires me to "select semantic model element to be depicted on the diagram". The only item to select is the package from the first diagram. When the second diagram is created, it is populated with the package and class from the first diagram. I made sure to disable synchronisation from both the first and second diagrams. Then in the second diagram, I removed the class from the first diagram, that ended up in the second diagram. Then I opened the first diagram, the class was gone also from the first diagram.
So, the "Add diagram" context menu does not work to create new diagrams that are supposed to contain different contents.

The final attempt was to create a first class diagram using the File, New menu, and the second class diagram using the context-menu over the model.uml file (Initialize...). Also this method results in the package from the first diagram to be auto-inserted in the new diagram, but this time I get an option to deselect insertion of other graphical items from the model file. But if I remove the package in the new diagram, that came from the first diagram and was auto-inserted in the new diagram, the package is removed also from the first diagram.

Furthermore, the Synchronise command does not exist in all diagram types. For example, it is impossible to create several state/event diagrams (with different contents), that are stored in the same UML model file, as the "Synchronise..." command does not exist in the diagram context menu.

All-in-all, it still appears UML2Tools does not allow users to create severeal different diagrams of the same type, to be stored in the same UML model file. At least not in a way that is nearly as easy and intuitive as it needs to be.

If anyone have figured out how to create several different diagrams of the same type, to be stored in the same model file, in a reasonably stable and useful way, I'd appreciate very much any suggestions on how to do it!

/Goran
Re: How to add several use-case diagrams to one model file? [message #625142 is a reply to message #624872] Wed, 04 November 2009 14:32 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad Varnica
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
You are certainly talking about the meta modeling approach opposed to Eclipse UML tools using models transformation with GMF+EMF.

The UML meta modeling is a new concept in which all diagram elements are live synchronized with the UML metamodel. Your UML diagrams are a view of your metamodel and not of your model and no need anymore for transformation.
I agree this meta modeling makes life easier :d

Vlad
Re: How to add several use-case diagrams to one model file? [message #625143 is a reply to message #624872] Wed, 04 November 2009 16:20 Go to previous message
Thomas Neustupny is currently offline Thomas Neustupny
Messages: 75
Registered: October 2009
Member
Vlad, I don't understand your answer. The diagram should be a view of a (part of) the model, not of the metamodel? So, if the diagram elements are different objects then the elements in the model (just referring them), then you could have as many diagrams of the same type as you like on top of the same model. And you can even have full synchronization between the model and all diagrams. Does UML2Tools does not follow this approach? (I don't know what is stored in the uml file).

Goran, I fully understand your question, maybe you should try to find out how model and diagrams are handled in UML2Tools. Sorry, I can't help you here. I'm a developer of ArgoUML, where this feature is taken for granted.

Maybe it's one of those issues why Papyrus was made: for some things UML2Tools is more appropriate, some other things are addressed by Papyrus and other UML design tools. Check if you hit the border of UML2Tools. If I understood correctly the intention of UML2Tools, it just allows for UML2 compliant editing of models, so having a model element on different diagrams of the same type is probably not the primary goal here. I might be wrong (can't speak for UML2Tools) and would appreciate to be corrected by UML2Tools experts.
Previous Topic:New to UML2tools & existing Java project
Next Topic:How to add several use-case diagrams to one model file?
Goto Forum:
  


Current Time: Fri Oct 24 18:19:58 GMT 2014

Powered by FUDForum. Page generated in 0.03922 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software