Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Extract ATL model to ATL text - reloaded
Extract ATL model to ATL text - reloaded [message #106700] Wed, 17 June 2009 15:15 Go to next message
Cosmin Ciuraru is currently offline Cosmin CiuraruFriend
Messages: 16
Registered: July 2009
Junior Member
Hello,

I'm working on a higher order transformation which targets ATL and, in
order to check it, I'd like to see the actual generated ATL code (extract
it from the ATL model) and tried doing so using an ant file.

-------------------------------------------------
Scenario 1: Eclipse Ganymede (ATL 2.02), AM3, TCS
-------------------------------------------------

1.1

*********** build.xml -save section ******************
<am3.saveModel model="ATLOutput" path="${targetModelText}">
<extractor name="ebnf">
<param name="format" value="ATL-TCS"/>
<param name="indentString" value=" "/>
<param name="serializeComments" value="false"/>
</extractor>
</am3.saveModel>
*****************************************************

Exception: could not read property "isNoDefault";
I use the ATL-0.2.ecore metamodel as target in my transformation, the
element isNoDefault is in ATL-0.2-TCS.ecore, therefore it can't find it
(this happens when it reaches MatchedRule, the module, import and
libraryRef is written ok).

1.2

"AM3 Perspective -> Extract ATL-0.2 Model to ATL-0.3 File" doesn't produce
anything (on the target file, with an .xmi extension).

----------------------------------------------------
Scenario 2 - Eclipse Galileo - ATL 3
----------------------------------------------------

I really didn't find some specific atl saveModel section with an
extractor, so, I tried figuring it out, don't know if this is correct:

*************** build.xml *************************
<project name="project" default="default">

<property name="atl.launcher" value="Regular VM (with debugger)" />

<target name="default" depends="modelsLoading">
<atl.launch path="transfo/Tocl2Atl.asm">
<inModel name="IN" model="ToclInput" />
<outModel name="OUT" model="atlFile" metamodel="ATL" />
</atl.launch>

<atl.saveModel model="atlFile" path="output/out.atl">
<extractor name="ATL"/>
</atl.saveModel>

</target>

<target name="modelsLoading">
<atl.loadModel modelHandler="EMF" name="tocl" metamodel="MOF"
path="metamodels/tocl.ecore" />
<atl.loadModel modelHandler="EMF" name="ATL" metamodel="MOF"
path="metamodels/ATL-0.2.ecore" />
<atl.loadModel modelHandler="EMF" name="ToclInput" metamodel="tocl"
path="input/ocl_rule.tocl" />
</target>

</project>
**************************************************

Exception:org.eclipse.m2m.atl.core.ui.vm.asm.ASMModelWrapper cannot be
cast to org.eclipse.m2m.atl.core.emf.EMFModel.

I also found on the newsgroup suggesitons to use Xpand from oaw, didn't
really try it, especially because the extractor for ATL is already
implemented in ATL 3, can be used in ant files, without any am3, tcs...

So, whether it is for ATL 3, or for the older version, do you have any
suggestions?

Best regards,
Cosmin
[ATL] Re: Extract ATL model to ATL text - reloaded [message #106742 is a reply to message #106700] Thu, 18 June 2009 06:30 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

Answers below:

Cosmin Ciuraru a écrit :
> Hello,
>
> I'm working on a higher order transformation which targets ATL and, in
> order to check it, I'd like to see the actual generated ATL code
> (extract it from the ATL model) and tried doing so using an ant file.
>
> -------------------------------------------------
> Scenario 1: Eclipse Ganymede (ATL 2.02), AM3, TCS
> -------------------------------------------------
>
> 1.1
>
> *********** build.xml -save section ******************
> <am3.saveModel model="ATLOutput" path="${targetModelText}">
> <extractor name="ebnf">
> <param name="format" value="ATL-TCS"/>
> <param name="indentString" value=" "/>
> <param name="serializeComments" value="false"/>
> </extractor>
> </am3.saveModel>
> *****************************************************
>
> Exception: could not read property "isNoDefault"; I use the
> ATL-0.2.ecore metamodel as target in my transformation, the element
> isNoDefault is in ATL-0.2-TCS.ecore, therefore it can't find it (this
> happens when it reaches MatchedRule, the module, import and libraryRef
> is written ok).
>
> 1.2
>
> "AM3 Perspective -> Extract ATL-0.2 Model to ATL-0.3 File" doesn't
> produce anything (on the target file, with an .xmi extension).
>
> ----------------------------------------------------
> Scenario 2 - Eclipse Galileo - ATL 3
> ----------------------------------------------------
>
> I really didn't find some specific atl saveModel section with an
> extractor, so, I tried figuring it out, don't know if this is correct:
>
> *************** build.xml *************************
> <project name="project" default="default">
>
> <property name="atl.launcher" value="Regular VM (with debugger)" />
>

At this time, ATL ant tasks does'nt allow use of multiple VMs for one
ANT project, as models are not loaded under the same format.
And the ATL Extractor has only been defined for EMFModel
(ASMModelWrapper are used by RegularVM) - to fix compilation performance
issues.

