Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Different versions - same metamodel(Transformation between different versions of the same metamodel)
Different versions - same metamodel [message #899111] Mon, 30 July 2012 15:13 Go to next message
Wolfgang Roessler is currently offline Wolfgang RoesslerFriend
Messages: 5
Registered: July 2009
Junior Member
Hello,

I want to create a transformation which will do "downgrade" of uml-models (only a very small subset to be exact). I have UML2-models with version 3.0.0 and want to transform them to UML2-modles with version 2.1.0.

Currently my script looks like this:

modeltype UML23 uses 'http://www.eclipse.org/uml2/3.0.0/UML';
modeltype UML21 uses 'http://www.eclipse.org/uml2/2.1.0/UML';

transformation Test1(in source : UML23, out target : UML21);

main() {
  source.rootObjects()[UML23::Model]->map Model2Model();
}

mapping UML23::Model::Model2Model() : UML21::Model {
	name := self.name + "_mapped";
}


When I execute the transformation, the target-model is also saved with the version 3.0.0. This probably happens, because the serializer for version 2.1.0 is not available, so the 3.0.0 is used. I then tried to make the modeltypes strict and expected I would get an error that the serializer for 2.1.0 can not be found. But there was no error and the target-model still was version 3.0.0.

What do I have to do, to make this work?

Thanks
Wolfgang
Re: Different versions - same metamodel [message #899134 is a reply to message #899111] Mon, 30 July 2012 15:49 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I think MDT/UML2 always saves in the latest format; try an experiment
with the UML Model editor and see if it will save in the original format.

You might need to ensure that the createResource uses the explicit
content type.

Regards

Ed Willink


On 30/07/2012 16:13, Wolfgang Roessler wrote:
> Hello,
>
> I want to create a transformation which will do "downgrade" of
> uml-models (only a very small subset to be exact). I have UML2-models
> with version 3.0.0 and want to transform them to UML2-modles with
> version 2.1.0.
>
> Currently my script looks like this:
>
>
> modeltype UML23 uses 'http://www.eclipse.org/uml2/3.0.0/UML';
> modeltype UML21 uses 'http://www.eclipse.org/uml2/2.1.0/UML';
>
> transformation Test1(in source : UML23, out target : UML21);
>
> main() {
> source.rootObjects()[UML23::Model]->map Model2Model();
> }
>
> mapping UML23::Model::Model2Model() : UML21::Model {
> name := self.name + "_mapped";
> }
>
>
> When I execute the transformation, the target-model is also saved with
> the version 3.0.0. This probably happens, because the serializer for
> version 2.1.0 is not available, so the 3.0.0 is used. I then tried to
> make the modeltypes strict and expected I would get an error that the
> serializer for 2.1.0 can not be found. But there was no error and the
> target-model still was version 3.0.0.
>
> What do I have to do, to make this work?
>
> Thanks
> Wolfgang
Re: Different versions - same metamodel [message #899203 is a reply to message #899134] Tue, 31 July 2012 04:37 Go to previous messageGo to next message
Wolfgang Roessler is currently offline Wolfgang RoesslerFriend
Messages: 5
Registered: July 2009
Junior Member
Hi,

you are right. In the uml2-plugin only the serializer for the latest version is included. The problem is, that the uml2-plugin also registers the uri for the old versions. My idea would be to include the old and the new plugin. But how can make sure, that the old serializer is used?

Regards
Wolfgang
Re: Different versions - same metamodel [message #899322 is a reply to message #899203] Tue, 31 July 2012 13:18 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
If I recall correctly, you'd need XML Helper and XML Save implementations that serialize based on the "old" format. Note that the resource implementations provided by UML2 are designed to transform things in the "forward" direction, so there could well be other obstacles to overcome...

Kenn
Previous Topic:AST Creation of QVT-O [SOLVED]
Next Topic:Code style / Performance / Best practice question
Goto Forum:
  


Current Time: Thu Apr 25 22:27:19 GMT 2024

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

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

Back to the top