Book a Demo

Author Topic: Automate reversal and removal of connectors  (Read 5177 times)

szucconi

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Automate reversal and removal of connectors
« on: November 03, 2005, 11:31:27 am »
Is there any simple way to reverse or remove a connector through the repository object?  If not, are there any known issuse with making these changes to the database directly?  I can access the connector I want to reverse, but I can't seem to find the proper call to reverse it.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Automate reversal and removal of connectors
« Reply #1 on: November 03, 2005, 01:42:55 pm »
Quote
Is there any simple way to reverse or remove a connector through the repository object?  If not, are there any known issuse with making these changes to the database directly?  I can access the connector I want to reverse, but I can't seem to find the proper call to reverse it.


I think you need swap the values of ClientID and SupplierID and possibly also ClientEnd and SupplierEnd. (nb I haven't tested this so make backups before you try it!)
The Sparx Team
[email protected]

szucconi

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Automate reversal and removal of connectors
« Reply #2 on: November 03, 2005, 02:25:59 pm »
I did it manualy and tested it on a test db and it seemed to work.  

I connected to the db using the connectionstring from the repository and used an sql update query to swap the source and dest members.  I copied the data from a sample connector and then did a reverse arrow and compared it with the new data to find the members that needed to be swaped.

The part that I am unsure about now is removal.  Will simple using a delete query on the connector do any damage to the rest of the project?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Automate reversal and removal of connectors
« Reply #3 on: November 03, 2005, 02:57:02 pm »
Quote
The part that I am unsure about now is removal.  Will simple using a delete query on the connector do any damage to the rest of the project?


Maybe...

Each connector will have one record in the t_connector table, but may have multiple records in the t_diagramlinks table (one for each diagram it appears on), multiple records in the t_connectortag table, and possibly other information hidden away elsewhere too.

Your best bet is in automation: get the Element at one end or the other and use the Element.Connectors.Delete() or DeleteAt() method. That will guarantee a clean deletion.

Enjoy!
The Sparx Team
[email protected]