|Accessing stereotypes defined in SysML profiles with packages [message #1033773]
||Thu, 04 April 2013 12:20
| Matteo M.
Registered: May 2012
I defined a SysML profile containing a number of stereotypes that I need for my application. I'm able to use it in QVTo and all works as expected, i.e, I can successfully apply the stereotypes to UML::Class(es) in my maps. I provide my transformation with the profile as input parameter as follows:
transformation ... ( ..., in fct:UML, ... );
Then I get the profile as a property as follows:
property fct_prf = fct.rootObjects()![Profile];
I get a stereotype defined in the profile as a property as follows:
property zzz_stp = fct_prf.ownedStereotype![name = "ZZZ"];
and finally use applyStereotype(zzz_stp) on a generic UML::Class to successfully apply the stereotype.
The things stop working when I define a package in the profile and move all the stereotypes inside the package. I get the profile (as a property) as above. Then I get the package as a property in this way:
property fct_pkg = fct_prf.ownedElement->select(e | e.oclIsKindOf(Package)).oclAsType(Package)![name = "YYY"];
and the stereotype in this way:
property zzz_stp : Stereotype = fct_pkg.ownedElement->select(e | e.oclIsKindOf(Stereotype)).oclAsType(Stereotype)![name = "ZZZ"];
I use applyStereotype(zzz_stp) as above, but now I'm no longer able to apply stereotypes in my maps and I get error messages like this one:
ERROR: stereotype XXX::YYY::ZZZ is not applicable to element org.eclipse.uml2.uml.internal.impl.DependencyImpl@850992 (name: UUU, visibility: <unset>)
Any ideas? How do I get and apply stereotypes when they are contained in a package defined in a SysML profile?
Thank you in advance for your time!
Powered by FUDForum
. Page generated in 0.01503 seconds