Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] ATL projector
[ATL] ATL projector [message #51316] Sun, 08 July 2007 08:44 Go to next message
Eclipse UserFriend
Originally posted by: basgraaf.tudelft.nl

Hi All,

I am having problems with the ATL injector. As an example consider
ATLCopier.atl from the KM32ATLCopier transformation from the zoo. When I
inject:

module Copy;
create OUT : MM from IN : MM;

rule CopyTest {
from
s : MM!Test
(
s.oclIsTypeOf(MM!Test)
)
to
t : MM!Test (
name <- s.name,
description <- s.description
)
}

and subsequently extract the resulting model, I get:

module Copy;
create OUT : MM from IN : MM;

rule CopyTest {
from
s : MM!Test
(
.oclIsTypeOf(MM!Test)
)
to
t : MM!Test (
name <-.name,
description <-.description
)
}

The variable expressions disappeared in the output pattern (s). It seems
that the problem is that the referredVariable feature of the
variableExpression is not set by the injector (see fragment of injection
result below). When I correct this manually, the extracted ATL code is
as expected.

I am using
http://www.sciences.univ-nantes.fr/lina/atl/www/atldemo/adt_ am3.zip. Has
anybody observed this behaviour before?

Thanks for any help,
Kind regards,

Bas Graaf.

<outPattern location="10:3-14:6">
<elements xsi:type="atl:SimpleOutPatternElement" location="11:5-14:6"
varName="t">
<type xsi:type="ocl:OclModelElement" location="11:9-11:16"
name="Test" model="/1"/>
<bindings location="12:7-12:21" propertyName="name">
<value xsi:type="ocl:NavigationOrAttributeCallExp"
location="12:15-12:21" name="name">
<source xsi:type="ocl:VariableExp" location="12:15-12:16"
name="s"/>
</value>
</bindings>
<bindings location="13:7-13:35" propertyName="description">
<value xsi:type="ocl:NavigationOrAttributeCallExp"
location="13:22-13:35" name="description">
<source xsi:type="ocl:VariableExp" location="13:22-13:23"
name="s"/>
</value>
</bindings>
</elements>
</outPattern>
Re: [ATL] ATL projector [message #51537 is a reply to message #51316] Mon, 09 July 2007 09:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Hugo.Bruneliere.univ-nantes.fr

Bas Graaf a écrit :
> Hi All,
>

Hi Bas,

> I am having problems with the ATL injector. As an example consider
> ATLCopier.atl from the KM32ATLCopier transformation from the zoo. When I
> inject:
>
> module Copy;
> create OUT : MM from IN : MM;
>
> rule CopyTest {
> from
> s : MM!Test
> (
> s.oclIsTypeOf(MM!Test)
> )
> to
> t : MM!Test (
> name <- s.name,
> description <- s.description
> )
> }
>
> and subsequently extract the resulting model, I get:
>
> module Copy;
> create OUT : MM from IN : MM;
>
> rule CopyTest {
> from
> s : MM!Test
> (
> .oclIsTypeOf(MM!Test)
> )
> to
> t : MM!Test (
> name <-.name,
> description <-.description
> )
> }
>
> The variable expressions disappeared in the output pattern (s). It seems
> that the problem is that the referredVariable feature of the
> variableExpression is not set by the injector (see fragment of injection
> result below). When I correct this manually, the extracted ATL code is
> as expected.
>
> I am using
> http://www.sciences.univ-nantes.fr/lina/atl/www/atldemo/adt_ am3.zip. Has
> anybody observed this behaviour before?
>

The version you're using is quite old. You may try to use the latest
version of ATL & AM3 and I think it should work.

See
http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg01185.html
for getting install instructions.

> Thanks for any help,
> Kind regards,
>
> Bas Graaf.
>
> <outPattern location="10:3-14:6">
> <elements xsi:type="atl:SimpleOutPatternElement" location="11:5-14:6"
> varName="t">
> <type xsi:type="ocl:OclModelElement" location="11:9-11:16"
> name="Test" model="/1"/>
> <bindings location="12:7-12:21" propertyName="name">
> <value xsi:type="ocl:NavigationOrAttributeCallExp"
> location="12:15-12:21" name="name">
> <source xsi:type="ocl:VariableExp" location="12:15-12:16"
> name="s"/>
> </value>
> </bindings>
> <bindings location="13:7-13:35" propertyName="description">
> <value xsi:type="ocl:NavigationOrAttributeCallExp"
> location="13:22-13:35" name="description">
> <source xsi:type="ocl:VariableExp" location="13:22-13:23"
> name="s"/>
> </value>
> </bindings>
> </elements>
> </outPattern>

Best regards,

Hugo

--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
Re: [ATL] ATL projector [message #51760 is a reply to message #51537] Tue, 10 July 2007 06:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: basgraaf.tudelft.nl

Hi Hugo,

Now it works. Thanks!

As a follow-up question:

Is it possible to invoke the ATL extractor from an ANT build script?
This is not working:

<am3.saveModel model="ATLModel" path="${targetModels}ATLFile.atl" >
<extractor name="atl"/>
</am3.saveModel>

Kind regards,
Bas.

Hugo Bruneliere wrote:
> Bas Graaf a écrit :
>> Hi All,
>>
>
> Hi Bas,
>
>> I am having problems with the ATL injector. As an example consider
>> ATLCopier.atl from the KM32ATLCopier transformation from the zoo. When
>> I inject:
>>
>> module Copy;
>> create OUT : MM from IN : MM;
>>
>> rule CopyTest {
>> from
>> s : MM!Test
>> (
>> s.oclIsTypeOf(MM!Test)
>> )
>> to
>> t : MM!Test (
>> name <- s.name,
>> description <- s.description
>> )
>> }
>>
>> and subsequently extract the resulting model, I get:
>>
>> module Copy;
>> create OUT : MM from IN : MM;
>>
>> rule CopyTest {
>> from
>> s : MM!Test
>> (
>> .oclIsTypeOf(MM!Test)
>> )
>> to
>> t : MM!Test (
>> name <-.name,
>> description <-.description
>> )
>> }
>>
>> The variable expressions disappeared in the output pattern (s). It
>> seems that the problem is that the referredVariable feature of the
>> variableExpression is not set by the injector (see fragment of
>> injection result below). When I correct this manually, the extracted
>> ATL code is as expected.
>>
>> I am using
>> http://www.sciences.univ-nantes.fr/lina/atl/www/atldemo/adt_ am3.zip.
>> Has anybody observed this behaviour before?
>>
>
> The version you're using is quite old. You may try to use the latest
> version of ATL & AM3 and I think it should work.
>
> See
> http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg01185.html
> for getting install instructions.
>
>> Thanks for any help,
>> Kind regards,
>>
>> Bas Graaf.
>>
>> <outPattern location="10:3-14:6">
>> <elements xsi:type="atl:SimpleOutPatternElement"
>> location="11:5-14:6" varName="t">
>> <type xsi:type="ocl:OclModelElement" location="11:9-11:16"
>> name="Test" model="/1"/>
>> <bindings location="12:7-12:21" propertyName="name">
>> <value xsi:type="ocl:NavigationOrAttributeCallExp"
>> location="12:15-12:21" name="name">
>> <source xsi:type="ocl:VariableExp" location="12:15-12:16"
>> name="s"/>
>> </value>
>> </bindings>
>> <bindings location="13:7-13:35" propertyName="description">
>> <value xsi:type="ocl:NavigationOrAttributeCallExp"
>> location="13:22-13:35" name="description">
>> <source xsi:type="ocl:VariableExp" location="13:22-13:23"
>> name="s"/>
>> </value>
>> </bindings>
>> </elements>
>> </outPattern>
>
> Best regards,
>
> Hugo
>
Re: [ATL] ATL projector [message #51789 is a reply to message #51760] Tue, 10 July 2007 08:39 Go to previous message
Eclipse UserFriend
Originally posted by: Hugo.Bruneliere.univ-nantes.fr

Bas Graaf a écrit :
> Hi Hugo,

Hi Bas,

> Now it works. Thanks!
>
> As a follow-up question:
>
> Is it possible to invoke the ATL extractor from an ANT build script?
> This is not working:
>
> <am3.saveModel model="ATLModel" path="${targetModels}ATLFile.atl" >
> <extractor name="atl"/>
> </am3.saveModel>
>

In order to do that using ANT tasks, you have to proceed in several steps:

1) Load the TCS metamodel (available from the org.eclipse.am3.core
plugin, into "resources/TCS/")

<am3.loadModel modelHandler="EMF" name="TCS" metamodel="MOF"
path="TCS.ecore">

2) Load the TCS model for ATL (also available from the
org.eclipse.am3.core plugin, but into "resources/ATL-0.2/")

<am3.loadModel modelHandler="EMF" name="ATL-TCS" metamodel="TCS"
path="ATL-0.2-TCS.ecore">

3) Finally extract your ATL model into an ATL file using this TCS model:

<am3.saveModel model="ATLModel" path="${targetModels}ATLFile.atl">
<extractor name="ebnf">
<param name="format" value="ATL-TCS"/>
<param name="indentString" value=" "/>
<param name="serializeComments" value="false"/>
</extractor>
</am3.saveModel>

Best regards,

Hugo

> Kind regards,
> Bas.
>
> Hugo Bruneliere wrote:
>> Bas Graaf a écrit :
>>> Hi All,
>>>
>>
>> Hi Bas,
>>
>>> I am having problems with the ATL injector. As an example consider
>>> ATLCopier.atl from the KM32ATLCopier transformation from the zoo.
>>> When I inject:
>>>
>>> module Copy;
>>> create OUT : MM from IN : MM;
>>>
>>> rule CopyTest {
>>> from
>>> s : MM!Test
>>> (
>>> s.oclIsTypeOf(MM!Test)
>>> )
>>> to
>>> t : MM!Test (
>>> name <- s.name,
>>> description <- s.description
>>> )
>>> }
>>>
>>> and subsequently extract the resulting model, I get:
>>>
>>> module Copy;
>>> create OUT : MM from IN : MM;
>>>
>>> rule CopyTest {
>>> from
>>> s : MM!Test
>>> (
>>> .oclIsTypeOf(MM!Test)
>>> )
>>> to
>>> t : MM!Test (
>>> name <-.name,
>>> description <-.description
>>> )
>>> }
>>>
>>> The variable expressions disappeared in the output pattern (s). It
>>> seems that the problem is that the referredVariable feature of the
>>> variableExpression is not set by the injector (see fragment of
>>> injection result below). When I correct this manually, the extracted
>>> ATL code is as expected.
>>>
>>> I am using
>>> http://www.sciences.univ-nantes.fr/lina/atl/www/atldemo/adt_ am3.zip.
>>> Has anybody observed this behaviour before?
>>>
>>
>> The version you're using is quite old. You may try to use the latest
>> version of ATL & AM3 and I think it should work.
>>
>> See
>> http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg01185.html
>> for getting install instructions.
>>
>>> Thanks for any help,
>>> Kind regards,
>>>
>>> Bas Graaf.
>>>
>>> <outPattern location="10:3-14:6">
>>> <elements xsi:type="atl:SimpleOutPatternElement"
>>> location="11:5-14:6" varName="t">
>>> <type xsi:type="ocl:OclModelElement" location="11:9-11:16"
>>> name="Test" model="/1"/>
>>> <bindings location="12:7-12:21" propertyName="name">
>>> <value xsi:type="ocl:NavigationOrAttributeCallExp"
>>> location="12:15-12:21" name="name">
>>> <source xsi:type="ocl:VariableExp" location="12:15-12:16"
>>> name="s"/>
>>> </value>
>>> </bindings>
>>> <bindings location="13:7-13:35" propertyName="description">
>>> <value xsi:type="ocl:NavigationOrAttributeCallExp"
>>> location="13:22-13:35" name="description">
>>> <source xsi:type="ocl:VariableExp" location="13:22-13:23"
>>> name="s"/>
>>> </value>
>>> </bindings>
>>> </elements>
>>> </outPattern>
>>
>> Best regards,
>>
>> Hugo
>>


--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
Previous Topic:[ATL] General Question XML2XML
Next Topic:[ATL] how to get more error message when transformation failed?
Goto Forum:
  


Current Time: Thu Apr 25 15:36:14 GMT 2024

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

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

Back to the top