Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » XMI from java discoverer
XMI from java discoverer [message #855748] Wed, 25 April 2012 04:21 Go to next message
Juan Castel is currently offline Juan CastelFriend
Messages: 20
Registered: April 2012
Junior Member
Hi.

I have the XMI model result of MoDisco java discoverer, but I cannot load it and navigate nor use it in ATL, since it simply does not work. When you choose that XMI from an ATL configuration as MM:IN, the content assist (ctrl+spacebar) in Eclipse ATL doesn't give me any element of the XMI model.

How can I register the java metamodel of MoDisco and then do something like:
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION,
URI uri = URI.createFileURI(file.getAbsolutePath());//MoDisco XMI absolute path
Resource resource = resourceSet.getResource(uri,true);							new XMIResourceFactoryImpl());


Thank you.
Re: XMI from java discoverer [message #855790 is a reply to message #855748] Wed, 25 April 2012 05:18 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26283
Registered: July 2009
Senior Member
Juan,

Using XyzPackage.eINSTANCE.eClass() is an idiom for initializing the
package instance, and as a side-effect it will register itself in the
EPackage.Registry.INSTANCE, or you can use
resourceSet.getPackageRegistry().put(XyzPackage.eNS_URI,
XyzPackage.eINSTANCE). Note that Xyz is the name of the package.

On 25/04/2012 6:21 AM, Juan Castel wrote:
> Hi.
>
> I have the XMI model result of MoDisco java discoverer, but I cannot
> load it and navigate nor use it in ATL, since it simply does not work.
> When you choose that XMI from an ATL configuration as MM:IN, the
> content assist (ctrl+spacebar) in Eclipse ATL doesn't give me any
> element of the XMI model.
>
> How can I register the java metamodel of MoDisco and then do something
> like:
>
> ResourceSet resourceSet = new ResourceSetImpl();
> resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION,
>
> URI uri = URI.createFileURI(file.getAbsolutePath());//MoDisco XMI
> absolute path
> Resource resource =
> resourceSet.getResource(uri,true); new
> XMIResourceFactoryImpl());
>
>
> Thank you.
Re: XMI from java discoverer [message #855927 is a reply to message #855748] Wed, 25 April 2012 08:01 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 616
Registered: July 2009
Senior Member
Hi Juan,

We have already used many times ATL to transform Java models obtained thanks to MoDisco. In order to be able to use the content assist while writing your transformation, are you sure to have properly declared the Java metamodel nsURI in the ATL transformation file header? (cf. http://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Tools#Content_assist)
I also encourage you to read carefully the detailed ATL user guide as available from http://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Language, and to post the related questions directly onto the M2M (soon eclipse.modeling.mmt.atl) forum.

Best regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: XMI from java discoverer [message #856489 is a reply to message #855790] Wed, 25 April 2012 18:08 Go to previous messageGo to next message
Juan Castel is currently offline Juan CastelFriend
Messages: 20
Registered: April 2012
Junior Member
Thank you so much for your quick answers. Now the question has narrowed down to: where can I find and download the modisco java metamodel in order to register in atl or in emf registry? And, will I query the elements in the xmi from modisco or the elements in the java metamodel? Thanks a lot, again.
Re: XMI from java discoverer [message #861658 is a reply to message #856489] Sat, 28 April 2012 17:20 Go to previous messageGo to next message
Juan Castel is currently offline Juan CastelFriend
Messages: 20
Registered: April 2012
Junior Member
I found out: it was just this to find the eclipse.org/MoDisco/Java/0.2.incubation/java when creating a new ATL file as input model

Thank you all.
Re: XMI from java discoverer [message #864608 is a reply to message #861658] Mon, 30 April 2012 02:47 Go to previous messageGo to next message
Juan Castel is currently offline Juan CastelFriend
Messages: 20
Registered: April 2012
Junior Member
Hugo, could I get a copy of the java metamodel ecore file?
Re: XMI from java discoverer [message #884562 is a reply to message #855748] Mon, 11 June 2012 11:00 Go to previous message
Thomas Buchmann is currently offline Thomas BuchmannFriend
Messages: 53
Registered: November 2010
Member
Hello Juan,

it is included in the org.eclipse.gmt.modisco.java plugin. Just import it as source project into your workspace and you also have the java metamodel ecore file Smile

Regards,
Thomas
Previous Topic:Java Model not linked to GASTM
Next Topic:no uml file from kdm
Goto Forum:
  


Current Time: Fri Dec 19 09:26:28 GMT 2014

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

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