Book a Demo

Author Topic: createing profiled packages via add-in  (Read 3498 times)

trickster60

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
createing profiled packages via add-in
« on: February 28, 2013, 01:14:37 pm »
Hi,

I am having trouble creating a a package profile I have defined through an add. In the packages.AddNew(...) method. In the type parameter I have tried a couple of things including the metatype name I defined in the profile but I keep getting a generic package being created. Any ideas?

Thanks in advance

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: createing profiled packages via add-in
« Reply #1 on: February 28, 2013, 08:02:29 pm »
It seems that in order to set the stereotype of a package you need to:
Code: [Select]
p = Package.Addnew ("name", "");
p.Update;
p.Element.Stereotype = "profile";
p.Update;(
EA does not set the stereotype from p.Stereotype. It's a r/o value :-/

q.

trickster60

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: createing profiled packages via add-in
« Reply #2 on: March 01, 2013, 09:27:30 am »
of course!!! why didnt I think of that.  :o

Thanks

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: createing profiled packages via add-in
« Reply #3 on: March 01, 2013, 08:28:56 pm »
I didn't think of that myself, despite the fact that I work with EA since 2003 (IIRC). As I wrote in my Scripting book packages are a sort of Dr. Jekyll and Mr. Hyde. Some of the attributes in the package and the related element are mirrored so you can write/change them in both. But others (like the stereotype) can only be altered in the element part. Especially when creating a package one would expect to be able to change the stereotype in the package element. Nada! I'd call this a bug, but OTOH it's EAUI. So we live with that...

q.