Book a Demo

Author Topic: Stereotyped Package and Project Tree  (Read 3333 times)

William McKenzie

  • EA User
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Stereotyped Package and Project Tree
« on: July 14, 2012, 01:46:26 am »
My MDG technology contains a stereotype for a package (i.e. an extension of metaclass 'package'). I've added a couple of tagged values and an icon attribute, to give it the appearance of a special folder type.

In general, it works as expected. My special package shows up in the toolbar with the correct icon and I can create an instance by dragging it onto a diagram. The tagged values are all present. I can also right-click on the tree, apply my package stereotype to an existing package, and the icon for the package changes.  The tagged values are all present.

However, when I close and re-open the project the old package icon is displayed.  The stereotype is still applied in the database, and if I merely double-click on the package and just close the properties dialog, it re-applies the correct icon. This is very annoy, though, as the whole purpose to is make clear to the user that certain kinds of packages are special wrt our technology.

This appears to be a bug, and the behavior does not occur for any of my custom element stereotypes, just when its a package. Any possible explanations come to mind? Anyone else tried to do anything like this?

~Bill

William McKenzie

  • EA User
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: Stereotyped Package and Project Tree
« Reply #1 on: July 14, 2012, 03:26:01 am »
As a follow up, the following code, called from the EA_FileOpen method of my addin solves the problem.

Code: [Select]
       

        private void TouchPackages(EA.Collection packageCollection)
        {
            foreach(EA.Package package in packageCollection)
            {
                if(package.StereotypeEx=="CvxExternalPackage")
                {
                    package.StereotypeEx = "";
                    package.Update();
                    package.StereotypeEx = "CvxExternalPackage";
                    package.Update();
                }
                TouchPackages(package.Packages);
            }
        }


Not a horrid workaround, but still feels like a bug to me.

~Bill

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Stereotyped Package and Project Tree
« Reply #2 on: July 14, 2012, 04:16:16 am »
You should report this as a bug via the link at the bottom of this page.

q.