Book a Demo

Author Topic: Code Template Editor - Multiple Stereotypes  (Read 3477 times)

KWienkes

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Code Template Editor - Multiple Stereotypes
« on: June 30, 2009, 03:39:44 am »
Is there a way to get all the stereotypes of an element?  

For example, I have a class called Person with the following stereotypes on it.  nh_class and nh_another.  When I use the tag %classStereotype% it only returns "nh_class".  Is there a way that I can get it to tell me all the stereotypes associated with the class?

Thanks

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Template Editor - Multiple Stereotypes
« Reply #1 on: June 30, 2009, 08:23:31 am »
The only way to get multiple stereotypes currently is to call an add-in.  (EXEC_ADD_IN)

JDegler

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Code Template Editor - Multiple Stereotypes
« Reply #2 on: June 10, 2016, 12:31:16 am »
Sorry to dig up this old thread, but is calling an add-in still the only way to get all stereotypes?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Code Template Editor - Multiple Stereotypes
« Reply #3 on: June 10, 2016, 08:45:49 am »
I think version 13 adds a query hasStereotype:"stereotypeName"

This allows you to query if a specific stereotype is anywhere in the stereotype list, without any additional string processing. It will also return true if any of the stereotypes that are applied inherit from the requested stereotype.