Book a Demo

Author Topic: Connector Type - change all in model  (Read 5494 times)

nwilli24

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Connector Type - change all in model
« on: January 09, 2007, 09:49:21 am »
Hello  ???

Being both newbies to UML for Deployment Diagrams and EA, we have made a mistake in our characterisation of associations (Connectors).

For each connector where the connector type is "Delegate" we need to change this to "Dependency".  As we have over 400 associations doing this manually for each connector in the model will be too time consuming so we have been looking into the automation interface without much luck.

Can anybody suggest a quicker way of doing this and/or provide a java code example that would be applicable?

Thanks v. much

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Connector Type - change all in model
« Reply #1 on: January 09, 2007, 10:31:42 am »
I don't know of a quicker way, at least not directly. I also don't program EA with Java, so am not much help there.

What about VBA? Do you have a recent copy of MS Office, or perhaps MS Word around? You could write a short add-in using the macro facility, and avoid acquiring a development environment.

Another option would be to open the EA database and directly tweak the connectors with SQL. Of course you should make a backup first.

If any of the Sparxians see this, perhaps they can provide hints or caveats. You may want to watch this thread for a bit too see if someone has useful hints.

There could be several fields or tables you'd have to update, depending on the attributes of your current and future connectors. You'll have to look at the table structures yourself.

An EAP file is just an access database with a different extension. You can open it directly in Access 97. If you use a later Access version you will probably have to perform a conversion before you can change the data. I have done this, and then successfully converted the new database back to Access 97 format. [Access will do the conversion for you, check Tools | Convert Database etc.]

David
No, you can't have it!

pirate_code

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • Bunny bunny
    • View Profile
Re: Connector Type - change all in model
« Reply #2 on: January 09, 2007, 11:26:27 am »
nwilli -

This is pretty easy, actually, I've been doing a lot with the internals of the EAP file, which is actually just an Access MDB with a different extension.  You need to open the EAP file in Access (change the name to .mdb first, then open in Access).  Make sure you open but do not convert the database, since you don't need to change the *design*, just the *contents*.

I'm using Office 2007, but the process should be similar in 2003.

Select one of the queries (creating new queries is disabled since I did not convert the DB) and enter the following SQL:

UPDATE
    t_connector
SET
    Connector_Type = 'Dependency'
WHERE
    Connector_Type = 'Delegate';

Run that sucker and it will convert all of the connectors.  Keep in mind that if you have other attributes that you need to enter for the Dependency to be legit, you'll have to take a look at the t_connector table and make sure you set all of the other relevant tags in the update statement, above.

Example: I wanted to change everything (all connectors) in my diagram to associations, nix the <<flow>> label that was entered, and make sure all the colors were the same (a medium gray):

UPDATE
    t_connector
SET
    Connector_Type = 'Association',
    Btm_Mid_Label = '',
    LineColor = 10789024;

You will note that I did not qualify this with a WHERE clause, I wanted to blast all the connectors in the whole model.

Good luck!  And don't forget to make a copy of your EAP file beforehand.  Yarrr.
« Last Edit: January 09, 2007, 11:27:31 am by pirate_code »

nwilli24

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Connector Type - change all in model
« Reply #3 on: January 09, 2007, 04:42:49 pm »
Thanks for the insight.

We see programmatic modification, direct database updates and manual GUI interaction as the potential approaches in order of preference.

As we are relatively unfamiliar with the schema our concern with direct DB manipulation is undermining data integrity so accessing an api with a method we assume is the safest (the object managing integrity one assumes).

Perhaps a supplementary question will be more useful - is direct manipulation of t_connectors as described "safe" in terms of data integrity and are there any gotchas?

Cheers

pirate_code

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • Bunny bunny
    • View Profile
Re: Connector Type - change all in model
« Reply #4 on: January 16, 2007, 08:38:20 am »
The EA database is actually pretty straightforward.  In terms of data integrity worries, I would rank the risk changing all of the connector types as a 1 out of 10, especially since you can just go ahead and change it back.  I would definitely encourage you to check out the following tables:

t_connector
 (has all of the model's connectors stored here)
t_connector_types
 (just a lookup table of the different types of connectors available in EA)
t_diagram
 (info about the diagrams in your model)
t_diagramlinks
 (specifies which connectors appear on which diagrams, but their type is only stored in t_connector)
t_diagramobjects
 (objects in each diagram)
t_object
 (all the objects in your model)

Of course, depending on which features you're using, there might be different info that would be stored in different tables.  But as far as I can see, the "Connector_Type" is only stored in the t_connector type.  Also keep in mind that EA displays different connectors with different info/labels/etc., but I did exactly this change (Information Flow to Association) and it worked like a champ.

You might as well just make a backup copy of the database, run the query to change them all, then see if it works.