Book a Demo

Author Topic: Primary key and Automation  (Read 4774 times)

pb.Umka

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Primary key and Automation
« on: January 24, 2007, 05:09:54 am »
How can I get information whether any column is primary key or don't through automation API?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Primary key and Automation
« Reply #1 on: January 24, 2007, 05:52:46 am »
Look for an Operation with stereotype «PK»

The parameters should be the columns in the key.
No, you can't have it!

pb.Umka

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Primary key and Automation
« Reply #2 on: January 24, 2007, 08:28:16 am »
Sorry fo stupid question. Where can I found Operation ?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Primary key and Automation
« Reply #3 on: January 24, 2007, 08:43:31 am »
While the EA UI calls them Operations, via the API they are in the Methods collection. Remember that you want the Element, not the DiagramObject, which is the thing you see on a diagram. If you've got the DiagramObject you can get a pointer to the actual element from it's ElementID property. Use this in the Repository.GetElementByID call to return the element itself.

Sorry about that.
No, you can't have it!

pb.Umka

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Primary key and Automation
« Reply #4 on: January 24, 2007, 09:01:33 am »

pb.Umka

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Primary key and Automation
« Reply #5 on: January 24, 2007, 09:15:29 am »
Sorry for my bad English ... I have one more question. How can I get column's name from that is defined on the Columns tab?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Primary key and Automation
« Reply #6 on: January 24, 2007, 02:35:27 pm »
Columns use the Attributes collection of the parent element.
No, you can't have it!