Book a Demo

Author Topic: How can I know the original type of a diagram  (Read 16095 times)

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
How can I know the original type of a diagram
« on: February 19, 2015, 02:37:02 pm »
How can I know the original type of a diagram like if it is: Structural or Behavioral type, by diagram GUID or ID or Type?

Thanks

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: How can I know the original type of a diagram
« Reply #1 on: February 19, 2015, 03:14:27 pm »


Source: Wikipedia
« Last Edit: February 19, 2015, 03:15:40 pm by KP »
The Sparx Team
[email protected]

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: How can I know the original type of a diagram
« Reply #2 on: February 20, 2015, 03:54:42 am »
but how can i know the original type using guid-of-diagram. Api/ sql in EA

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How can I know the original type of a diagram
« Reply #3 on: February 20, 2015, 06:46:13 am »
Check the type and use the diagram above to deduce it.

q.

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: How can I know the original type of a diagram
« Reply #4 on: February 20, 2015, 07:03:12 am »
OK, so you mean there is no query or API to do that in EA ?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How can I know the original type of a diagram
« Reply #5 on: February 20, 2015, 07:27:29 am »
Exactly. But getting the type and using a table will do, I guess.

q.

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: How can I know the original type of a diagram
« Reply #6 on: February 20, 2015, 07:45:21 am »
OK, I will do a virtual Table, C# (DataTable) or even HashTable to do 2 columns one for PK (diagram-type)  Value(Org-Type)

This was  my last solution, because I could not find EA-API for that.

Thank you for your help.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How can I know the original type of a diagram
« Reply #7 on: February 20, 2015, 06:50:52 pm »
There's only thirteen different diagram types.
Why make life more complicated then it needs to.
A simple switch case would suffice.
Something like the code below.

Code: [Select]
public string getDiagramTypeGroup(string diagramType)
{
  switch (diagramType)
  {
     case "ProfileDiagram":
     case "ClassDiagram":
     case "ComponentDiagram":
     case "...":
       return "StructureDiagram":
       break;
     case "SequenceDiagram":
     case "CommunicationDiagram":
     case "ActivityDiagram":
     case "...":
       return "BehaviorDiagram":
       break;    
  }
}

Geert

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: How can I know the original type of a diagram
« Reply #8 on: February 21, 2015, 01:32:52 am »
It is OK, but I just wanted to ask if there are some API for that, because in future if some new types are added then my tool should be able to deal with the dynamic changes!
Anyway, thanks a lot