Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » wiki page: How to get a EMF Ecore model into a Papyrus class diagram (How to get a EMF Ecore model into a Papyrus class diagram click and drag of an update not working)
wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694350] Mon, 04 May 2015 15:52 Go to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
Cross posted on the EMF forum here.

I have started to create the below wiki page but have reached a problem. I can not click and drag a new class attribute from the ecore diagram to the Papyrus Model explorer or the model.di diagram. The wiki page has more background on what is being done. Please take a look at the wiki page to get context to the question.

http://wiki.eclipse.org/How_to_get_a_EMF_Ecore_model_into_a_Papyrus_class_diagram


Oxygen 3a
Windows 10
Re: wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694408 is a reply to message #1694350] Tue, 05 May 2015 07:50 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Paul,

I'm not sure to understand what you are trying to do. First, dropping objects from an external editor to Papyrus seems to be only accidentally supported. Objects are loaded in different contexts (resource sets), and I don't think that Papyrus reloads them into its own resource set, so you may end up with cross-resourceSet references (Meaning that some objects may not be saved since we only save Papyrus' resource set).

Dropping non-UML objects (Ecore objects) will probably not work at all (Or, once again, accidentally, through a generic mechanism, but I can't think of any such mechanism in Papyrus)

Camille


Camille Letavernier
Re: wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694445 is a reply to message #1694408] Tue, 05 May 2015 11:39 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Today, dropping Ecore objects into a UML tool is rather like talking
French to somone who understands only Russian.

However it might not really be that stupid.

The Pivot model for OCL normalises external metamodels so that the
differences between Ecore and UML and .... vanish for shared concepts.
One day Papyrus might exploit this so that an Ecore-to-Pivot-to-UML
conversion happens automatically.

Regards

Ed Willink

On 05/05/2015 08:50, Camille Letavernier wrote:
> Hi Paul,
>
> I'm not sure to understand what you are trying to do. First, dropping
> objects from an external editor to Papyrus seems to be only
> accidentally supported. Objects are loaded in different contexts
> (resource sets), and I don't think that Papyrus reloads them into its
> own resource set, so you may end up with cross-resourceSet references
> (Meaning that some objects may not be saved since we only save
> Papyrus' resource set).
>
> Dropping non-UML objects (Ecore objects) will probably not work at all
> (Or, once again, accidentally, through a generic mechanism, but I
> can't think of any such mechanism in Papyrus)
>
> Camille
Re: wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694520 is a reply to message #1694445] Tue, 05 May 2015 22:24 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
What I want to be able to do is start with a EMF model to design a large set of Eclipse plug-ins to make a Eclipsed Rich Client Platform piece of software. EMF has imbedded knowledge of the eclipse framework. EMF does not do full UML modeling. So I was hoping to have a development cycle like the following.

1. Build the EMF Model
2. Build the EMF genmodel
3. Import the genmodel in Papyrus.
4. Use the EMF classes as a base for 12 different Papyrus Diagrams. (Use Case, Package, Sequence, etc...)
5. Discover new artifacts needed (methods, classes, attributes, etc...) as the result of work in Papyrus.
6. Add the new artifacts to the EMF model
7. Build the EMF genmodel
8. Import the new genmodel in Papyrus without loosing work already done.
9. Repeat step 6 - 8 as needed

I got the impression from this forum thread (https://www.eclipse.org/forums/index.php/m/1633763/#msg_1633763) and this one (https://www.eclipse.org/forums/index.php/m/1030124/?srch=java#msg_1030124) that it was possible. (Now that I read the thread again it seems I should have understood "seed" to mean only one time and not re-imported with changes.) So since there was no page on the wiki describing the steps in detail I though I would do the "Open Source" thing and create the wiki page for the benefit of others.

While the wiki page does change to the Papyrus first, it was not the original intent. I was just playing around to trying to give a reader a sense of what could and could not be done.

From Camille's response: I not sure if what I am trying to do is a "contexts (resource sets)" load.





Oxygen 3a
Windows 10

[Updated on: Tue, 05 May 2015 23:25]

Report message to a moderator

Re: wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694545 is a reply to message #1694520] Wed, 06 May 2015 07:58 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi Paul,

The simplest way to use both UML and Ecore at the same time is to produce a UML Class Diagram (Or import it from an existing Ecore model), then forget Ecore entirely.

UML extends the EMF Genmodel to be able to generate both the Ecore and the Java Code from a UML ClassDiagram directly (With the added features of UML regarding Associations and Subsets). So when you create a Genmodel, select "uml" instead of "ecore" and you're good to go: no need for round-trip, since the UML Genmodel is a superset of Ecore Genmodel

If you need some kind of roundtrip, then the incremental generation of UML from Ecore would need to be implemented (Or you'd need to implement a specific Drag & Drop strategy in Papyrus to import specific Ecore concepts one by one in Papyrus, by translating them to UML during the drop, but that would be tedious for the user)

Cross resource-set issues are just a separate, low level technical detail which is not especially relevant here. I just wanted to highlight that Drag & Drop from external editors to Papyrus may seem to work but will most likely introduce unexpected side effects at some point

HTH,
Camille


Camille Letavernier
Re: wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694657 is a reply to message #1694545] Thu, 07 May 2015 00:29 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
While trying to implement your suggestion I found out the I could add ECore stuff to a brand new Papyrus model using UML Profiles. See the sequence below. Is this method is supported?

Steps01-09_lowRes.jpg

The one finding that causes me to think the method may not be supported it that a double asterisks is needed to see the Ecore repository. So the double asterisks is either a bug that allows the Ecore profile to be seen when it should not be visible. Or the need for a double asterisks is bug that needs fixed.




Oxygen 3a
Windows 10
Re: wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694724 is a reply to message #1694657] Thu, 07 May 2015 11:58 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi,

Yes, this is the profile that the Eclipse UML2 project's EMF-based code
generation (which Camille referenced in an earlier reply) uses to
extend UML class models for Ecore-specific semantics. So, fully
supported.

I would agree that the requirement of two asterisks is a bug, but I
think it is the way that the filter/selection dialog provided by
Eclipse platform is intended to work (which might simply mean that
Papyrus should not use it). At the very least, when the list of
available profiles is so small (which would be expected in most
installations), they should just be shown so that the user isn't made
to wonder whether there are any profiles available at all. Would you
mind raising a bug?

Also a bug is the "Eclipe.org" provider name for the Ecore profile.

HTH,

Christian


On 2015-05-07 00:29:08 +0000, Paul Roubekas said:

> While trying to implement your suggestion I found out the I could add
> ECore stuff to a brand new Papyrus model using UML Profiles. See the
> sequence below. Is this method is supported?
>
>
>
> The one finding that causes me to think the method may not be supported
> it that a double asterisks is needed to see the Ecore repository. So
> the double asterisks is either a bug that allows the Ecore profile to
> be seen when it should not be visible. Or the need for a double
> asterisks is bug that needs fixed.
>
>
>
> <image>
Re: wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694751 is a reply to message #1694724] Thu, 07 May 2015 14:33 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
Three bug/feature requests have been added.

Bug 466740
In order to see the list of available UML Profiles for a package in a class uml model double asterisks must be entered. Only one asterisk should be needed. See screen capture sequence attached to this bug report.


Bug 466741
The list of available profiles is always going to be small. Add a feature to populate the list on first render and not wait for the user to enter an asterisk.


Bug 466742
The "provider name" is wrong for the eclipse UML profile. See attached screen captures.

Thanks everyone for the help. I will be updating the wiki page to reflect what I have learned.


Oxygen 3a
Windows 10
Re: wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694875 is a reply to message #1694751] Fri, 08 May 2015 15:49 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
I am trying to understand the all trade offs between starting in EMF ecore compared to just starting in Papyrus with the ecore UML profile. I started this analysis because I noticed that while I can just start in Papyrus, the profiles editor in the properties window of a class diagram allows for any string when changing a value in the applied stereotype. (See attached screen capture) I can see how this could create all kinds of issues for me being a newbie.

index.php/fa/21751/0/

Earlier in this thread it was said that a click and drag of a package from EMF ecore editor to the Papyrus editor worked by accident, not by design. I have done some playing around and can not find out how to as Camille put it
"The simplest way to use both UML and Ecore at the same time is to produce a UML Class Diagram (Or import it from an existing Ecore model), then forget Ecore entirely." from EMF core into Papyrus in the supported way.


How does one "import" ecore into Papyrus using the supported method?
  • Attachment: Snap1.png
    (Size: 57.80KB, Downloaded 1435 times)


Oxygen 3a
Windows 10

[Updated on: Fri, 08 May 2015 15:52]

Report message to a moderator

Re: wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694902 is a reply to message #1694875] Fri, 08 May 2015 21:38 Go to previous messageGo to next message
Paul Roubekas is currently offline Paul RoubekasFriend
Messages: 207
Registered: March 2012
Location: Chattanooga, TN USA
Senior Member
After more playing around I figured it out. I added the following section to the wiki for the benefit of others.
https://wiki.eclipse.org/Papyrus_User_Guide#Create_a_Papyrus_Package_diagram_from_a_EMF_ECore_UML_model


Oxygen 3a
Windows 10
Re: wiki page: How to get a EMF Ecore model into a Papyrus class diagram [message #1694981 is a reply to message #1694902] Mon, 11 May 2015 08:03 Go to previous message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
Hi,

Quote:
How does one "import" ecore into Papyrus using the supported method?


You need to do it in two steps:

1) Ecore to UML, using the Sample Ecore Model Editor
2) Right click on the *.uml file, File > New > Papyrus model

Step 2) will create a Papyrus model from the selected UML Model (Which is better than importing it in a separate model)

Regards,
Camille


Camille Letavernier
Previous Topic:Informations about Moka / Papyrus
Next Topic:Create own kind of diagrams
Goto Forum:
  


Current Time: Thu Mar 28 10:34:58 GMT 2024

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

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

Back to the top