Skip to main content



      Home
Home » Modeling » MoDisco » XMI from java discoverer
XMI from java discoverer [message #855748] Wed, 25 April 2012 00:21 Go to next message
Eclipse UserFriend
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 01:18 Go to previous messageGo to next message
Eclipse UserFriend
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 04:01 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: XMI from java discoverer [message #856489 is a reply to message #855790] Wed, 25 April 2012 14:08 Go to previous messageGo to next message
Eclipse UserFriend
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 13:20 Go to previous messageGo to next message
Eclipse UserFriend
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] Sun, 29 April 2012 22:47 Go to previous messageGo to next message
Eclipse UserFriend
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 07:00 Go to previous message
Eclipse UserFriend
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: Sun May 18 00:59:06 EDT 2025

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

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

Back to the top