Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: tjlindsay on July 03, 2017, 05:30:14 pm
-
Hi,
I've recently created an MDG file which extends the ArchiMate 3 language. I now want to update my existing elements (say capability element) within a package to my new MDG version of the capability element. I can make the update manually but this is quite time consuming to go through all elements. Does anyone know how to automate such a procedure please?
Many thanks in advance,
TJ.
-
When you create an MDG you get a toolbox containing elements within your MDG (assuming that you not define your own toolboxes). Either way, open up the toolbox containing your MDG elements (Toolbox | More Tools...)
Right-click on an element within your MDG toolbox
Select Synchronize Stereotype
You should see a dialog display
Click OK
After a while all affected elements will be displayed
Click Cancel
Repeat for all other elements in your MDG
NOTE
This action will update the Tagged Values associated with the stereotype defined within your MDG and I assume this is the update you are referring to
Phil
-
I was about to suggest the same as Phil.
When you changed an MDG you will likely not have changed each and every metatype. If so, you did something very bad. Your desire to have the change automated lets me think there's something wrong in what you are asking.
q.
-
Thanks for the suggestion. Historically I had used the vanilla 'Capability' element from the ArchiMate 3 language, creating a capability map of 15 or so capability elements. More recently I have created my own MDG which has profile, toolbox and diagrams set.
I've done as suggested and selected the toolbox, right clicked on 'Capability' and re-synchronised. This didn't work because the historical 'Capability' element is associated to the vanilla ArchiMate 3 language and not to my MDG version. I want to transition the existing elements with stereotype 'ArchiMate_Capability' to my version called 'Capability'. Once done the syncronisation steps mentioned should work.
TJ.
-
This is a transition rather than a synchronization. You need to scan all elements of the model and change its stereotype from the old to your new MDG. Once that's done you can do the synch operation as noted above. However, I would not recommend doing that stand alone automatically. This is a subtle process. I would do that metatype by metatype and checking for consistency of the model after each transition.
q.
-
Agreed querty - Are you suggesting a manual transition for each element to the new MDG element? Or can this be automated in some way, on a per stereotype basis?
TJ
-
I would go for a script that transforms a single stereotype. You would need to search all elements with an old stereotype and set this to the new stereotype. That's pretty much straight forward so you can write that in less than 30 minutes. Now after running the script the new stereotype should be synchronized and cross checked. This could be done with all your stereotypes.
Please keep in mind that altering an MDG is like changing the fundaments of a system. It can easily break your whole building. So think twice. Best have a test run with a copy of your model and see what comes out.
q.
-
There are several ways you can do bulk changes
a) use Import/Export CSV with search and replace or
b) JScript or
c) SQL.
To query the model for existing stereo types you could use some SQL in the search custom query tab.
For example
SELECT t_object.Stereotype, Count (*) as NumberOfStereotypes
FROM t_object
GROUP BY t_object.Stereotype
ORDER BY t_object.Stereotype
Search the forum for stereotype conversion code. Here is one example done in JScript
http://sparxsystems.com/forums/smf/index.php/topic,31109.msg225418.html#msg225418 (http://sparxsystems.com/forums/smf/index.php/topic,31109.msg225418.html#msg225418)
Change the code to add conversion[] array elements you want to change
...
// Conversion Array parameters are sourceObject, sourceStereotype, targetObject, targetStereotype
//Add one or more Conversion mappings here
Conversions[0] = new TypeConversion("Requirement", "", "Requirement", "extendedRequirement");
Conversions[1] = ... etc
As Qwerty say's try it out on test model first.
Hope that helps
:)