Author Topic: StereotypeEx with multiple stereotypes depends on permission?  (Read 671 times)

MichPaule

  • EA User
  • **
  • Posts: 65
  • Karma: +0/-0
    • View Profile
EA 16.1.1628 (64bit) .QEAX database

I noticed a strange behavior for users without 'Configure Stereotypes' permission.
The VBscript code sample
Code: [Select]
ele.StereotypeEx = "profile::stereotype1,profile::stereotype2"
?ele.GetLastError()
gives the error
Quote
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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: StereotypeEx with multiple stereotypes depends on permission?
« Reply #1 on: April 28, 2025, 08:46:53 am »
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.

MichPaule

  • EA User
  • **
  • Posts: 65
  • Karma: +0/-0
    • View Profile
Re: StereotypeEx with multiple stereotypes depends on permission?
« Reply #2 on: April 28, 2025, 04:43:14 pm »
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
Quote
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!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: StereotypeEx with multiple stereotypes depends on permission?
« Reply #3 on: April 28, 2025, 05:00:14 pm »
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

Personally I don't like multiple stereotypes and avoid them.
I don't feel like I've missed something.

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: StereotypeEx with multiple stereotypes depends on permission?
« Reply #4 on: April 29, 2025, 09:26:50 am »
Quote
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.

MichPaule

  • EA User
  • **
  • Posts: 65
  • Karma: +0/-0
    • View Profile
Re: StereotypeEx with multiple stereotypes depends on permission?
« Reply #5 on: April 29, 2025, 04:03:55 pm »
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
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...