Book a Demo

Author Topic: Show usage  (Read 10001 times)

J-Claude

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Show usage
« on: February 25, 2014, 02:31:21 am »
Hello,

I would like know where in the model, an element is used (Not in which diagram it is used).

I can see the "Find in all diagrams" menu, but in the case where I want to search where a class is used this is not enough.

For example how can I find that a class called <<type>>MoneyAmount is used as type of an attributes of some other classes or if it is aggregated by another one?

Thank you in advance for your help,

JClaude

Nizam Mohamed

  • EA User
  • **
  • Posts: 193
  • Karma: +1/-0
    • View Profile
Re: Show usage
« Reply #1 on: February 25, 2014, 02:39:07 am »
Have u tried using Model Search (Edit -> Find In Project or Ctrl + F) to find usage, You can add new search with filters or a custom sql to find the required cross dependencies.

In most cases the extended search should do, but u can define your own searches to be more specific

J-Claude

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Show usage
« Reply #2 on: February 25, 2014, 03:00:06 am »
Hello,

I would guess I would need to perform a custom sql, as the Ctrl + F searches for term and it would include more elements than a search to check the impact analysis (like before refactoring).

Thanks,

JClaude

Robert Sheridan

  • EA User
  • **
  • Posts: 105
  • Karma: +0/-0
    • View Profile
Re: Show usage
« Reply #3 on: February 25, 2014, 03:11:23 am »
I am not sure what you mean as a element should only appear once in a model.  I am assuming you are wanting to know all the other elements a particular element is associated with.

An easy way would be to use a RTF report as it can output all the classifiers and also list all the connectors to and from an element.

Nizam Mohamed

  • EA User
  • **
  • Posts: 193
  • Karma: +1/-0
    • View Profile
Re: Show usage
« Reply #4 on: February 25, 2014, 03:18:21 am »
I'd say Firstly start with exploring 'Insert Related Elements'  option to build a view (impact analysis) around any element in the model. This in most cases allows you to find most of the usage.

But if this doesn't meet your expectation, then go for a custom sql.

BtW - IMO, Attributes with types as other classes are best modeled as association connectors, in which case insert related elements will pick it up (upto 5 level deep)

J-Claude

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Show usage
« Reply #5 on: February 25, 2014, 03:18:54 am »
Thanks Robert,

I did not mention "once".

I give you an example:
Say you have 2 classes, HAWB and AWB.
If I want to search for AWB usage, I do not want it to return the usage of HAWB as the search looks for terms, but only all the occurences and only these ones where type AWB is used.

J-Claude

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Show usage
« Reply #6 on: February 25, 2014, 03:22:33 am »
Hello Nizam,

Thanks for the reply.
There are cases in design where it is best to create "Type" classes like DataRange which is imho best used as attribute type.

Kind reagrds,

JClaude

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Show usage
« Reply #7 on: February 25, 2014, 03:36:55 am »
Quote
Hello,

I would like know where in the model, an element is used (Not in which diagram it is used).

I can see the "Find in all diagrams" menu, but in the case where I want to search where a class is used this is not enough.

For example how can I find that a class called <<type>>MoneyAmount is used as type of an attributes of some other classes or if it is aggregated by another one?

Thank you in advance for your help,

JClaude
Use Ctrl-U. That will show where it is used as class and as classifier. You will not find orphaned ones. They must exist in diagrams. Having elements not shown in diagrams is anyway bad habit. So: use Find Orphans from the Search regularly and use Ctrl-U to find what you want.

q.

J-Claude

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Show usage
« Reply #8 on: February 25, 2014, 03:44:39 am »
Hello q,

Are you sure that Ctrl-U  includes classifier?
I just did the test where it is an attribute type of a class show in a diagram, and it did not return it.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Show usage
« Reply #9 on: February 25, 2014, 04:08:40 am »
Ah. No. Only when used as classifier of a class, not as type of an attribute. To achieve that you need to write some SQL search. I'm just trying to find a little example, but that M$Access has its own merits...


q.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Show usage
« Reply #10 on: February 25, 2014, 04:20:08 am »
Code: [Select]
SELECT
classifier.ea_guid AS CLASSGUID, classifier.Object_Type AS CLASSTYPE,classifier.Name AS Object, classifier.Object_Type AS [Type], t_attribute.Name, t_object.Name from t_object, t_attribute, t_object as classifier where t_object.Object_ID = t_attribute.Object_ID and val(classifier.object_id) like t_attribute.Classifier

Will list the classifiers and where they are used. You likely have to adapt it to your needs.

q.

J-Claude

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Show usage
« Reply #11 on: February 25, 2014, 04:23:39 am »
Thanks 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: Show usage
« Reply #12 on: February 25, 2014, 05:51:32 pm »
J-Claude,

The EA Navigator shows all attributes and parameters and tagged values that reference a certain classifier.

Geert

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Show usage
« Reply #13 on: February 25, 2014, 06:57:01 pm »
Hello JClaude,

showing usage of an element isn't a simple problem to solve. There are a lot of possibilities an element is used in UML / EA.

The space here isn't big enough to publish the script. If you drop me a mail I will send you the script.

The easisiest way is to call the query from a short script. Just right click on an element and you have the usage at your fingertip.


Helmut

Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

J-Claude

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Show usage
« Reply #14 on: February 25, 2014, 07:25:35 pm »
Thanks Helmut,

I just dropped you an email.
You are right they are many other ways a class can be used. Just to list a few, Paramater type of an operation, Type of an Oblect, return type, class template etc...

Kind regards,

JClaude