Generate model to ecore file [message #56186] |
Wed, 08 July 2009 04:24  |
Eclipse User |
|
|
|
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 16:06   |
Eclipse User |
|
|
|
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 16:24   |
Eclipse User |
|
|
|
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 #56678 is a reply to message #56436] |
Thu, 09 July 2009 08:01  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.09086 seconds