Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Pegasus on January 07, 2017, 02:08:04 am
-
Hello,
I don't understand API for modifiy (update) tagged values. (EA 13)
What I want is to update existiing Tagged Values if content changed see part of my code (part of function call)...
Collection<org.sparx.TaggedValue> elemTaVs = eaElem.GetTaggedValues(); // what means read only`?
...
tv_ptcModifDate = elemTaVs.GetByName( eaPtcFNameModifDate ); // returns null if not found
tv_ptcModifDate.SetValue( "new Date" );
if (tv_ptcModifDate.Update()) {
updateCount++;
}
but new value isn't set in Modell (seen by Wizard in Model)
Thanks for support
Pegasus
-
Might be that you have duplicate TVs. I recommend to not use GetByName or to use your own version of that. You will not get defined results if you have duplicate names. Go set the "Show Duplicate Tags" with the options button in the TV window.
q.
-
Hello
I found "problem". It was part of setValue-parameter. In real code "new Date" ist result of an other api call (Java API of PTCIntegrity) and this seems not to be well done by me. If I assing result to String variable first and call SetValute (strVal) afterwards, all is fine.