Author Topic: Synchronization of Stereotypes  (Read 691 times)

Aditya

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Synchronization of Stereotypes
« on: July 04, 2012, 12:52:10 am »
Hi All,

I am new to EA and I am using version 9.1.

I am doing two things
1) Importing data model of type .xmi into EA
2) I am also extending MDG technologies to provide me UML profiles.

The descrepancy occurs as some stereotypes in .xmi doesn't get updated in accordance to the actual data model. For eg - Some tagged values of a structure data type doesn't get updated in the model imported in EA. I get around this problem by manually editing the properties of that structure data type and then manually synchronizing the stereotype.
Now I have to do this for a lot of stereotypes. I want to find a way whereby I can do synchronization of all the stereotypes in one go in EA, so that they match with the actual data model.

Any suggestion would be welcomed, I am an intern and this is all new for me, so pardon me if something is not clear.  Thank You

Regards,
Aditya

qwerty

  • EA Guru
  • *****
  • Posts: 8964
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Synchronization of Stereotypes
« Reply #1 on: July 04, 2012, 01:58:38 am »
There's a recent thread in the automation board. Search (button top left) for "tag sync" which should give you the relevant thread. IOW you can do what you want via automation.

q.

[edit:] I found the thread: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1341263173 but it's obviously not at a solution
« Last Edit: July 04, 2012, 02:12:00 am by qwerty »

Aditya

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Synchronization of Stereotypes
« Reply #2 on: July 06, 2012, 02:22:59 am »
Hi,
Thank You for the reply.
When I use method SyncTaggedValues it gives error
"Undefined is Null or not an object"
On importing MDG technology the profile name is SMM_Profile. But I am not sure, where can one look the profile name from ?

qwerty

  • EA Guru
  • *****
  • Posts: 8964
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Synchronization of Stereotypes
« Reply #3 on: July 06, 2012, 08:50:29 pm »
Open the MDG with a text editor. In the second line you'll find the id of the profile.

q.

Aditya

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Synchronization of Stereotypes
« Reply #4 on: July 07, 2012, 01:18:41 am »
The MDG tech that I imported has  name SMM_Profile and that is what is showing in the Toolbox. I created a diagram in the Digram Box in EA from SMM_Profile of type Enumeration and named enum.
So could you please tell me how to use SynchTaggedValues method.
I am doing
var test as EA.Element
test.SynchTaggedValues(SMM_Profile,enum);
its giving me that same null object error. What to do ? please help !

qwerty

  • EA Guru
  • *****
  • Posts: 8964
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Synchronization of Stereotypes
« Reply #5 on: July 07, 2012, 01:31:22 am »
As written in the other thread I pointed out above it seems there are some issues with this function.

q.

Aditya

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Synchronization of Stereotypes
« Reply #6 on: July 07, 2012, 04:56:42 am »
:o :(

Is there any other way, this can be done ?
I read somewhere that all stereotypes can be sychronized at once by using SQL update query in a script. Any idea as to how I can go about it ?

Thank you so much for your time and replies.

qwerty

  • EA Guru
  • *****
  • Posts: 8964
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Synchronization of Stereotypes
« Reply #7 on: July 07, 2012, 07:54:53 am »
Basically (I mean very basically) EA assign a stereotype to an element by creating an entry in the marvelous t_xref table. This is done via
Code: [Select]
@STEREO;Name=<stereo>;FQName=<profile id>::<meta type>;@ENDSTEREO;setting in the description column. It's a bit work to supply all values. I might add a chapter in my Inside book to explain this aspect of t_xref.

q.
« Last Edit: July 07, 2012, 07:55:37 am by qwerty »

Aditya

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Synchronization of Stereotypes
« Reply #8 on: July 10, 2012, 02:17:10 am »
Thank You !
I did the SynchTaggedValues :)
Now,I need to parse all Stereotypes within a profile and get their names, Any ideas how I may I be able to do that ?

qwerty

  • EA Guru
  • *****
  • Posts: 8964
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Synchronization of Stereotypes
« Reply #9 on: July 10, 2012, 02:42:22 am »
You need an XML parser. EA does not offer any API to explore the MDG content. The MDG itself is structured in a simple way so you should be able to help yourself. However, if you got problems with details just ask.

q.

Aditya

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Synchronization of Stereotypes
« Reply #10 on: July 10, 2012, 03:06:15 am »
Look what I am doing now in my code

Repository.SynchProfile("SMM_Profile","Applications");
Repository.SynchProfile("SMM_Profile","DataTypes");
Repository.SynchProfile("SMM_Profile","Services");
Repository.SynchProfile("SMM_Profile","Domain");

If somehow I could get stereotypes from the SMM_Profile, I would need to use a single loop instead of repeating each line of code.
But from what you are saying getting stereotypes from MDG is not possible in EA.

Then is there any other way ?

qwerty

  • EA Guru
  • *****
  • Posts: 8964
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Synchronization of Stereotypes
« Reply #11 on: July 10, 2012, 06:20:30 am »
As I said: you need to parse the MDG file directly with an XML parser. The relevant entries are near
Code: [Select]
MDG.Technology/UMLProfiles/UMLProfile(id)/Content/Stereotypes
q.