Book a Demo

Author Topic: Where is the class stereotype?  (Read 10462 times)

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Where is the class stereotype?
« on: January 26, 2016, 12:55:11 am »
Where is the class stereotype? Is there a class stereotype? I am just looking at a list of elements in EA with a blank stereotype when I would have expected the stereotype to be class.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Where is the class stereotype?
« Reply #1 on: January 26, 2016, 01:26:02 am »
There shouldn't be.
"Class" is a metatype, so defining a stereotype with the same name would be redundant.

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Where is the class stereotype?
« Reply #2 on: January 26, 2016, 02:14:10 am »
I suspected this was the answer. Let me ask the question in a different way, if I want to write a query to get into a ModelView the list of evert element that is a class -  i.e., has a blank stereotype - how do I write my WHERE clause below

SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, t_object.Name, t_object.Status, t_object.Stereotype, t_object.Author
FROM t_object  ORDER BY t_object.Name
WHERE .......

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Where is the class stereotype?
« Reply #3 on: January 26, 2016, 02:37:38 am »
Stereotype IS NULL or Stereotype = ""

I guess.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Where is the class stereotype?
« Reply #4 on: January 26, 2016, 02:54:53 am »
Stereotype IS NULL or Stereotype = ""

I guess.

q.

And if you only want Classes and not other element types you use
Code: [Select]
WHERE (Stereotype IS NULL OR Stereotype = '')
AND Type = 'Class'
ORDER BY...

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Where is the class stereotype?
« Reply #5 on: January 26, 2016, 03:09:50 am »
Quote from: Geert Bellekens link=topic=30190.msg220588#msg220588 date=1453737293

And if you only want Classes and not other element types you use
[code
WHERE (Stereotype IS NULL OR Stereotype = '')
AND Type = 'Class'
ORDER BY...[/code]

Geert
This what I am looking for but the query returns duplicates, just looking into why this the case.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Where is the class stereotype?
« Reply #6 on: January 26, 2016, 03:51:10 am »
To eliminate the duplicates I would need to add to the WHERE clause a condition that filters the current package. There are multiple packages in the project containing different baselines and the query should be specific to each baseline and not global.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Where is the class stereotype?
« Reply #7 on: January 26, 2016, 05:03:11 am »
In the model search you can use
Code: [Select]
and packageID = #Package#to select elements form the package selected in the project browser.

In case you want to query something that is in the selected package, or one of it subpackages recursively you can use
Code: [Select]
and packageID in (#Branch#)
Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Where is the class stereotype?
« Reply #8 on: January 26, 2016, 07:54:25 pm »
In the model search you can use
Code: [Select]
and packageID = #Package#to select elements form the package selected in the project browser.

In case you want to query something that is in the selected package, or one of it subpackages recursively you can use
Code: [Select]
and packageID in (#Branch#)
Geert
Do I need to replace #Package# and #Branch# with anything? Or,  are they parameters?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Where is the class stereotype?
« Reply #9 on: January 26, 2016, 08:02:42 pm »
Those are Macros.
EA will replace the #Package# macro with the packageID and #Branch# macro with a comma separated list of all packageID's in the current branch.

See http://sparxsystems.com/enterprise_architect_user_guide/12.1/building_models/creating_filters.html for more info.

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Where is the class stereotype?
« Reply #10 on: January 26, 2016, 09:50:23 pm »
Of course nothing is that simple with EA, the following query results on an error

Code: [Select]
SELECT t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, t_object.Name, t_object.Status, t_object.Stereotype, t_object.Author FROM t_object
WHERE t_object.Package_ID = #Package# AND t_object.Object_Type = 'Class' AND Stereotype IS NULL ORDER BY t_object.Name

The error is Invalid column name '#Package#'.

P.S.: I am running version 12.0.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Where is the class stereotype?
« Reply #11 on: January 26, 2016, 10:17:05 pm »
You can not run that in the SQL pad. You need to make a new search to run the #-tags.

For test purposes you need to replace it with a valid package_id.

q.

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Where is the class stereotype?
« Reply #12 on: January 26, 2016, 10:40:57 pm »
The query is meant to go on a Model View element and not in a search. The error happens on the Model View on version 12.0.

The query runs fine as a search but I do not want it there.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Where is the class stereotype?
« Reply #13 on: January 26, 2016, 11:04:50 pm »
That's really sad ??? It works as search, but if you select the search as modelview it doesn't work anymore?

If that is the case I would consider it as a bug.

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Where is the class stereotype?
« Reply #14 on: January 27, 2016, 12:40:14 am »
I will report it as bug in 12.0, pity I cannot upgrade to 12.1, my 12 "month subscription" run out recently and no longer have access to registered users area.

See http://sparxsystems.com/forums/smf/index.php/topic,30194.0.html.
« Last Edit: January 27, 2016, 12:43:32 am by Modesto Vega »