Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Resolving Elements in a different Resource
Resolving Elements in a different Resource [message #626422] Thu, 17 April 2008 18:33
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Hey,

I load a UML Model with this (Getting Started Tutorial #2 Code):

public static org.eclipse.uml2.uml.Model load(URI uri) {
ResourceSet rs = new ResourceSetImpl();
rs.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);

org.eclipse.uml2.uml.Model model = null;

try {

Resource resource = rs.getResource(uri, true);
model = (org.eclipse.uml2.uml.Model) EcoreUtil
.getObjectByType(resource.getContents(),
UMLPackage.Literals.MODEL);
} catch (WrappedException we) {
we.printStackTrace();
}

return model;
}
catch {...}

The model contains a Class with a Property whose Type is defined in another Resource.

If I now navigate to this Property and ask for "getType().getQualifiedName()", it returns
null, so it seems like there is something wrong with the resolver, but I have no clue..

Here's the relevant part of the input model:

<packagedElement xmi:type="uml:Class" xmi:id="_e6BZ8ArOEd2e0rP7R-gUuQ" name="User">
<ownedAttribute xmi:id="_gN7R0ArOEd2e0rP7R-gUuQ" name="name">
<type xmi:type="uml:Class" href="../../../../model/allure.uml#_rAxscAynEd2RB6PoibfsgQ"/ >
</ownedAttribute>
</packagedElement>
</packagedElement>


Thanks for any help,
Felix
Previous Topic:Re: Primitive types
Next Topic:UML2 vs EMF generated code difference
Goto Forum:
  


Current Time: Wed Apr 24 14:40:56 GMT 2024

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

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

Back to the top