Book a Demo

Author Topic: Mind Map search for composite drawing links  (Read 4112 times)

Mark G

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Mind Map search for composite drawing links
« on: August 14, 2014, 03:29:04 am »
I use the mind map to cover a project as it develops. I create a lot of drawings for conceptual ideas.

Is there a way I can see if I have a drawing that is not covered by a composite link? The idea is the mind map is my knowledge view and the top level. I want to see what drawings are "old fud". The "Find in drawings" doesn't work. I'm sure there is some query I can do.

Thanks :o)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Mind Map search for composite drawing links
« Reply #1 on: August 14, 2014, 03:52:15 am »
Actually I don't understand what you mean by " not covered by a composite link". Can you explain that a bit (e.g. by using an example).

q.

Mark G

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Mind Map search for composite drawing links
« Reply #2 on: August 14, 2014, 04:29:59 am »
Quote
Actually I don't understand what you mean by " not covered by a composite link". Can you explain that a bit (e.g. by using an example).

q.

So in EA one way to link a drawing to a node element is add it as a composite drawing (right click element in drawing/New Child Diagram/Select Composite Diagram). Left-Clicking on the node now will bring up the other drawing.

What I'm trying to understand is what drawings in the project are out there that are not referenced in this way by some other drawing.

Does that help?
« Last Edit: August 14, 2014, 04:32:18 am by mgrandau »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Mind Map search for composite drawing links
« Reply #3 on: August 14, 2014, 06:02:19 am »
So you want to find all element which are not composite. You can do that by defining a search like this:
Code: [Select]
SELECT o.ea_guid AS CLASSGUID, o.Object_Type As CLASSTYPE, o.Name
FROM t_object o WHERE o.NType = 0 AND o.object_Type = "Class"
Only the composite elements have NType = 8.

See also this thread for caveats: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1407921213

q.
« Last Edit: August 14, 2014, 06:11:10 am by qwerty »

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Mind Map search for composite drawing links
« Reply #4 on: August 14, 2014, 06:53:30 am »
Here is an extract of some C# code that uses SQL

Given a diagram guid, return the number of composite elements that link to this diagram.

There are two queries since Composite Activity elements are a special case, go figure

Please adapt this (or extract the SQL) for your own purposes

[highlight]// We have to run two separate queries here, since Composite Activity elements are
            // a special case!

            // Keep the diagram GUI and diagram ID
            string diagramGUID = contextDiagram.DiagramGUID;
            int diagramID = contextDiagram.DiagramID;

            string sqlQuery1 = "SELECT COUNT(*) as [Composites] " +
                               "FROM t_object, t_xref " +
                               "WHERE t_xref.Supplier = '" + diagramGUID + "' " +
                               "AND t_object.ea_guid = t_xref.Client " +
                               "AND t_object.NType = '8'";

            string sqlQuery2 = "SELECT COUNT(*) as [Composites] " +
                               "FROM t_object " +
                               "WHERE t_object.PDATA1 = " + diagramID.ToString() + " " +
                               "AND t_object.NType = '8'";

[/highlight]
Cheers

Phil
Models are great!
Correct models are even greater!