Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Format of output model
[ATL] Format of output model [message #666271] Tue, 19 April 2011 16:44 Go to next message
Ton Tu is currently offline Ton Tu
Messages: 16
Registered: June 2010
Junior Member
Hi everyone,
I have a problem with the text element in the output model. More precisely, I want to create a kind of model like
<Element>This is the text element</Element>
. I followed the instruction in this post http://www.eclipse.org/forums/index.php?t=rview&goto=655 553&th=203153. I injected an XML schema to produce an ECORE meta-model.
The problem is that when the ATL rule is run, all text elements turned out to be attributes! At first, I thought that was the problem with my ECORE meta-model. I created an EMF project to produce a model editor. The format of my model was perfectly right (text elements appeared).
So, my question is: does ATL support the generation of text elements and if it does, how could we specify them in a specific ATL rule?
Thanks in advance!
Re: [ATL] Format of output model [message #666297 is a reply to message #666271] Tue, 19 April 2011 19:35 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26137
Registered: July 2009
Senior Member
Ton,

Serialization issues like this typically come down to which resource
factory is creating the resource used to save your model. It better be
the one you generated and that the generated editor uses...


Ton Tu wrote:
> Hi everyone,
> I have a problem with the text element in the output model. More
> precisely, I want to create a kind of model like <Element>This is the
> text element</Element>. I followed the instruction in this post
> http://www.eclipse.org/forums/index.php?t=rview&goto=655 553&th=203153
> I injected an XML schema to produce an ECORE meta-model.
> The problem is that when the ATL rule is run, all text elements turned
> out to be attributes! At first, I thought that was the problem with my
> ECORE meta-model. I created an EMF project to produce a model editor.
> The format of my model was perfectly right (text elements appeared).
> So, my question is: does ATL support the generation of text elements
> and if it does, how could we specify them in a specific ATL rule?
> Thanks in advance!
Re: [ATL] Format of output model [message #666314 is a reply to message #666271] Tue, 19 April 2011 20:53 Go to previous messageGo to next message
Ton Tu is currently offline Ton Tu
Messages: 16
Registered: June 2010
Junior Member
Hi Ed,
Following your hints, I found out another person's suggestion about this issue:
Quote:
ATL does not directly handle XMI loading, but delegates it to EMF. If you manage to load this model in EMF outside of ATL, then maybe ATL is not using the same resource factory (you should first make sure that the proper resource factory is installed in your Eclipse)

My question is once ATL delegates the duty of handling model loading to EMF, how can EMF but not ATL can produce the right format model?
And if it can somehow happen, could you show me how to check the compatibility of resource factories of EMF and ATL? I've been scouring through this forum but haven't got any result...
Many thanks to your reply.
Re: [ATL] Format of output model [message #666356 is a reply to message #666314] Wed, 20 April 2011 05:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26137
Registered: July 2009
Senior Member
Ton,

Unfortunately I know nothing about how ATL is configured. In EMF you
register your resource factories typically against a file extension in
your plugin.xml; have a look at your generated model's plugin.xml. How
to do that with ATL is something someone here needs to answer...


Ton Tu wrote:
> Hi Ed,
> Following your hints, I found out another person's suggestion about
> this issue:
> Quote:
>> ATL does not directly handle XMI loading, but delegates it to EMF. If
>> you manage to load this model in EMF outside of ATL, then maybe ATL
>> is not using the same resource factory (you should first make sure
>> that the proper resource factory is installed in your Eclipse)
>
> My question is once ATL delegates the duty of handling model loading
> to EMF, how can EMF but not ATL can produce the right format model?
> And if it can somehow happen, could you show me how to check the
> compatibility of resource factories of EMF and ATL? I've been
> scouring through this forum but haven't got any result... Many thanks
> to your reply.
Re: [ATL] Format of output model [message #666424 is a reply to message #666271] Wed, 20 April 2011 12:29 Go to previous message
Ton Tu is currently offline Ton Tu
Messages: 16
Registered: June 2010
Junior Member
Hi Ed,
Thank you for your enthusiasm Smile.
I found another guy asking the same thing Cool here: http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg00345.html and the advice he got is using AM3 to perform a model extraction. I'll try that approach to see if it works with text element or not.
Previous Topic:Problem with hyphens in attributes
Next Topic:ECore Meta-Model to XMI Transform Issue: Re-used Entities Only Take Last Map
Goto Forum:
  


Current Time: Thu Oct 23 06:01:44 GMT 2014

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

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