Author Topic: Report only features that are visible on diagram  (Read 4144 times)

shimon

  • EA User
  • **
  • Posts: 133
  • Karma: +5/-0
    • View Profile
Report only features that are visible on diagram
« on: January 04, 2024, 06:16:28 pm »
Hi,
I would like to create a document of a Subsystem and include specific features (attributes and operations) from other Subsystems.

Is there an easy way to drag a Class onto a diagram, choose which properties are visible in this diagram, and produce a detailed report on these visible elements?

If there is no easy way, how can I use a SQL query and take into consideration the current diagram or Package ( as a parameter, I guess??) ?

Sincerely,
Shimon

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13295
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Report only features that are visible on diagram
« Reply #1 on: January 04, 2024, 07:51:32 pm »
There is no easy way.

It is possible with an SQL fragment, but not trivial.

Fragments can use objectID or PackageID as parameter.

Geert

Jan van Duuren

  • EA Novice
  • *
  • Posts: 12
  • Karma: +1/-0
    • View Profile
Re: Report only features that are visible on diagram
« Reply #2 on: January 05, 2024, 01:25:53 am »
You could create a script for that. Generating a document by script provides a huge flexibility.
Below I provided a small script, which documents a single element by (ElementID).
It uses a template with name "Test_Element". So you need to create a template under "Resources -> Document Publishing -> Custom Templates".
In the template you can select for example section "Element", "Attribute" and "Method".

Code: [Select]
!INC Local Scripts.EAConstants-JScript

/*
 * Script Name:
 * Author:
 * Purpose:
 * Date:
 */
 
function main()
{
docGenerator = Repository.CreateDocumentGenerator();
if (docGenerator.NewDocument("")) {
docGenerator.DocumentElement(188685, 0, "Test_Element");
docGenerator.SaveDocument("C:\\Temp\\Test_Element.docx", dtDOCX);
}
}

main();
EA scripting since 2013 (JScript and Javascript)

Arun8006

  • EA Novice
  • *
  • Posts: 8
  • Karma: +1/-0
    • View Profile
Re: Report only features that are visible on diagram
« Reply #3 on: January 10, 2024, 03:58:30 pm »
You can write a macro in excel to read the class and its various properties from the diagram that is open (Active diagram) or open the desired diagram and loop through the classes / objects within the diagram to capture the information in excel spreadsheet. Let me know if that is what you are looking for and I can share the code snippet.

Regards,
Arun

shimon

  • EA User
  • **
  • Posts: 133
  • Karma: +5/-0
    • View Profile
Re: Report only features that are visible on diagram
« Reply #4 on: February 01, 2024, 05:53:56 pm »
Thanks, Jan. I will try this to see how it works.

shimon

  • EA User
  • **
  • Posts: 133
  • Karma: +5/-0
    • View Profile
Re: Report only features that are visible on diagram
« Reply #5 on: February 01, 2024, 05:54:16 pm »
Arun,
I am indeed interested to see how this functionality works.
Sincerely,
Shimon