Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » HOWTO setup a mapping (uml2 profile)
HOWTO setup a mapping (uml2 profile) [message #521326] Wed, 17 March 2010 09:56 Go to next message
Tilo Thiele is currently offline Tilo ThieleFriend
Messages: 14
Registered: March 2010
Junior Member
Till now I use oaw4 (classic) with uml (MD10.0) to generate my artifacts from my model.
Stereotyped elements are mapped to class instances provided by my metamodel and this
is controlled by my mapping file.

Now I try to accomplish this with the ecore/uml facilities provied by oaw5/eclipse 3.5.
After setting up a project and got it running with my profile I got stuck with
creating appropriate own meta model classes and the mapping.

How can this be done?

Here is my new mwe file:
<?xml version="1.0" encoding="UTF-8"?>
<workflow>
	<property name="model" value="AppGeneratorModel/src/metamodel/ReferenzModel.uml" />
	<property name="src-gen" value="src-gen" />
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
		<platformUri value=".."/>
	</bean>
    <bean class="org.eclipse.xtend.typesystem.uml2.Setup" standardUML2Setup="true" />
	<bean id="mm_profile" class="org.eclipse.xtend.typesystem.uml2.profile.ProfileMetaModel">
		<profile value="src/metamodel/EmsApplicationProfile.profile.uml"/>
	</bean>
	<component class="org.eclipse.emf.mwe.utils.Reader">
		<uri value="platform:/resource/${model}" />
		<modelSlot value="model" />
	</component>
	<component class="org.eclipse.xpand2.Generator">
       <fileEncoding value="UTF-8" />
		<metaModel idRef="mm_profile"/>
		<expand	value="template::IndentatedModelSurferRoot::Root FOR model" />
		<outlet path="${src-gen}" >
			<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
		</outlet>
	</component>
	
</workflow>
Re: HOWTO setup a mapping (uml2 profile) [message #521329 is a reply to message #521326] Wed, 17 March 2010 10:08 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Hi Tilo,

you would have to write a model-2-model transformation, e.g. with Xtend, to map the EMF UML2 metamodel to a private one. Using the oAW classic based classes is no good idea, better would be an EMF metamodel. Logic should be done in extension functions.

Kind regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: HOWTO setup a mapping (uml2 profile) [message #521337 is a reply to message #521326] Wed, 17 March 2010 10:29 Go to previous message
Tilo Thiele is currently offline Tilo ThieleFriend
Messages: 14
Registered: March 2010
Junior Member
Karsten,

thanks for your reply.
Sounds fairly reasonable. Can you give me a pointer to where I find samples/tutorials/docs concerning this subject. The online docs don't give sufficent answers.



  • How can I recognize stereotyed elements?
  • How can I read the tagged values?
  • How do I create the corresponding target model?


thanks in advance
/Tilo


... always looking for the bleeding edge...
Previous Topic:Unknown ocl::uml::Constraint propery, variable, type or enumeration literal 'specification'
Next Topic:Acceleo graduation and version jumping
Goto Forum:
  


Current Time: Mon Nov 11 14:39:07 GMT 2024

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

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

Back to the top