Book a Demo

Author Topic: Number of elements contained in a requirement diag  (Read 5002 times)

paleantrop

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Number of elements contained in a requirement diag
« on: July 09, 2015, 07:06:14 pm »
Hi all,

I have different requirements diagrams containing quite a lot of elements. Is there a way to have a statistic about how many elements are in each diagram?

Thank you in advance!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Number of elements contained in a requirement
« Reply #1 on: July 09, 2015, 07:15:35 pm »
You can achieve that with a SQL search (using COUNT), a script or by showing the diagram as list and copy/paste to Excel.

q.

paleantrop

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Number of elements contained in a requirement
« Reply #2 on: July 09, 2015, 07:29:52 pm »
Thanks for your fast reply. I appreciated.

The first think I did was to switch to "List View" and copy to Excel. This step has to be done for each diagram.
I will have a look at SQL search to check if I can find a way to count the number for all at once.

paleantrop

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Number of elements contained in a requirement
« Reply #3 on: July 09, 2015, 10:34:16 pm »
Could you, please, give a small example searching using SQL in a requirements diagram?

Thank you in advance.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Number of elements contained in a requirement
« Reply #4 on: July 10, 2015, 04:27:09 am »
For example
Code: [Select]
select count(*) from t_object, t_diagramobjects, t_diagram where t_diagramobjects.Object_ID = t_object.Object_ID and t_diagram.Diagram_ID = t_diagramobjects.Diagram_ID and t_diagram.Name = "Package2"
returns the number of elements shown on the diagram(s) named "Package2". Of course you would use the diagram guid to get the right diagram. And you would limit the elements (t_object) by type and/or stereotype.

I'd recommend to use a little script to construct/process the query. Use Repository.SQLQuery ("SELECT ...")

q.
« Last Edit: July 10, 2015, 04:28:24 am by qwerty »

paleantrop

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Number of elements contained in a requirement
« Reply #5 on: July 10, 2015, 06:09:03 pm »
Thanks! it worked.

Now I noticed that I have same diagram name in different packages. So, I   tried to count the req. from a specific package. The structure looks like this:

--Package1
----Sub-package1
------ReqDiagram

--Package2
----Sub-package2
------ReqDiagram

I added a "t_package" and tried to join, but it doesn't work:
Code: [Select]
select count(*) from t_object, t_diagramobjects, t_diagram, t_package where t_diagramobjects.Object_ID = t_object.Object_ID and t_diagram.Diagram_ID = t_diagramobjects.Diagram_ID and t_package.Package_ID= t_diagram.Package_ID and t_diagram.Name = 'ReqDiagram' and t_object.Object_Type='Requirement' and t_package.Name='Package2'

Any suggestion will be welcomed.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Number of elements contained in a requirement
« Reply #6 on: July 10, 2015, 09:03:59 pm »
Better use the diagram guid. You can retrieve that via context menu: Copy References/...GUID... and use that via t_diagramobject.ea_guid

q.
« Last Edit: July 10, 2015, 09:05:17 pm by qwerty »

paleantrop

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Number of elements contained in a requirement
« Reply #7 on: July 10, 2015, 10:04:51 pm »
Thanks again. It works. I think it is the best solution.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Number of elements contained in a requirement
« Reply #8 on: July 11, 2015, 12:52:21 am »
You might want to look into scripting later. This would e.g. allow to run the query for the currently open diagram.

q.

paleantrop

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Number of elements contained in a requirement
« Reply #9 on: July 11, 2015, 01:04:48 am »
Yes, this is want I would like to learn next. For my current tasks I need to developed some scripts in order to get statistics for different packages/diagrams.