Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: ddiazguerra on December 27, 2012, 10:54:58 pm
-
Please, I can't create a new element using the JAVA API.
At least I need to obtain a new GUID in order to make the insert in BBDD or import CSV file.
Thanks in advance.
-
You have to add it in a collection such as
Package.Element.AddNew() or Element.Element.AddNew()
Geert
-
Thanks for you reply, but unfortunately in JAVA seem not to exist that method in Element Object.
Best regards.
-
Yes sorry, typo:
You have to add it in a collection such as
Package.Element[highlight]s[/highlight].AddNew() or Element.Element[highlight]s[/highlight].AddNew()
Geert
-
I found the answer, thanks for the clue.
org.sparx.Package paqDiego = null;
paqDiego = repositoryEA.GetModels().GetByName("Model name");
paqDiego = paqDiego.GetPackages().GetByName("package name 1"); (many times)
Collection cElements = paqDiego.GetElements();
cElements.AddNew("Element Diego", "Requirement");
Best regards