Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to create diagram from existing .uml file?
How to create diagram from existing .uml file? [message #1711145] Tue, 13 October 2015 12:54 Go to next message
Jens Bürger is currently offline Jens BürgerFriend
Messages: 53
Registered: October 2012
Member
Hello everyone,

as a folowup to this (old) thread, I want to know how: How to create a Papyrus UML diagram initialized with the contents of a given .uml model file?

I'm using Eclipse Mars .1 / Papyrus 1.1.2. The Papyrus User guide describes a context menu entry "initialize Papyrus Diagram" which I was not able to get.
According to the forum thread quoted above, one can create a new Papyrus model by right-clicking the UML model, create a new diagram and then manually drag the desired model elements to the diagram.
But in the case of a state machine diagram, I was not able to this quickly.
I first have to add every state / sub-state one by one. After that, I can drag & drop transitions. So, in case of repeatedly nested states, this gets really time-consuming and annoying.

So, how can I initalize the diagram from the existing model quickly?
Re: How to create diagram from existing .uml file? [message #1711214 is a reply to message #1711145] Wed, 14 October 2015 07:39 Go to previous messageGo to next message
Eclipse UserFriend
Dear Jens,
Right-click the UML file and select New, then create a new Papyrus
Model. Then select UML (or whatever type of model it is) in the wizard.
Lastly, click on Finish.

Greetings,

Víctor

El 13/10/2015 a las 14:54, Jens Bürger escribió:
> Hello everyone,
>
> as a folowup to https://www.eclipse.org/forums/index.php/t/308906/ (old)
> thread, I want to know how: How to create a Papyrus UML diagram
> initialized with the contents of a given .uml model file?
>
> I'm using Eclipse Mars .1 / Papyrus 1.1.2. The
> http://wiki.eclipse.org/Papyrus_User_Guide describes a context menu
> entry "initialize Papyrus Diagram" which I was not able to get.
> According to the forum thread quoted above, one can create a new Papyrus
> model by right-clicking the UML model, create a new diagram and then
> manually drag the desired model elements to the diagram.
> But in the case of a state machine diagram, I was not able to this quickly.
> I first have to add every state / sub-state one by one. After that, I
> can drag & drop transitions. So, in case of repeatedly nested states,
> this gets really time-consuming and annoying.
>
> So, how can I initalize the diagram from the existing model quickly?
Re: How to create diagram from existing .uml file? [message #1711222 is a reply to message #1711214] Wed, 14 October 2015 08:01 Go to previous messageGo to next message
Jens Bürger is currently offline Jens BürgerFriend
Messages: 53
Registered: October 2012
Member
Hello Victor,

when I do this, after clicking finish I'm asked:
"Do you want to make these referenced library model files writable?" (referring to the .uml file).
I click OK.
After that, the .di and .notation files are created and the diagram is opened. I see nothing but a blank window. There is no diagram created as referring to the model explorer. The .notation file is like this:
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>

[Updated on: Wed, 14 October 2015 08:18]

Report message to a moderator

Re: How to create diagram from existing .uml file? [message #1711244 is a reply to message #1711222] Wed, 14 October 2015 09:27 Go to previous messageGo to next message
Eclipse UserFriend
Dear Jens,
An .uml file has no information regarding any diagram, all you have is
the model (packages, classes, attributes, ...), but no diagram.
By doing what I told you before, the required files to work with the uml
model in Papyrus are initialized. However, you will have to create the
diagrams from scratch, by first creating the diagrams (right click on
the model in the package you want to create the diagram and select the
right option) and the dragging and dropping the elements in your uml
model. To do so, make sure "Model Explorer" view is visible.

Best,

Víctor

El 14/10/2015 a las 10:01, Jens Bürger escribió:
> Hello Victor,
>
> when I do this, after clicking finish I'm asked:
> "Do you want to make these referenced library model files writable?"
> (referring to the .uml file).
> I click OK.
> After that, the .di and .notation files are created and the diagram is
> opened. I see nothing but a blank window. There is no diagram created
> and the content of the .di file is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
>
> So, no diagram is created when I follow your steps.
Re: How to create diagram from existing .uml file? [message #1711251 is a reply to message #1711244] Wed, 14 October 2015 10:22 Go to previous messageGo to next message
Jens Bürger is currently offline Jens BürgerFriend
Messages: 53
Registered: October 2012
Member
Eclipse User wrote on Wed, 14 October 2015 05:27
Dear Jens,
An .uml file has no information regarding any diagram, all you have is
the model (packages, classes, attributes, ...), but no diagram.

Thanks, the difference between model and diagram is clear to me. Sorry if my last post was misguiding.
Eclipse User

By doing what I told you before, the required files to work with the uml
model in Papyrus are initialized. However, you will have to create the
diagrams from scratch, by first creating the diagrams (right click on
the model in the package you want to create the diagram and select the
right option) and the dragging and dropping the elements in your uml
model. To do so, make sure "Model Explorer" view is visible.


I am aware of that - as I wrote in my first post. As I described, when dealing with statecharts ("StateMachine Diagram"), this is a time consuming and annoying process, because I cannot add the whole state machine in one step because Papyrus doesn't let me drag and drop transitions when the respective source and target states are not part of the diagram.
So, I first have do d&d all states which are part of a given state, then the respective transitions. After that, I have to repeat this steps if there are states which have substates (and connecting transitions).

To bring it back to my first post, TOPCASED for instance directly supports initalizing a diagram with the contents of a model and I am asking if there is a shortcut to get the model content into the diagram which is independent from the number of elements in the model.

[Updated on: Wed, 14 October 2015 10:24]

Report message to a moderator

Re: How to create diagram from existing .uml file? [message #1711354 is a reply to message #1711251] Thu, 15 October 2015 09:19 Go to previous messageGo to next message
Eclipse UserFriend
Dear Jens,
Sorry if I misunderstood you.
Maybe the problem is that during drag and drop Papyrus should check that
the source and target of any relationship are already in the selection
to allow transitions to be d&d directly. It would be a nice feature to have.
You could write a plugin to do it, but of course it would take hours
diving into the forums and Papyrus sources to understand how to do it.

Best,

Víctor

El 14/10/2015 a las 12:22, Jens Bürger escribió:
> Eclipse User wrote on Wed, 14 October 2015 05:27
>> Dear Jens,
>> An .uml file has no information regarding any diagram, all you have is
>> the model (packages, classes, attributes, ...), but no diagram.
>
> Thanks, the difference between model and diagram is clear to me. Sorry
> if my last post was misguiding.
> Eclipse User
>> By doing what I told you before, the required files to work with the
>> uml model in Papyrus are initialized. However, you will have to create
>> the diagrams from scratch, by first creating the diagrams (right click
>> on the model in the package you want to create the diagram and select
>> the right option) and the dragging and dropping the elements in your
>> uml model. To do so, make sure "Model Explorer" view is visible.
>
>
> I am aware of that - as I wrote in my first post. As I described, when
> dealing with statecharts ("StateMachine Diagram"), this is a time
> consuming and annoying process, because I cannot add the whole state
> machine in one step because Papyrus doesn't let me drag and drop
> transitions when the respective source and target states are not part of
> the diagram.
> So, I first have do d&d all states which are part of a given state, then
> the respective transitions. After that, I have to repeat this steps if
> there are states which have substates (and connecting transitions).
> To bring it back to my first post, TOPCASED for instance directly
> supports initalizing a diagram with the contents of a model.
>
Re: How to create diagram from existing .uml file? [message #1711773 is a reply to message #1711354] Mon, 19 October 2015 14:57 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 926
Registered: February 2011
Senior Member
Hi,

The D&D of Edges + Nodes is supported in most diagrams. So, if it doesn't work for StateMachines, this is definitely a bug in Papyrus

You can automatically populate a Diagram by synchronizing it (Select the diagram > Appearance > Sync with Model). Each node needs to be synchronized as well if you want to display all elements recursively. This can be achieved using a *.css file with the following rule:

StateMachineDiagram,
StateMachineDiagram * {
     canonical: true;
}


Then Drag & Drop this *.css file into your diagram to apply it. Note that the same principle also works for other diagrams

HTH,
Camille


Camille Letavernier

[Updated on: Mon, 19 October 2015 14:58]

Report message to a moderator

Re: How to create diagram from existing .uml file? [message #1714867 is a reply to message #1711773] Tue, 17 November 2015 11:39 Go to previous message
Jens Bürger is currently offline Jens BürgerFriend
Messages: 53
Registered: October 2012
Member
Thanks for this hint, Camille, it indeed helps!

As I wrote before, D&D works in principle but is problematic if the state machine has elements that depend on each other (for example nested states or even ordinary transitions), you cannot D&D all model elements in one step.
Previous Topic:Importing XML model
Next Topic:Association behaviour in reaction to graphical Drag and Drop
Goto Forum:
  


Current Time: Fri Jul 10 13:55:58 GMT 2020

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

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

Back to the top