Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: R Glenn Walker on February 26, 2025, 08:54:58 am
-
I am trying out building my own MDG Technology in EA 17 and I love the Save Package as MDG Technology, in concept. I started with one of the TEA accelerators and did a few tweaks. I can load it fine using the "Import Package as MDG Technology" option from the Publish Technology action on Specialize ribbon. It works fine. Now I exported the technology using the "Save Package as MDG Technology" option and got an XML file.
When I go to import the technology, I get a message saying that this version of EA only supports an ID of 12 characters or less. When I look at the technology file, it uses the package name as the ID and the name for the technology. My question would be is there a way for me to provide a shorter ID as meta data that will be used when saving the package as a technology file? I checked the documentation, but this seems not to be covered at all. Lots of info on the manual way of exporting profiles and creating an MDG.
I know I can cheat and shorten the package name but it would be nice to keep the descriptive name for the technology and have a shorter id value.
I opened the XML file and manually changed the ID and was able to import successfully but would prefer not to have to do this manually each time. Is there an undocumented feature that I can add a piece of meta data to the MDG package to indicate the ID. I tried using the alias field, but that did nothing.
Any solutions would be appreciated.
-
If you do it the "old fashioned" way (save UML profile and then generate MDG technology) then you can enter the ID in the dialog.
Not sure if there's a way to do that with the new "save package as MDG technology".
Have you tried setting an alias on the package?
Geert
-
Yes. I tried that and also tried adding a tagged value named Id to see if that would work. But no joy.
Doing it the old-fashioned way is tedious when you have this new slick way. It requires
Ultimately, I cheated and edited the XML file to change the Id. But it seems weird that I can import the package as an MDG with no issue. Seems inconsistent.
-
It's a lot less tedious if you script it
But I agree there should be a better way to define the ID for your MDG. You can send in a feature request.
The script I use looks like this:
'[path=\Framework\Tools\UML Profile]
'[group=UML Profile]
option explicit
!INC Local Scripts.EAConstants-VBScript
!INC Wrappers.Include
'
' Script Name: Generate UML profiles
' Author: Geert Bellekens
' Purpose: Generate the JSON UML profile and MDG technology
' Date: 2025-01-24
'
const outPutName = "Generate JSON Modelling MDG"
sub main
'create output tab
Repository.CreateOutputTab outPutName
Repository.ClearOutput outPutName
Repository.EnsureOutputVisible outPutName
'set timestamp
Repository.WriteOutput outPutName, now() & " Starting " & outPutName , 0
'do the actual work
'UML profile
Repository.WriteOutput outPutName, now() & " Generating UML profile", 0
Repository.SavePackageAsUMLProfile "{AB7625DC-1E9E-4f3e-A847-E7FD1431EF5C}", ""
'diagram profile
Repository.WriteOutput outPutName, now() & " Generating diagram profile", 0
Repository.SavePackageAsUMLProfile "{867299E8-B050-4e56-BB0C-96CB0F5F2383}", ""
'SAP toolbox profile
Repository.WriteOutput outPutName, now() & " Generating toolbox profiles", 0
Repository.SaveDiagramAsUMLProfile "{F44ABF85-64AB-4552-97B8-B37BDC515523}", ""
'MDG file
Repository.WriteOutput outPutName, now() & " Generating MDG file", 0
Repository.GenerateMDGTechnology "C:\Users\geert\Documents\GitHub\Enterprise-Architect-Toolpack\EAJSON\Files\JSON MDG.mts"
'set timestamp
Repository.WriteOutput outPutName, now() & " Finished " & outPutName , 0
end sub
main
Geert