Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Stereotypes are lost when model is saved
Stereotypes are lost when model is saved [message #572198] Thu, 18 January 2007 15:48
Francisco  Gortázar is currently offline Francisco GortázarFriend
Messages: 20
Registered: July 2009
Location: Spain
Junior Member
Hi,

I'm trying to save a model containing elements with some stereotypes
applied. I'm using the code from UML2 article to programmatically apply
stereotypes. When the model is saved, the stereotypes are lost. However,
when debugging the application the stereotypes seem to be correctly
applied. Any suggestions?

I'm using Eclipse 3.2, UML 2.0.2. EMF 2.2.0, and I'm applying the
stereotypes as follows:

Model theModel = UMLFactory.eINSTANCE.createModel();
theModel.setName("ASModel");

Profile profile = (Profile) load(
URI.createURI("platform:/resource/parserProfile.uml"));
UML2Article.applyProfile(theModel, profile);

Class umlClass = theModel.createOwnedClass("MyClass", false);

Stereotype typeStereotype = profile.getOwnedStereotype("type");
UML2Article.applyStereotype(umlClass, typeStereotype);

savePackage("SimpleStereotypeUsage.uml", theModel);
this.printAppliedStereotypes(umlClass, ""); // OK: prints "type"


Thank you,
Patxi


Previous Topic:Property Template Parameters
Next Topic:Installing uml2
Goto Forum:
  


Current Time: Sat Aug 20 00:29:55 GMT 2022

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

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

Back to the top