1
Suggestions and Requests / BUG: Package creation via automation and lost tagg
« on: October 11, 2006, 07:45:27 pm »
When I first created our current model I used automation to create the package hierarcy from an existing structure. Since this I have manually added packages to it as needed. Our model is stored as multiple XMI files, one for each 'leaf' package. Yesterday I noticed that when I imported some of the XMI files the tagged values did not show up in the model although they did before the export and are present in the XMI file itself. It turns out that the packages that are 'loosing' their tagged values, and stereotypes, are those that were originally created using automation. The packages created manually using the EA inteface work fine.
To test this theory I created a new EA repository and manually created a package called 'ParentPackage' and then used automation to create a package under 'ParentPackage' called 'AutomationPackage'. I manually added a stereotype and tagged value to both packages. I then exported 'ParentPackage' to XMI. When I reimported the package the stereotype and tagged value were still on 'ParentPackage' but not on 'AutomationPackage'.
The following is the element section of the XMI for the 'ParentPackage':
<element xmi:idref="EAPK_35A166BA_89DB_4474_BC31_9E4314FA79FB" xmi:type="uml:Package" name="ParentPackage" scope="public">
<model package2="EAID_35A166BA_89DB_4474_BC31_9E4314FA79FB" package="EAPK_8E34FBF0_B51E_4d93_9D9E_650622C54FA1" tpos="0" ea_localid="3" ea_eleType="package" />
<properties isSpecification="false" sType="Package" nType="0" scope="public" stereotype="parent" />
<tags>
<tag xmi:id="EAID_116EE24C_90ED_4f12_A2D5_1C4AC0ED26D6" name="Datafield" value="Parent" modelElement="EAID_35A166BA_89DB_4474_BC31_9E4314FA79FB" />
</tags>
</element>
The following is the element section of the XMI for the 'AutomationPackage':
<element xmi:idref="EAPK_F717BF88_EB0E_4603_AFCC_04034265DDA3" xmi:type="uml:Package" name="AutomationPackage" scope="public">
<model package2="EAID_BF3BE466_D217_402f_88A4_E8A6527738A6" package="EAPK_35A166BA_89DB_4474_BC31_9E4314FA79FB" tpos="0" ea_localid="4" ea_eleType="package" />
<properties isSpecification="false" sType="Package" nType="0" scope="public" stereotype="child" />
<tags>
<tag xmi:id="EAID_6BCED1EC_B89D_47b1_9115_210282206CA4" name="Datafield" value="Child" modelElement="EAID_F717BF88_EB0E_4603_AFCC_04034265DDA3" />
</tags>
</element>
For the 'ParentPackage' the GUID portion of the ID, 35A166BA_89DB_4474_BC31_9E4314FA79FB, is always the same. For 'AutomationPackage' there are two ones. Even more concerning is that the modelElement for the tagged value on 'AutomationPackage' is 'EAID_F717BF88_EB0E_4603_AFCC_04034265DDA3' which does not exist.
An extract of the C# code used to create the package is as follows:
myPack = (EA.Package)myPack.Packages.GetByName("ParentPackage");
EA.Package newPack = (EA.Package) myPack.Packages.AddNew("AutomationPackage", "Package");
newPack.Update();
Gary
To test this theory I created a new EA repository and manually created a package called 'ParentPackage' and then used automation to create a package under 'ParentPackage' called 'AutomationPackage'. I manually added a stereotype and tagged value to both packages. I then exported 'ParentPackage' to XMI. When I reimported the package the stereotype and tagged value were still on 'ParentPackage' but not on 'AutomationPackage'.
The following is the element section of the XMI for the 'ParentPackage':
<element xmi:idref="EAPK_35A166BA_89DB_4474_BC31_9E4314FA79FB" xmi:type="uml:Package" name="ParentPackage" scope="public">
<model package2="EAID_35A166BA_89DB_4474_BC31_9E4314FA79FB" package="EAPK_8E34FBF0_B51E_4d93_9D9E_650622C54FA1" tpos="0" ea_localid="3" ea_eleType="package" />
<properties isSpecification="false" sType="Package" nType="0" scope="public" stereotype="parent" />
<tags>
<tag xmi:id="EAID_116EE24C_90ED_4f12_A2D5_1C4AC0ED26D6" name="Datafield" value="Parent" modelElement="EAID_35A166BA_89DB_4474_BC31_9E4314FA79FB" />
</tags>
</element>
The following is the element section of the XMI for the 'AutomationPackage':
<element xmi:idref="EAPK_F717BF88_EB0E_4603_AFCC_04034265DDA3" xmi:type="uml:Package" name="AutomationPackage" scope="public">
<model package2="EAID_BF3BE466_D217_402f_88A4_E8A6527738A6" package="EAPK_35A166BA_89DB_4474_BC31_9E4314FA79FB" tpos="0" ea_localid="4" ea_eleType="package" />
<properties isSpecification="false" sType="Package" nType="0" scope="public" stereotype="child" />
<tags>
<tag xmi:id="EAID_6BCED1EC_B89D_47b1_9115_210282206CA4" name="Datafield" value="Child" modelElement="EAID_F717BF88_EB0E_4603_AFCC_04034265DDA3" />
</tags>
</element>
For the 'ParentPackage' the GUID portion of the ID, 35A166BA_89DB_4474_BC31_9E4314FA79FB, is always the same. For 'AutomationPackage' there are two ones. Even more concerning is that the modelElement for the tagged value on 'AutomationPackage' is 'EAID_F717BF88_EB0E_4603_AFCC_04034265DDA3' which does not exist.
An extract of the C# code used to create the package is as follows:
myPack = (EA.Package)myPack.Packages.GetByName("ParentPackage");
EA.Package newPack = (EA.Package) myPack.Packages.AddNew("AutomationPackage", "Package");
newPack.Update();
Gary