Sparx Systems Forum

Discussion => Uml Process => Topic started by: Aditya on July 04, 2012, 12:52:10 am

Title: Synchronization of Stereotypes
Post by: Aditya 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
Title: Re: Synchronization of Stereotypes
Post by: qwerty 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
Title: Re: Synchronization of Stereotypes
Post by: Aditya 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 ?
Title: Re: Synchronization of Stereotypes
Post by: qwerty 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.
Title: Re: Synchronization of Stereotypes
Post by: Aditya 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 !
Title: Re: Synchronization of Stereotypes
Post by: qwerty 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.
Title: Re: Synchronization of Stereotypes
Post by: Aditya 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.
Title: Re: Synchronization of Stereotypes
Post by: qwerty 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.
Title: Re: Synchronization of Stereotypes
Post by: Aditya 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 ?
Title: Re: Synchronization of Stereotypes
Post by: qwerty 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.
Title: Re: Synchronization of Stereotypes
Post by: Aditya 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 ?
Title: Re: Synchronization of Stereotypes
Post by: qwerty 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.