How to register UML Metamodel (standalone) [message #556332] |
Tue, 31 August 2010 20:05 |
Eclipse User |
|
|
|
Originally posted by: daniruiz.lcc.uma.es
Hi all,
I need to register the UML metamodel standalone. What I do is quite simple:
// Register UML Metamodel
EPackage umlPack = UMLPackage.eINSTANCE;
EPackage.Registry.INSTANCE.put(umlPack.getNsURI(), umlPack);
I add the uml2 jar to the build path and everything seems fine, but when
I try to inject a uml model (as entry for an ATL transformation) the
following exception is thrown:
org.eclipse.m2m.atl.core.ATLCoreException: Error loading
file:/D:/ODP_Example.uml:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'Data' is not
legal. (file:/D:/ODP_Example.uml, 3, 75)
at org.eclipse.m2m.atl.core.emf.EMFInjector.inject(EMFInjector. java:70)
at org.eclipse.m2m.atl.core.emf.EMFInjector.inject(EMFInjector. java:84)
....
The model (ODP_Example.uml) starts with a uml package called 'Data', but
why is it illegal?
I remember that in previous versions you should load the
UMLResource.LIBRARIES_PATHMAP, UMLResource.METAMODELS_PATHMAP, and
UMLResource.PROFILES_PATHMAP with some code like:
-----------------------------
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
UMLResource.Factory.INSTANCE);
Map uriMap = resourceSet.getURIConverter().getURIMap();
URL umlJarURL = getClass().getResource(UML2_JAR);
URI uri = URI.createURI("jar:/" + umlJarURL.getPath() + "!/");
uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
uri.appendSegment("libraries").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
uri.appendSegment("metamodels").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
uri.appendSegment("profiles").appendSegment(""));
---------------------------------
How do I load these resources in the actual version?
Thank you,
Daniel.
|
|
|
Powered by
FUDForum. Page generated in 0.03916 seconds