Book a Demo

Author Topic: exporting Find in diagrams, element usage window  (Read 5749 times)

PHS

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
exporting Find in diagrams, element usage window
« on: April 08, 2015, 06:58:48 pm »
Is there a possibility to export results of "find in diagrams.." function? It presents list of diagrams in Element Usage window, and I need to copy&paste the results.

Regards,
Piotr

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: exporting Find in diagrams, element usage wind
« Reply #1 on: April 08, 2015, 08:34:58 pm »
Not directly. You can likely create a SQL to find usage in diagrams (at least with an add-in search). Those search results can be copy/pasted. I think the easiest way is to write a script that takes the currently selected element and puts the results on the pasteboard directly.

q.

PHS

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: exporting Find in diagrams, element usage wind
« Reply #2 on: April 08, 2015, 08:40:33 pm »
This is the idea, I thought about too. Does anyone have such script ready, and is able to share it?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: exporting Find in diagrams, element usage wind
« Reply #3 on: April 08, 2015, 10:32:24 pm »
Basically you need to use a query like
Code: [Select]
Repository.SQLQuery("SELECT Diagram_ID  FROM  t_diagramobjects WHERE Object_ID = <id>")where <id> is the element id of your element. Now you just need to find the info for the ids of the returned diagrams.

q.
« Last Edit: April 08, 2015, 10:33:44 pm by qwerty »

PHS

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: exporting Find in diagrams, element usage wind
« Reply #4 on: April 09, 2015, 01:03:46 am »
Simple query to list sequence diagrams with particular component

Code: [Select]
select t_diagramobjects.Diagram_ID AS CLASSGUID, t_diagram.Diagram_Type AS CLASSTYPE, t_diagram.Name FROM t_object
LEFT JOIN t_diagramobjects
ON t_object.Object_ID=t_diagramobjects.Object_ID
LEFT JOIN t_diagram
ON t_diagramobjects.Diagram_ID=t_diagram.Diagram_ID
WHERE t_object.Object_Type = "Component" AND t_object.Name = "Component Name" AND t_diagram.Diagram_Type="Sequence"
ORDER BY t_diagram.Name;

Is it possible to make result list clickable ?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: exporting Find in diagrams, element usage wind
« Reply #5 on: April 09, 2015, 02:02:41 am »
In that form it should be :-/

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: exporting Find in diagrams, element usage wind
« Reply #6 on: April 09, 2015, 10:11:14 am »
Quote
select t_diagramobjects.Diagram_ID AS CLASSGUID, ...

t_diagramobjects.Diagram_ID doesn't hold a GUID. You probably need t_object.ea_guid or t_diagram.ea_guid instead.
« Last Edit: April 09, 2015, 10:12:11 am by KP »
The Sparx Team
[email protected]

PHS

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: exporting Find in diagrams, element usage wind
« Reply #7 on: April 15, 2015, 09:08:23 pm »
Changing t_diagramobjects.Diagram_ID to t_diagram.ea_guid solved the problem. Thanks ! :)