Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » From UML to MOF with Papyrus
From UML to MOF with Papyrus [message #1784746] Tue, 03 April 2018 13:56 Go to next message
WINNER WINNER is currently offline WINNER WINNERFriend
Messages: 22
Registered: March 2018
Junior Member
Hello,

I would appreciate if you could answer me :
I want to generate the MOF meta model from UML diagrams with Papyrus, like the following tutorial : https://www.eclipse.org/atl/usecases/UML2MOF/userGuide.php.

But i can't found Papyrus transformation on run configuration.

Best Regards.
Re: From UML to MOF with Papyrus [message #1784749 is a reply to message #1784746] Tue, 03 April 2018 14:10 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 885
Registered: February 2011
Senior Member
Hi,

This tutorial being 11 years old, I'm afraid it's no longer compatible with the current Papyrus version. However, the UML2MOF transformation might still work properly on the *.uml file that is part of the current Papyrus model (Maybe using ATL Transformation rather than Papyrus Transformation?)

Otherwise, the UML SDK already provides a UML To Ecore transformation (After opening a *.uml file In the UML Model Editor: UML Editor > Convert to...)

HTH,
Camille


Camille Letavernier
Re: From UML to MOF with Papyrus [message #1784757 is a reply to message #1784749] Tue, 03 April 2018 16:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
Hi

Once upon a time the UML metamodel was defined using MOF whose metamodel was defined using MOF. There was also CMOF and EMOF to add to the complication.

UML is now modelled using UML so whatever your requirement for MOF was perhaps needs revisiting.

Regards

Ed Willink
Re: From UML to MOF with Papyrus [message #1784772 is a reply to message #1784757] Tue, 03 April 2018 20:20 Go to previous messageGo to next message
WINNER WINNER is currently offline WINNER WINNERFriend
Messages: 22
Registered: March 2018
Junior Member
Then, i cannot define an ATL transformation to the UML diagrams defined with Papyrus ?
Re: From UML to MOF with Papyrus [message #1784783 is a reply to message #1784772] Wed, 04 April 2018 07:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
(Please ignore this comment; I was thinking of the Acceleo M2T rather than the ATL M2M)

Hi

Papyrus' UML diagrams use an XMI notation that is very well supported by Ecore models. It is technically possible to use an M2T to generate XMI, but no one who understands modeling tools would do so. Use an M2M language.

Regards

Ed Willink

[Updated on: Wed, 04 April 2018 08:41]

Report message to a moderator

Re: From UML to MOF with Papyrus [message #1784785 is a reply to message #1784783] Wed, 04 April 2018 07:45 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 885
Registered: February 2011
Senior Member
Hi,

Well, ATL *is* an M2M Language :)

Using ATL to transform from/to Papyrus models will certainly work (Although for actual Diagrams, notation is quite low-level and may be difficult to manipulate properly, to say the least).

Cheers,
Camille


Camille Letavernier
Re: From UML to MOF with Papyrus [message #1784790 is a reply to message #1784785] Wed, 04 April 2018 07:57 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
Hi

Sorry. Yes my M2T comments are an irrelevance; confused by answering questions about Acceleo (both start with "A"). You most certainly can use ATL to generate Papyrus diagrams.

When you wrote MOF, I suspect that you want to generate UML models, and so to use *.uml and Eclipse UML2 support.

Papyrus diagrams do not yet comply with the UMLDI standard, although UMLDI is influenced by the underlying GMF Notation models. But either way the diagrams are XMI so you could generate them with ATL or some other M2M tool. However Papyrus has auto-drawing, so for a few models you will find it much easier to use these facilities manually.

Regards

Ed Willink
Re: From UML to MOF with Papyrus [message #1784810 is a reply to message #1784790] Wed, 04 April 2018 10:31 Go to previous messageGo to next message
WINNER WINNER is currently offline WINNER WINNERFriend
Messages: 22
Registered: March 2018
Junior Member
Hi,

What i want to say by my question is : to define a M2M ATL transformation we need to define as a first step the ecore meta-models for the source and the target models, then we instanciate the source meta-model( in my case it should be an ecore meta-model for class diagrams) , and define an atl rules to trasform the instanciated class diagram to the traget model that i want.

I know very well that we can get the xmi representation of my class diagram, but my question is : as i have already designed the source class diagram model with papyrus, is there a possibipility to generate the ecore meta-model for class diagram in order to consider them finally as my source model and meta-model for my ATL tranformation.

Many thanks.
Re: From UML to MOF with Papyrus [message #1784812 is a reply to message #1784810] Wed, 04 April 2018 11:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
Hi

I don't really understand what you are trying to do.

Perhaps you just want to use the UML2Ecore conversion from the Eclipse UML2 project. It is available programmatically and interactively. Open a *.uml file with the UML model editor, select the Model element, then from the UML Editor tool bar menu, Convert To->Ecore Model. There is probably a way to do this in Papyrus but I can't see it.

If that is not what you want please be clearer about what you have and what you want before jumping with your assumptions about what you have to do.

Regards

Ed Willink
Re: From UML to MOF with Papyrus [message #1784818 is a reply to message #1784812] Wed, 04 April 2018 12:30 Go to previous messageGo to next message
WINNER WINNER is currently offline WINNER WINNERFriend
Messages: 22
Registered: March 2018
Junior Member
Hi,

Willink truly thank you for your answer,

To be more clear, i want to define an ATL transformation for an uml diagram defined with papyrus , and i cannot do that without defininig the MOF meta-model of these diagrams, how can i obtain it ?

Best Ragards.

Mohammed TEBIB
Re: From UML to MOF with Papyrus [message #1784821 is a reply to message #1784818] Wed, 04 April 2018 13:07 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
Hi

What do you mean by a diagram.

The *.uml is the model information complying with UML.ecore.

The *.di is the diagram layout complying, I think, with Notation,ecore.

It is very unlikely that you want to transform the diagrams, just the model, and the model needs no transformation.

If you are still not clear please provide your source and an example of your target so that we can understand what you are trying to re-invent.

Regards

Ed Willink
Re: From UML to MOF with Papyrus [message #1784822 is a reply to message #1784821] Wed, 04 April 2018 13:15 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
Hi

MOF seems to be at the heart of your problem. Why do you think you want to use MOF? You referred to https://www.eclipse.org/atl/usecases/UML2MOF/userGuide.php which shows how to transform UML to MOF. It does not say that that is what you always do with UML. Indeed if you read the example you will see that it uses *.ecore.

Regards

Ed Willink
Re: From UML to MOF with Papyrus [message #1784824 is a reply to message #1784785] Wed, 04 April 2018 13:20 Go to previous messageGo to next message
Carsten Pitz is currently offline Carsten PitzFriend
Messages: 137
Registered: May 2015
Location: Germany
Senior Member
Hi Camille,
Hi Ed,

I really dislike the terms M2T and M2M simply because these term are purely technical terms and as such do not cover semantics.

An example: When I use a MOFM2T processor to transform a model into an XML file representing a MOF model with a different structure, this transformation is technically a M2T transformation because the transformation result is a text file.

Semantic wise this transformation transforms a model into another model.

I find that fact somehow confusing ;-)

/Carsten
Re: From UML to MOF with Papyrus [message #1784827 is a reply to message #1784824] Wed, 04 April 2018 13:45 Go to previous messageGo to next message
WINNER WINNER is currently offline WINNER WINNERFriend
Messages: 22
Registered: March 2018
Junior Member
Willink, you see this image :

https://en.wikipedia.org/wiki/ATLAS_Transformation_Language#/media/File:Operational_context_of_ATL.png

What i want to do is exactly that (described in the figure):

1- 'Ma' in my case study is : the uml model that i have defined with papyrus (there is no problem for that).
2- 'MMa' is the meta-model of Ma , it should be represented using MOF (That's my problem, is there the possibility to obtain it directly with Papyrus from the defined model).

I hope that it is clear now

Regards.
Re: From UML to MOF with Papyrus [message #1784844 is a reply to message #1784827] Wed, 04 April 2018 18:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
Hi Carsten

M2M is typically XMI to XMI both of which conform to metamodels, so the effort to validate/use the result in a program is small.

M2T is typically XMI to text, which doesn't often conform to an available grammar, therefore validation/use of the result in a program may be very difficult.

Different terms for these two approaches seems very appropriate. That said, Toni Siljamäki has convinced me that the addition of some richer (Xtend-like string template operations) to OCL would allow the QVT languages to be used for M2T, but I would still use the distinct term when the output modeltype has been set to text rather than model.

Regards

Ed Willink
Re: From UML to MOF with Papyrus [message #1784845 is a reply to message #1784844] Wed, 04 April 2018 18:15 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
Hi Mohammed

You are taking Jean Bezevin's academic presentation much too literally. Replace "MOF" by "Ecore" and you have what is available with practical EMF tooling rather than abstract OMG specifications.

IIRC the ATL developers endeavoured to maintain a degree of metamodel representation neutrality, but since Ecore has become so dominant in the community, the flexibility has made ATL less useable than it could have been. I suspect that the new EMFTVM engine throws away the non-Ecore capabilities.

Regards

Ed Willink
Re: From UML to MOF with Papyrus [message #1784847 is a reply to message #1784845] Wed, 04 April 2018 18:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
Hi

If you really want to use MOF, the Ecore tooling supports loading and saving from *.emof files which is the minimal Essential MOF subset necessary for metamodelling. I can't recommend it, since the EMOF capability was originally added as a demonstration of Ecore/EMOF compatibility. (Before my time but I understand that there were heated discussions as MOF/CMOF/EMOF were formulated.) I have occasionally used EMOF to load/save OMG models, particularly for OCL and QVT. I have identified a number of conversion bugs, most of which have been fixed. But since it is a zero-user facility, maintenance does not attract much enthusiasm. The many improvements to Ecore, such as generics, delegates, .... have not appeared in EMOF.

Regards

Ed Willink
Re: From UML to MOF with Papyrus [message #1784853 is a reply to message #1784847] Wed, 04 April 2018 20:20 Go to previous messageGo to next message
WINNER WINNER is currently offline WINNER WINNERFriend
Messages: 22
Registered: March 2018
Junior Member
Hi Willink,

https://drive.google.com/file/d/1ogXQXezh738h_YHHJpQws8h95XkYdifg/view?usp=sharing

Hope it is clear like that, my problem is how to obtain the Ecore meta-model.

Regards

[Updated on: Wed, 04 April 2018 22:39]

Report message to a moderator

Re: From UML to MOF with Papyrus [message #1784877 is a reply to message #1784853] Thu, 05 April 2018 05:49 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6044
Registered: July 2009
Senior Member
Hi

The UMNL (amd consequently Statechart metamodel) is part of the Eclipse UML2 distribution: /org.eclipse.uml2.uml/model/UML.ecore. It is normally accessed by its nsURI http://www.eclipse.org/uml2/5.0.0/UML as you can see if you look at the preamble of the MyStatechartModel.uml that Papyrus maintains.

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="20131001"
xmlns:xmi="http://www.omg.org/spec/XMI/20131001"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML"

I have no idea what MyStatechartModel.xmi is. You could save a lot of time by providing a repro so that we can see past your typos and misunderstandings.

Regards

Ed Willink
Previous Topic:Command in EditHelperAdvice
Next Topic:Integration
Goto Forum:
  


Current Time: Tue Sep 25 06:44:34 GMT 2018

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

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

Back to the top