Home » Archived » M2M (model-to-model transformation) » simple UML2UML without results(I am trying to change the UML model name only, but no output!!!)
simple UML2UML without results [message #653135] |
Tue, 08 February 2011 15:59 |
|
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 |
Vincent MAHE 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 |
|
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?
|
|
| | |
Goto Forum:
Current Time: Fri Apr 26 08:46:14 GMT 2024
Powered by FUDForum. Page generated in 0.03159 seconds
|