Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xtend] Model modification of a UML model using a profile
[Xtend] Model modification of a UML model using a profile [message #649047] Mon, 17 January 2011 07:28 Go to next message
Muba  is currently offline Muba
Messages: 20
Registered: November 2009
Junior Member
Hi,
I am trying to modify an uml model with xTend, but find it hard to do so.
A uml to ecore transformation works great, but now need a uml to uml transformation and I cannot really do much.

This is the situation:
I have created a UML Model with Topcased. This UML Model is using a custom UML Profile.

All I managed so far is to add a new uml::Class to my model.
But the resulting model lost all applied stereotypes. Which means I got my new class, but all other classes lost their stereotypes.
But the profile is still referenced in the model.

What would be one problem.

The other Problem is that I cannot do much else. For example I cannot figure out how to add a new attribute to the new class.
Because I cant figure out how to provide a uml::Type instead of an xpand2::Type.
createOwnedAttribute(String, Type, Integer, Integer)


Does Xtend even has the capabitilies I need?
Namely:
- UML modificiation / UML-to-UML transformation
- Keeping the applied stereotypes / applying stereotypes

If not can the other m2m languages do it? ATL for example?

Best regards,
Muba

EDIT: Oh, I was going to post it in the M2M forum and not the M2T one, could an admin move the topic please?.

[Updated on: Mon, 17 January 2011 07:31]

Report message to a moderator

Re: [Xtend] Model modification of a UML model using a profile [message #649130 is a reply to message #649047] Mon, 17 January 2011 14:39 Go to previous messageGo to next message
Muba  is currently offline Muba
Messages: 20
Registered: November 2009
Junior Member
Hi,

ok I managed to modify the uml model. After a lot of trying I will probably figure out how to add certain uml elements.

I also managed to apply a stereotype.. at least in xTend it says a stereotype is applied, but when I write the model out, no stereotypes are applied. So I figure the problem is with the Writer component.

	<component id="write" class="org.eclipse.emf.mwe.utils.Writer">
		<useSingleGlobalResourceSet value="true"/>
		<modelSlot value="model"/>
		<uri value="platform:/resource/${modelDetail}" />
	</component>


Does anyone have a clue, why that part is not written out, which describes which stereotype is applied to which element?

Best regards,
Muba
Re: [Xtend] Model modification of a UML model using a profile [message #649139 is a reply to message #649130] Mon, 17 January 2011 16:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 5846
Registered: July 2009
Senior Member
Hi,

this may help

<workflow>
	
	<bean class="org.eclipse.xtend.typesystem.uml2.Setup" standardUML2Setup="true" />
	
	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".." />
	
	<component class="org.eclipse.xtend.typesystem.emf.XmiReader">
		<modelFile value="src/model/test.uml" />
		<outputSlot value="model" />
	</component>

....

	<component class="org.eclipse.xtend.typesystem.uml2.UML2Writer">
		<outPath value="xxxx" />
		<inputSlot value="model" />
	</component>

</workflow>


~Christian
Re: [Xtend] Model modification of a UML model using a profile [message #649164 is a reply to message #649139] Mon, 17 January 2011 18:23 Go to previous messageGo to next message
Muba  is currently offline Muba
Messages: 20
Registered: November 2009
Junior Member
Hi Christian,

<component class="org.eclipse.xtend.typesystem.uml2.UML2Writer">
    <outPath value="xxxx" />
    <inputSlot value="model" />
</component>


works perfectly.

Thank you.
Re: [Xtend] Model modification of a UML model using a profile [message #649718 is a reply to message #649047] Thu, 20 January 2011 07:24 Go to previous message
Darius Jockel is currently offline Darius Jockel
Messages: 63
Registered: July 2009
Member
You can take a look at the Fornax Hibernate Cartridge:
http://fornax.itemis.de/confluence/display/fornax/Hibernate+ %28CHB%29

There you can find some Model-2-Model Transformations.
Previous Topic:[Acceleo 3] Problems in memory management
Next Topic:[Acceleo] Class inheritance and recursivity
Goto Forum:
  


Current Time: Thu Apr 17 14:24:01 EDT 2014

Powered by FUDForum. Page generated in 0.02624 seconds