Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Loading a uml model with a profile (in an ATL transformation)
Loading a uml model with a profile (in an ATL transformation) [message #626700] Thu, 12 June 2008 12:20
Eclipse UserFriend
Originally posted by: karp.no-mail.com

Hi,

My question is about an ATL transformation but since it seems mostly
EMF/UML2 I ask it here.

I've got a simple transformation that take ModelA.uml in input and
ModelB.uml in output
ModelA.uml uses sterotypes from a profile 'Test.profile.uml'

Here is what I do in my program to register the resources. (ATL use the
EMF ResourceSet)

------------------------8<------------------------
ResourceSet resourceSet = ASMEMFModel.getResourceSet();
resourceSet.getPackageRegistry().put("http://www.eclipse.org/uml2/2.1.0/UML",
UMLPackage.eINSTANCE);
// Profile registration
resourceSet.getPackageRegistry().put("http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0",
UMLPackage.eINSTANCE);
URI uri =
URI.createURI(" jar:file:///D:/eclipse/eclipse-modeling-ganymede-RC1-win32/A TL_LIBS_RC3/org.eclipse.uml2.uml.resources_2.2.0.v2008051310 30.jar!/");
Map<URI, URI> uRIMap = resourceSet.getURIConverter().getURIMap();
uRIMap.put(URI.createURI(""), URI.createFileURI("PATH"));
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(""));
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
UMLResource.Factory.INSTANCE);
------------------------8<-------------------------

I've got a Java project from which I launch programatically the
transformation.
And I've got an ATL project where are located my models, profile, and my
transformation.

Now the problem is that when I launch (programmatically) my
transformation, I obtain this error :
org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
uri 'http:///schemas/Test/_UiwQwDhYEd2PFcRE_i9KZg/0' not found.
( file:///D:/Stage/eclipse-modeling-ganymede-RC1-win32/workspa ce/LaunchAtlUml/A,
23, 93)
EMF is looking for the profile in my Java project (LaunchAtlUml is my
Java project). If I put it there, it works fine.
But I would like to keep my profile in my Transformation project.
I suppose I can do that with the URIConverter or something like that.
Any idea ?
Previous Topic:XML/XMI import/export issues?
Next Topic:UML 2 Plugin
Goto Forum:
  


Current Time: Thu Aug 11 16:01:46 GMT 2022

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

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

Back to the top