Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generate model to ecore file
Generate model to ecore file [message #56186] Wed, 08 July 2009 08:24 Go to next message
Adalbert Gorecki is currently offline Adalbert GoreckiFriend
Messages: 10
Registered: July 2009
Junior Member
Hi everyone,

I have created my own DSL and I want to transform the model written in my
new DSL into something else by using M2M transformation with ATL. I know
it sounds weird but it is part of my diploma thesis and there it makes
perfect sense :)
Is it possible to get my model as XMI/ecore file (without writing my own
generator) so I can use it in ATL as input for my transformation?
Or else, what would you recommend how I could hook up a M2M transformation
to Xtext?

Best regards,
Adalbert
Re: Generate model to ecore file [message #56243 is a reply to message #56186] Wed, 08 July 2009 09:07 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 2961
Registered: July 2009
Senior Member
Hi Adalbert,

please try to use your dsl file directly as input in your ATL
transformation. It should work fine.
Please let me know if you experience any problems with this approach.

Regards,
Sebastian

Am 08.07.2009 10:24 Uhr, schrieb Adalbert Gorecki:
> Hi everyone,
>
> I have created my own DSL and I want to transform the model written in
> my new DSL into something else by using M2M transformation with ATL. I
> know it sounds weird but it is part of my diploma thesis and there it
> makes perfect sense :)
> Is it possible to get my model as XMI/ecore file (without writing my own
> generator) so I can use it in ATL as input for my transformation?
> Or else, what would you recommend how I could hook up a M2M
> transformation to Xtext?
>
> Best regards,
> Adalbert
>
Re: Generate model to ecore file [message #56409 is a reply to message #56243] Wed, 08 July 2009 20:06 Go to previous messageGo to next message
Alexis Marechal is currently offline Alexis MarechalFriend
Messages: 16
Registered: July 2009
Junior Member
Hi,

We are also using TMF and ATL for M2M transformation, in our research as
well as in a masters project of one of our students. I don't think it's
weird :-P.

I just tried to use a TMF generated ecore metamodel and a file created
with the TMF editor as an instance, and I got the following error:

"Error loading platform:/resource/ProjectAToTree/ATL/projectA.pa:
org.xml.sax.SAXParseException: Content is not allowed in prolog."

Then we tried Adalbert's solution, transforming the file into xmi, and
then ATL worked without problems.

For information, this transformation is very simple if you created a
generator project: just find the .mwe workflow and replace the component
"org.eclipse.xpand2.Generator" with:

<component class="org.eclipse.emf.mwe.utils.Writer">
<uri value="./your path here/your file name here.xmi" />
<modelSlot value="model" />
</component>

Running the generator workflow should produce your xmi file.

If we can avoid the latest step it will be nice (and our masters student
will probably be relieved!).

Regards,
Alexis

Sebastian Zarnekow wrote:
> Hi Adalbert,
>
> please try to use your dsl file directly as input in your ATL
> transformation. It should work fine.
> Please let me know if you experience any problems with this approach.
>
> Regards,
> Sebastian
>
> Am 08.07.2009 10:24 Uhr, schrieb Adalbert Gorecki:
>> Hi everyone,
>>
>> I have created my own DSL and I want to transform the model written in
>> my new DSL into something else by using M2M transformation with ATL. I
>> know it sounds weird but it is part of my diploma thesis and there it
>> makes perfect sense :)
>> Is it possible to get my model as XMI/ecore file (without writing my own
>> generator) so I can use it in ATL as input for my transformation?
>> Or else, what would you recommend how I could hook up a M2M
>> transformation to Xtext?
>>
>> Best regards,
>> Adalbert
>>
>
Re: Generate model to ecore file [message #56436 is a reply to message #56409] Wed, 08 July 2009 20:24 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 2961
Registered: July 2009
Senior Member
Hi Alexis,

is there a way to specify the EMF resource factories that are available
in the transformation engine? The error message indicates a missing
resource factory for the 'pa' file extension.

Regards,
Sebastian

Am 08.07.2009 22:06 Uhr, schrieb Alexis Marechal:
> Hi,
>
> We are also using TMF and ATL for M2M transformation, in our research as
> well as in a masters project of one of our students. I don't think it's
> weird :-P.
>
> I just tried to use a TMF generated ecore metamodel and a file created
> with the TMF editor as an instance, and I got the following error:
>
> "Error loading platform:/resource/ProjectAToTree/ATL/projectA.pa:
> org.xml.sax.SAXParseException: Content is not allowed in prolog."
>
> Then we tried Adalbert's solution, transforming the file into xmi, and
> then ATL worked without problems.
>
> For information, this transformation is very simple if you created a
> generator project: just find the .mwe workflow and replace the component
> "org.eclipse.xpand2.Generator" with:
>
> <component class="org.eclipse.emf.mwe.utils.Writer">
> <uri value="./your path here/your file name here.xmi" />
> <modelSlot value="model" />
> </component>
>
> Running the generator workflow should produce your xmi file.
>
> If we can avoid the latest step it will be nice (and our masters student
> will probably be relieved!).
>
> Regards,
> Alexis
>
> Sebastian Zarnekow wrote:
>> Hi Adalbert,
>>
>> please try to use your dsl file directly as input in your ATL
>> transformation. It should work fine.
>> Please let me know if you experience any problems with this approach.
>>
>> Regards,
>> Sebastian
>>
>> Am 08.07.2009 10:24 Uhr, schrieb Adalbert Gorecki:
>>> Hi everyone,
>>>
>>> I have created my own DSL and I want to transform the model written in
>>> my new DSL into something else by using M2M transformation with ATL. I
>>> know it sounds weird but it is part of my diploma thesis and there it
>>> makes perfect sense :)
>>> Is it possible to get my model as XMI/ecore file (without writing my own
>>> generator) so I can use it in ATL as input for my transformation?
>>> Or else, what would you recommend how I could hook up a M2M
>>> transformation to Xtext?
>>>
>>> Best regards,
>>> Adalbert
>>>
>>
Re: Generate model to ecore file [message #56516 is a reply to message #56409] Wed, 08 July 2009 23:57 Go to previous messageGo to next message
Krzysztof Kowalczyk is currently offline Krzysztof KowalczykFriend
Messages: 113
Registered: July 2009
Senior Member
> Then we tried Adalbert's solution, transforming the file into xmi, and
> then ATL worked without problems.
>
> For information, this transformation is very simple if you created a
> generator project: just find the .mwe workflow and replace the component
> "org.eclipse.xpand2.Generator" with:
>
> <component class="org.eclipse.emf.mwe.utils.Writer">
> <uri value="./your path here/your file name here.xmi" />
> <modelSlot value="model" />
> </component>

IMHO best solution would be to create ATL component for MWE workflow.
AFAIK MoDisco is using MWE and ATL, so maybe they have developed such
component.

Cheers,
Krzysztof Kowalczyk
Re: Generate model to ecore file [message #56678 is a reply to message #56436] Thu, 09 July 2009 12:01 Go to previous message
Alexis Marechal is currently offline Alexis MarechalFriend
Messages: 16
Registered: July 2009
Junior Member
Hi Sebastian,

AFAIK this is possible using Ant to launch ATL, but I just spent a
couple of hours trying without result, probably because I'm a complete
noob using ATL.

Of course, if there is an MWE component to do this like Krzysztof says,
everything will be more simple. But in our case the xmi translation
works just fine.

Regards,
Alexis

Sebastian Zarnekow wrote:
> Hi Alexis,
>
> is there a way to specify the EMF resource factories that are available
> in the transformation engine? The error message indicates a missing
> resource factory for the 'pa' file extension.
>
> Regards,
> Sebastian
>
Previous Topic:Eclipse xtext projects to Central Maven Repository
Next Topic:Recipe framework gone?
Goto Forum:
  


Current Time: Sat Dec 20 18:47:39 GMT 2014

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

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