Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Register ATL metamodel in EMF Registry
[ATL] Register ATL metamodel in EMF Registry [message #103834] Tue, 21 April 2009 22:21 Go to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
Hi,
I want to use the ATL metamodel to launch a high order transformation
where i will modify an ATL model. The problem is that the ATL metamodel
uri is not registered in he EMF registry so i cannot select it in the run
configuration window, i also want to use the ATL metamodel uri
programmatically in the launch method.
The question is, how can i programmatically register the ATL metamodel in
the EMF registry from the ATL .jar files?

I tried to uncompress the atl.ecore metamodel from the .jar then i
generated the code with EMF, then i delivered it in a new feature, but
this causes some problems as there will be two diffrent implementations of
the metamodel that are not "equal".

I'm using ATL3
Thanks
Re: [ATL] Register ATL metamodel in EMF Registry [message #103860 is a reply to message #103834] Wed, 22 April 2009 07:48 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hello,

Since ATL 3.0, you can use a platform:/plugin... or
platform:/resource... uri. So for ATL, you can use:
platform:/plugin/org.eclipse.m2m.atl.common/src/org/eclipse/ m2m/atl/common/resources/ATL.ecore
in the launch configuration.

Best regards,

William

Skander a écrit :
> Hi,
> I want to use the ATL metamodel to launch a high order transformation
> where i will modify an ATL model. The problem is that the ATL metamodel
> uri is not registered in he EMF registry so i cannot select it in the
> run configuration window, i also want to use the ATL metamodel uri
> programmatically in the launch method. The question is, how can i
> programmatically register the ATL metamodel in the EMF registry from the
> ATL .jar files?
>
> I tried to uncompress the atl.ecore metamodel from the .jar then i
> generated the code with EMF, then i delivered it in a new feature, but
> this causes some problems as there will be two diffrent implementations
> of the metamodel that are not "equal".
>
> I'm using ATL3
> Thanks
Re: [ATL] Register ATL metamodel in EMF Registry [message #103954 is a reply to message #103860] Thu, 23 April 2009 08:24 Go to previous messageGo to next message
Skander TURKI is currently offline Skander TURKIFriend
Messages: 130
Registered: July 2009
Senior Member
thanks william, your solution worked and saved me a lot of time.

i also had to register the EPackges programmatically using this:

EMFModelLoader emfLoader = (EMFModelLoader) modelLoader;
Iterator<ASMEMFModelElement> it =
inMM.getElementsByType("EPackage").iterator();
while ( it.hasNext() ) {
EPackage ePackage = (EPackage) it.next().getObject();
emfLoader.getResourceSet().getPackageRegistry().put(
ePackage.getNsURI(), ePackage );


Skander.
Re: [ATL] Register ATL metamodel in EMF Registry [message #103978 is a reply to message #103954] Thu, 23 April 2009 09:28 Go to previous message
Andy Carpenter is currently offline Andy CarpenterFriend
Messages: 145
Registered: July 2009
Senior Member
Skander,

You may be able to use the extension point

org.eclipse.emf.ecore.dynamic_package in your plugin.xml to

avoid programmatically doing this.



William, I see that the code for org.eclipse.m2m.atl.drivers.emf4atl has

this present but commented out on the grounds that it is EMF 2.4 specific.

Can it not be enabled for the ATL 3.0.0 codebase?

Andy.



"Skander " <skander.turki@gmail.com> wrote in message
news:2e456636b69aff6a84a9c7cff10c4409$1@www.eclipse.org...
> thanks william, your solution worked and saved me a lot of time.
>
> i also had to register the EPackges programmatically using this:
>
> EMFModelLoader emfLoader = (EMFModelLoader) modelLoader;
> Iterator<ASMEMFModelElement> it =
> inMM.getElementsByType("EPackage").iterator();
> while ( it.hasNext() ) {
> EPackage ePackage = (EPackage) it.next().getObject();
> emfLoader.getResourceSet().getPackageRegistry().put( ePackage.getNsURI(),
> ePackage );
>
>
> Skander.
>
Previous Topic:How to generate like <tag>Information</tag> by using ATL
Next Topic:[ATL] Copying model elements - reference problem
Goto Forum:
  


Current Time: Tue Apr 23 06:48:25 GMT 2024

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

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

Back to the top