Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to register UML Metamodel (standalone)
How to register UML Metamodel (standalone) [message #628618] Tue, 31 August 2010 20:05
Eclipse UserFriend
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.
Previous Topic:How to register UML Metamodel (standalone)
Next Topic:Problem copy sterotype
Goto Forum:
  


Current Time: Thu Apr 25 15:03:12 GMT 2024

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

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

Back to the top