Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » how to use two target sources?
how to use two target sources? [message #1060613] Mon, 27 May 2013 06:24 Go to next message
Emre T is currently offline Emre T
Messages: 119
Registered: April 2013
Senior Member
Hello there!

I have a transformation where I use my own meta-model as a source. And as for the target models, I need to use two meta-models which are -indirectly- related together.

How could I achieve this? Any help will be appreciated.

Thanks.
Re: how to use two target sources? [message #1060671 is a reply to message #1060613] Mon, 27 May 2013 12:06 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey Boyko
Messages: 162
Registered: July 2009
Senior Member
Hi Emre,

Actually you do not need to do anything special in order to achieve that. Just create objects from desired metamodels. For example:

modeltype UML uses "http://www.eclipse.org/uml2/4.0.0/UML";
modeltype Ecore uses "http://www.eclipse.org/emf/2002/Ecore";

transformation NewTransformation(in src : UML, out dst : UML);

main() {
	object EClass {
		name := "ECore class"
	};
	object Class {
		name := "UML class"
	}
}


Type of transformation parameters' 'dst' (which is 'UML') is used as a hint on file extension to be used for output file. For the transformation above output file 'NewTransformation.uml' has the following content:

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML">
  <ecore:EClass xmi:id="_5XiVUMbtEeKBSPmarAtVhQ" name="ECore class"/>
  <uml:Class xmi:id="_5XiVUcbtEeKBSPmarAtVhQ" name="UML class"/>
</xmi:XMI>


Regards,
Sergey
Re: how to use two target sources? [message #1061278 is a reply to message #1060671] Thu, 30 May 2013 18:49 Go to previous message
Emre T is currently offline Emre T
Messages: 119
Registered: April 2013
Senior Member
Thanks a lot for the clear answer!
Previous Topic:Stereotypes and multi-valued attributes
Next Topic:A case scenario regarding the selection of mappings based on composed model elements
Goto Forum:
  


Current Time: Wed Aug 27 19:24:54 EDT 2014

Powered by FUDForum. Page generated in 0.01971 seconds