Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: MichPaule on April 23, 2025, 06:19:41 pm
-
EA 16.1.1628 (64bit) .QEAX database
I noticed a strange behavior for users without 'Configure Stereotypes' permission.
The VBscript code sample
ele.StereotypeEx = "profile::stereotype1,profile::stereotype2"
?ele.GetLastError()
gives the error
You have not been granted permission to 'Configure new Stereotypes'.
Please contact your model administrator.
Adding only one of both is working and adding both stereotypes manually also is working fine!
What does the (missing) permission have to do with assigning multiple stereotypes to elements or operations?
IMHO this is a bug or do I miss something here?
Thanks for your opinions!
Best regards
Michael
-
StereotypeEx doesn't support assigning multiple stereotypes. Because it doesn't find a single stereotype matching what your code specifies it's trying to define a new stereotype. You don't have permission to do that in your model.
-
StereotypeEx doesn't support assigning multiple stereotypes.
Really?
Then I mis-read all the docs like:
https://sparxsystems.com/enterprise_architect_user_guide/17.0/add-ins___scripting/element2.html (https://sparxsystems.com/enterprise_architect_user_guide/17.0/add-ins___scripting/element2.html)
FQStereotype The fully-qualified stereotype name in the format "Profile::Stereotype". One or more fully-qualified stereotype names can be assigned to StereotypeEx.
Because it doesn't find a single stereotype matching what your code specifies it's trying to define a new stereotype. You don't have permission to do that in your model.
But with the permission the assignment of both stereotypes succeeds!
It doesn't define a new stereotype.
So, what is the correct approach to assign multiple stereotypes?
TIA!
-
If it looks like a bug, and quacks like a bug...
I would report it as a bug: https://sparxsystems.com/support/forms/bug_report.html (https://sparxsystems.com/support/forms/bug_report.html)
Personally I don't like multiple stereotypes and avoid them.
I don't feel like I've missed something.
Geert
-
FQStereotype The fully-qualified stereotype name in the format "Profile::Stereotype". One or more fully-qualified stereotype names can be assigned to StereotypeEx.
Then I'm happy to be proven wrong and there has been further development in this area that I haven't remembered.
If it's working when you have that permission then it sounds like it may be a bug.
-
If it looks like a bug, and quacks like a bug...
I would report it as a bug: https://sparxsystems.com/support/forms/bug_report.html (https://sparxsystems.com/support/forms/bug_report.html)
Ok, will do that!
Personally I don't like multiple stereotypes and avoid them.
I don't feel like I've missed something.
Lucky you 8)
I'll have to deal with up to 3 stereotypes on one element :'(
Grown over years...