[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.modeling.mdt.uml2.uml] Problem saving model with stereotypes

Hi there,

I'm creating a UML2 model, in which I'm applying some stereotypes to a Class. On the surface this appears to work fine, by which I mean that as I iterate over the model, I can see that my Class has the stereotype, *BUT* when I save the model, the stereotypes do not appear in my .uml file.

Here's what I'm doing..

clazz.applyStereotype(meS);
as = clazz.getAppliedStereotypes();
for (int i=0;i<as.size();i++){
Stereotype appliedStereo = (Stereotype)as.get(i);
out.println("Applied stereotypes : " +appliedStereo.getQualifiedName());
for (int s=0;s<appliedStereo.getOwnedAttributes().size();s++){
Property p = (Property) appliedStereo.getOwnedAttributes().get(s);
if (p.getName().equals("value")){
clazz.setValue((Stereotype)as.get(i), p.getName(), "hello" );
out.println("Attr Val " +clazz.getValue((Stereotype)as.get(i), p.getName()));
}
}
}


In my log, I get :

Applied stereotypes : withArray.Profile::managedEntity
Attr Val hello

Which seems to say that the Class has the sterotypes applied OK, but there's no sterotypes in the output when I save the model. The file contains the classes and attributes on it.. (My "save" method is taken direct from the "Getting started" tutorial.)

Any help greatly appreciated.

Richard