Hi everyone,
I've been using the automation interface to export data from Excel to EA for a week. I'm confortable using it, but I'm stucked in adding programatically a package with a stereotype. That's the situation:
1-I created a profile with two stereotypes. One extends the requirement funcionalities, and the other extends the package funcionalities. Both of them have the "_metatype" property, so they appear as EA types, for example, in the relationship matrix. Both of them work perfectly if I insert them directly from EA.
2-Then, I used the following VBA code to create an Element from the stereotype desired, so I wouldn't have problems trying to change the stereotype later. It worked just fine. ElementaryProcess is my stereotype name.
Sub InsertElementaryProcess(Root As Object, Name As String, Requirement As Object)
Set Requirement = Root.Elements.AddNew(Name, "ElementaryProcess")
If Not Requirement.Update() Then
MsgBox (Requirement.GetLastError())
End If
Root.Elements.Refresh
End Sub
2-Then I tried the same concept to insert a package stereotype. The problem is that it doesn't work at all. The package is always inserted as a normal package, and the StereotypeEx property is blank.
Sub InsertPackage(Root As Object, Name As String, Package As Object)
Set Package = Root.Packages.AddNew(Name, "PackageUC")
If Not Package.Update() Then
MsgBox (Package.GetLastError())
End If
Root.Packages.Refresh
End Sub
I've been struggling with it for some time now, and I just can't make it work. I've tried the CustomCommand("Repository", "SynchProfile", "Profile=FPA;Stereotype=PackageUC") command after setting the stereotype manually, and despite the fact it returned true, it didn't work. Actually, the synch profile is not working for my stereotype PackageUC (extends package) even if i try it from the EA application... What I really want, is to insert a package with taggedvalues an fill them programatically, and I'd like to use the profile because this way I would have a standard.
Any help would be appreciated.