Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » simple UML2UML without results(I am trying to change the UML model name only, but no output!!!)
icon5.gif  simple UML2UML without results [message #653135] Tue, 08 February 2011 15:59 Go to next message
Mohamed Mussa is currently offline Mohamed MussaFriend
Messages: 43
Registered: August 2010
Location: Canada
Member
Hi everybody,

I am trying to learn ATL by writing a simple trans. rule to modify the UML model name.
newModelName = 'Hello_'+oldModelName

But, I could not produce the new model I got an empty uml file.

Here is the source file

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xmi:id="_mJ0SkTMXEeC_vp0B4E010A" name="MyModel"/>


The output:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"/>


The ATL code:
--@path UML1=ALT ClassRefine/metamodel/UML.ecore
--@path UML2=ALT ClassRefine/metamodel/UML.ecore

module test1;

create OUT: UML1 from IN : UML2;

rule Model {
    from 
		s : UML2!"uml::Model" 
    to 
		t : UML1!"uml::Model" (
        	__xmiID__ <- s.__xmiID__,
        	name <- 'Hello_' + s.name,
        	visibility <- s.visibility,
        	viewpoint <- s.viewpoint,
        	eAnnotations <- s.eAnnotations,
        	ownedComment <- s.ownedComment,
        	clientDependency <- s.clientDependency,
        	nameExpression <- s.nameExpression,
        	elementImport <- s.elementImport,
        	packageImport <- s.packageImport,
        	ownedRule <- s.ownedRule,
        	templateParameter <- s.templateParameter,
        	templateBinding <- s.templateBinding,
        	ownedTemplateSignature <- s.ownedTemplateSignature,
        	packageMerge <- s.packageMerge,
        	packagedElement <- s.packagedElement,
        	profileApplication <- s.profileApplication
		)
}


Your hints and feedback are much appreciated...

[Updated on: Tue, 08 February 2011 16:36]

Report message to a moderator

Re: simple UML2UML without results [message #653149 is a reply to message #653135] Tue, 08 February 2011 16:32 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Le 08/02/2011 16:59, Mohamed a écrit :
> Hi everybody,
>
> I am trying to learn ATL by writing a simple trans. rule to modify the
> UML model name.
> newModelName = 'Hello_'+oldModelName
>
> But, I could not produce the new model I got a uml file with empty
> elements.
>
> Here is the source file
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Model xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML"
> xmi:id="_mJ0SkTMXEeC_vp0B4E010A" name="MyModel"/>
>
>
> The output:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"/>
>
>
> The ATL code:
> --@path UML=ALT ClassRefine/metamodel/UML.ecore
>
> module test1;
>
> create OUT: UML from IN : UML;
>
> rule Model {
> from s : UML!"uml::Model" to t : UML!"uml::Model" (
> __xmiID__ <- s.__xmiID__,
> name <- 'Hello_' + s.name,
> visibility <- s.visibility,
> viewpoint <- s.viewpoint,
> eAnnotations <- s.eAnnotations,
> ownedComment <- s.ownedComment,
> clientDependency <- s.clientDependency,
> nameExpression <- s.nameExpression,
> elementImport <- s.elementImport,
> packageImport <- s.packageImport,
> ownedRule <- s.ownedRule,
> templateParameter <- s.templateParameter,
> templateBinding <- s.templateBinding,
> ownedTemplateSignature <- s.ownedTemplateSignature,
> packageMerge <- s.packageMerge,
> packagedElement <- s.packagedElement,
> profileApplication <- s.profileApplication
> )
> }
>
>
> Your hints and feedback are much appreciated...
>
>

You may test the refining mode of ATL, in order to get a copy of the
input model with only the changes to write in your transformation.

--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: simple UML2UML without results [message #653169 is a reply to message #653149] Tue, 08 February 2011 18:09 Go to previous messageGo to next message
Mohamed Mussa is currently offline Mohamed MussaFriend
Messages: 43
Registered: August 2010
Location: Canada
Member
Thanks for your input.

I have revised my rule as:

--@path UML=ALT ClassRefine/metamodel/UML.ecore

module test1;

create OUT: UML refining IN : UML;

rule Model {
    from 
		s : UML!Model 
    to 
		t : UML!Model (
        	name <- 'Hello_' + s.name
		)
}


But, I got the excat copy of the source modle without my changes!!! it looks as copy-and-paste

Where I went wrong, any suggestions?
Re: simple UML2UML without results [message #653562 is a reply to message #653169] Thu, 10 February 2011 09:28 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020309010406080808000105
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Le 08/02/2011 19:09, Mohamed a écrit :
> Thanks for your input.
>
> I have revised my rule as:
>
>
> --@path UML=ALT ClassRefine/metamodel/UML.ecore
>
> module test1;
>
> create OUT: UML refining IN : UML;
>
> rule Model {
> from s : UML!Model to t : UML!Model (
> name <- 'Hello_' + s.name
> )
> }
>
>
> But, I got the excat copy of the source modle without my changes!!! it
> looks as copy-and-paste
>
> Where I went wrong, any suggestions?
>

It works for me. I do not see where you are wrong. I joined a zip of my
test, with the launch config, for you information.
--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00

--------------020309010406080808000105
Content-Type: application/x-gzip;
name="_tests.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="_tests.tar.gz"

H4sIAGSvU00AA+1c63faOBbv1+avcNkPzZw5Ab+BlHQ2SekObQhpIN3HF45j BPHW2KwfSTN7
9n/fKz9kY0vCBBJmpujMNCDdeyXfl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LxMQepdxz7uDAw+z5n54KPz34DX+0TGknuQnmzHpm+jzwevAhZH0F5f5IeEQ pzec0F53joS3
6W8B3wo/C4mgOh4Eop8O/rdrPf9eG/O9oVucY0X8R8Gexr+M+yVN0/fx/yKN //7H7N1v0Usg
wS2O49D7PreOCRNkhhr02I5/DP0ntSSL+OYdmht1dz6Lkgh+vXbjH/1eI0cO Agk5NekodTF5
/Ww0JYZq4/D7zVn/w0juovNb7fPpqXrVQ/dfUmiTpoH4bSDvDwQB6g7zmzFD k+QHvpGkuO7A
FxS9xyQn/uGbOGeLj171trZM/V8XJlvmWbRMEDpDDv6xvvVbXGQR9vZnT59R 2BN69qLjtTYK
i8X4jZhyj+J+6MZ63/Q251iF/5q6nuZ/Hf7D+V+VxH3+f4lW9f2/f4TUv0/5 +5S/b/u2b/u2
b/u2b/u2b/z2f1DffdsAeAAA
--------------020309010406080808000105--
Re: simple UML2UML without results [message #653634 is a reply to message #653562] Thu, 10 February 2011 13:43 Go to previous message
Mohamed Mussa is currently offline Mohamed MussaFriend
Messages: 43
Registered: August 2010
Location: Canada
Member
Hi Vincent,

Thanks a lot for the zipped file.

I solved my problem. It was in the test configuration.

I referenced the UML metamodel field with
"ALT ClassRefine/metamodel/UML.ecore"

When I changed it to
"uri:http://www.eclipse.org/uml2/2.1.0/UML"

it worked perfectly.

My best regards,



Previous Topic:[ATL] HOT Transformation and TCS
Next Topic:[ATL] Formal method
Goto Forum:
  


Current Time: Wed Jun 26 07:46:30 GMT 2019

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

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

Back to the top