So here, you have to specify no atl.launcher property (EMF specific VM
is default for ant tasks), or:
<property name="atl.launcher" value="EMF-specific VM" />

Best regards,

William

> <target name="default" depends="modelsLoading">
> <atl.launch path="transfo/Tocl2Atl.asm">
> <inModel name="IN" model="ToclInput" />
> <outModel name="OUT" model="atlFile" metamodel="ATL" />
> </atl.launch>
>
> <atl.saveModel model="atlFile" path="output/out.atl">
> <extractor name="ATL"/>
> </atl.saveModel>
>
> </target>
>
> <target name="modelsLoading">
> <atl.loadModel modelHandler="EMF" name="tocl" metamodel="MOF"
> path="metamodels/tocl.ecore" />
> <atl.loadModel modelHandler="EMF" name="ATL" metamodel="MOF"
> path="metamodels/ATL-0.2.ecore" />
> <atl.loadModel modelHandler="EMF" name="ToclInput"
> metamodel="tocl" path="input/ocl_rule.tocl" />
> </target>
>
> </project>
> **************************************************
>
> Exception:org.eclipse.m2m.atl.core.ui.vm.asm.ASMModelWrapper cannot be
> cast to org.eclipse.m2m.atl.core.emf.EMFModel.
>
> I also found on the newsgroup suggesitons to use Xpand from oaw, didn't
> really try it, especially because the extractor for ATL is already
> implemented in ATL 3, can be used in ant files, without any am3, tcs...
>
> So, whether it is for ATL 3, or for the older version, do you have any
> suggestions?
>
> Best regards,
> Cosmin
>
>
>
>
>
[ATL] Re: [ATL] Re: Extract ATL model to ATL text - reloaded [message #106770 is a reply to message #106742] Thu, 18 June 2009 07:22 Go to previous messageGo to next message
Cosmin Ciuraru is currently offline Cosmin CiuraruFriend
Messages: 16
Registered: July 2009
Junior Member
Hello,

Thank you for your help William, I've made the changes and overpassed the
initial exception. However, when it tries to save the model using the ATL
extractor, I come against this exception:

could not read property "isNoDefault" of element
org.eclipse.emf.ecore.impl.DynamicEObjectImpl@178fd24 (eClass:
org.eclipse.emf.ecore.impl.EClassImpl@11c4d14 (name: MatchedRule)
(instanceClassName: null) (abstract: false, interface: false)) :
MatchedRule

It's actually the same exception as in Scenario 1 (1.1 trial), in my first
post. Should I be using the metamodel for ATL 3? So actually, the
extractor uses the ATL-0.2-TCS (there I found the property isNoDefault, in
the MatchedRule). The MatchedRule in ATL-0.2 has the isDefault property,
and I set it to true in my transformation, but that didn't change a thing.

Thank you!

Best regards,
Cosmin
Re: [ATL] Re: [ATL] Re: Extract ATL model to ATL text - reloaded [message #106784 is a reply to message #106770] Thu, 18 June 2009 07:36 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
The metamodel you should use for the transformation is the following:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.m2m.atl/plugins/org.eclipse.m2m.atl.common/src/org/ eclipse/m2m/atl/common/resources/ATL.ecore?root=Modeling_Pro ject&view=markup

William

Cosmin Ciuraru a écrit :
> Hello,
>
> Thank you for your help William, I've made the changes and overpassed
> the initial exception. However, when it tries to save the model using
> the ATL extractor, I come against this exception:
>
> could not read property "isNoDefault" of element
> org.eclipse.emf.ecore.impl.DynamicEObjectImpl@178fd24 (eClass:
> org.eclipse.emf.ecore.impl.EClassImpl@11c4d14 (name: MatchedRule)
> (instanceClassName: null) (abstract: false, interface: false)) :
> MatchedRule
>
> It's actually the same exception as in Scenario 1 (1.1 trial), in my
> first post. Should I be using the metamodel for ATL 3? So actually, the
> extractor uses the ATL-0.2-TCS (there I found the property isNoDefault,
> in the MatchedRule). The MatchedRule in ATL-0.2 has the isDefault
> property, and I set it to true in my transformation, but that didn't
> change a thing.
> Thank you!
>
> Best regards,
> Cosmin
SOLVED: Re: [ATL] Re: Extract ATL model to ATL text - reloaded [message #106798 is a reply to message #106784] Thu, 18 June 2009 07:48 Go to previous message
Cosmin Ciuraru is currently offline Cosmin CiuraruFriend
Messages: 16
Registered: July 2009
Junior Member
William Piers wrote:

> The metamodel you should use for the transformation is the following:
>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2m/org .eclipse.m2m.atl/plugins/org.eclipse.m2m.atl.common/src/org/ eclipse/m2m/atl/common/resources/ATL.ecore?root=Modeling_Pro ject&view=markup

It's working. Thank you!

Regards,
Cosmin
Previous Topic:generating n attributes
Next Topic:[ATL] - How can I get the result from the amount of abstract classes (ECORE)
Goto Forum:
  


Current Time: Fri Apr 19 23:42:35 GMT 2024

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

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

Back to the top