Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » UML2 Stereotypes missing when loading standalone; works correctly when running as plugin
UML2 Stereotypes missing when loading standalone; works correctly when running as plugin [message #627903] Sat, 29 August 2009 11:46
Philip Mayer is currently offline Philip MayerFriend
Messages: 30
Registered: July 2009
Member
Hi all,

I have worked successfully with UML 2.0.0 models, including applied
stereotypes, exported from MagicDraw in my plugins for quite some time
now. MagicDraw exports several .uml files - one is my project, the
others are profiles, among them my own. They are referenced in the
project.uml file.

When I load the main file *in a plugin* with the following code,
everything is fine and I can get a correct list of applied stereotypes
for an element with element.getAppliedStereotypes().

fInputResourceSet= new ResourceSetImpl();
fInputResource= fInputResourceSet.getResource(fileURI, true);

So far, so good. Now, I'm running the code not as a plugin, but
*standalone* (aim is to have faster test cases). I therefore register
the necessary packages before I execute the above code to load the model:

EPackage.Registry.INSTANCE.put("http://www.eclipse.org/uml2/2.0.0/UML",
UMLPackage.eINSTANCE);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "uml",
new XMIResourceFactoryImpl());

Now, I can read the UML model just as before and get all the elements,
correctly typed. However, a call to element.getAppliedStereotypes()
ALWAYS returns [].

What am I missing? There are no exceptions or error messages I am aware of.

Thanks,

Philip
Previous Topic:[Announce] MDT UML2 3.0.1RC2 is available
Next Topic:UML2 Stereotypes missing when loading standalone; works correctly when running as plugin
Goto Forum:
  


Current Time: Fri Apr 26 21:17:53 GMT 2024

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

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

Back to the top