Community
Participate
Working Groups
I would like to suggest that org.eclipse.uml2.uml.Element should have a specific method to handle multi-valued stereotype attribute. org.eclipse.emf.common.util.EList<java.lang.Object> getValue(Stereotype stereotype, java.lang.String propertyName) To be used such as listed below: Element e = ....; EList<Object> list = e.getMultiValue(stereotype, "feature"); This is important to use UML2 on MOF QVT Operational transformations, because using somethig like this: x := class.getValue(stereotype,"feature").oclAsType(EEList).asSequence(); x+= b; It generates error, because getValue returns Object so x expects type oclstdlib::T. ----------- More details about version and environment: Eclipse Modeling Galileo - Build id: 20100218-1602 UML2 - org.eclipse.uml2 - Version: 3.0.1.v200908281330 Build id: 200908281428
I hesitate to add such a method, since the current getValue(...) method essentially mimics the analog in EMF, eGet(...). Does this same problem exist when doing something similar for Ecore models? Is there no way to "cast" the result of getValue(...) so that the right type is expected?
Sorry, I have been so focused on my problem and how to resolve based on messages and mailing list, such as: http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/msg04703.html That I stopped to try cast elements (so simple). modeltype OCL uses ocl('http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore'); x := class.getValue(stereotype,"feature").oclAsType(EEList).asSequence(); x+= b.oclAsType(oclstdlib::T); Work very well! Please ignore this enhancement!
OK, resolving this as "won't fix".
Closing for Indigo release.