I am using enterprise architect version 15 and I have created one file based project with .eapx file Extension. I am trying to create and update new package via API(using C# language) in enterprise architect with following hierarchy: Root Model/Package/New Package and while
Updating the package I am getting following pop of
underlying model has been changed, which freezes my enterprise architect to respond to any further API calls
Following is the order of execution(Here every step is an separate function which passes the newPackage that is created):
1. First create a package with name 'Demo'Package newPackage = package.Packages.AddNew(EAConstants.OH_CREATE_TEMPLATE, "Package");
newPackage.Update();
2. Set the system field values.
Package package = (Package)newPackage;
package.Element.Status = "Approved"
package.Element.Stereotype = <Some Stereotype Value>;
package.Element.Update();
package.Update();
3. Set tagged values
Package pc = (Package)newPackage;
Element element = pc.Element;
set tag values for element
element.TaggedValues.Refresh();
element.Update();
4. Update name of the new package
Package changePackage = (Package)newPackage
changePackage.Name = "NewName"
changePackage.Update();
5. Refresh package
Package package = (Package)newPackage
newPackage.Element.Refresh();
newPackage.Update();
Tried things:- Tried to refresh all the models after each update step.
- Tried to refresh all the model before each update step.
Expectations: Avoid the pop-up displaying warning message, because it freezes my enterprise application for any further API calls(More suitable approach: avoid using suppress dialog box method for package).