Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Knut Jetlund on July 17, 2014, 05:57:19 pm
-
I want to create a fresh working copy of a package by importing it's version controlled xmi file, and stripping GUIDs. I would also like to get rid of the diagrams.
My code looks like this:
ePIF.ImportPackageXMI(pkNVDBSOSI.PackageGUID, xmiFile, 0, 1)
This works just fine, except that the diagrams get imported too, even though the parameter "ImportDiagrams" (long) is set to 0, to specify that i do not want to import the diagrams. The possible values for this parameter is not described in the EA help file, but the equivalent parameter "DiagramXML" for ExportPacageXMI has 0 for "Do not export diagrams". Is there some other value than 0 that means "false"?
-
Three steps - one mandatory and two alternatives. 1) Report a bug. 2a) Write a XLST to clean the XMI. 2b) Run a script to remove the diagrams after import.
q.
-
Thanks. I have reported it as a bug, even though I'm not sure it is. It might also be that I am using the wrong number for setting "ImportDiagrams" to false. That's why I put it up here.
And I do have a script for removing the diagrams after import, but this should not be necessary if ImportPackageXMI work as intended.
-
Knut,
ImportPackageXMI(ID,...) seems to import at model level (when ID is model ID). I don't see how it can import a complete XMI, i.e. build an EA repository (*.EAP) from an XMI file. You seem to do that here if I understand you correctly. What's the trick?
Thanks,
Arjan
-
Hi Arjan
No, I don't build a EA Repository. I am importing the XMI file into an existing repository, but as a new package with new GIUDs and without version control.
Sorry for the confusion. :)
-
Thanks. I have reported it as a bug, even though I'm not sure it is.
It is certainly a bug. Hopefully, will be fixed soon.