Author Topic: Predefined tagged value doesn't reload  (Read 4087 times)

whitehouse

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Predefined tagged value doesn't reload
« on: February 21, 2014, 03:53:18 pm »
I created some predefined tagged value by API:
Code: [Select]
EA.PropertyType predefinedEnumTag = repository.PropertyTypes.AddNew("tag name", "Sample predefined tagged ");
predefinedEnumTag.Detail = "Type = Enum; Values = Val1,Val2; Default = Val1; BaseStereotype = ArchiMate_WorkPackage;";
predefinedEnumTag.Update();

Unlucky the new predefined tagged doesn't reload when we create a new tagged value for an ArchiMate_WorkPackage element.
It onloy works when reloading project or Open menu: Setting > UML Types.

I also try some ways to refresh but not work:
Code: [Select]
repository.PropertyTypes.Refresh();
repository.RefreshModelView(0);
repository.GetCurrentDiagram().Update();

Thank you.

Nizam Mohamed

  • EA User
  • **
  • Posts: 193
  • Karma: +1/-0
    • View Profile
Re: Predefined tagged value doesn't reload
« Reply #1 on: February 21, 2014, 04:35:43 pm »
Looks like it doesn't get refreshed until a manual reload,
I tried
Code: [Select]
     Dim proj as EA.Project
      set proj = Repository.GetProjectInterface()
      proj.ReloadProject()

Please write a note to [email protected]

whitehouse

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Predefined tagged value doesn't reload
« Reply #2 on: February 21, 2014, 05:48:16 pm »
Quote
Looks like it doesn't get refreshed until a manual reload,
I tried
Code: [Select]
     Dim proj as EA.Project
      set proj = Repository.GetProjectInterface()
      proj.ReloadProject()

Please write a note to [email protected]

Thank you Nizam, it doesn't work. I mean that it need to re-open Project (close and open .EAP) or open the UML Types one time.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Predefined tagged value doesn't reload
« Reply #3 on: February 21, 2014, 08:48:50 pm »
If you expect new tags from a profile to synch then you need to call Repository.SynchProfile

q.

mv01d

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Predefined tagged value doesn't reload
« Reply #4 on: February 24, 2014, 08:55:50 pm »
I currently have the same problem. I think this could be a bug, which should be solved. It seems that the implementation of propertyType.Update() does not update the property types correctly, which can only be solved by re-open the whole project.

There are some other issus related to property types: The repository.PropertyTypes.GetByName() method seems to be not yet implemented.

Code: [Select]
System.Runtime.InteropServices.COMException (0x80040002): Action is not supported
   bei EA.CollectionClass.GetByName(String Name)

 :-/

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Predefined tagged value doesn't reload
« Reply #5 on: February 24, 2014, 11:03:51 pm »
The GetByName is not valid since the name is not unique. So you have to iterate manually.

q.