Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Eve on July 11, 2007, 12:59:01 pm

Title: Re: How to create new Tagged Values?
Post by: Eve on July 11, 2007, 12:59:01 pm
Your code works just fine for me.
Title: Re: How to create new Tagged Values?
Post by: chrvi on July 12, 2007, 06:47:12 am
Oh, I wanted to remove this whole topic (since it was my mistake the code didn't work for me), nevertheless only my original problem text was removed...

So I place it here once again (please note that the code is correct and I was only a stupid user when posting the problem ;-):


Hi,

I'm trying to add new tagged values via automation interface using Java but it seems not to work. Could you please give me a hint?

my code:

Collection<TaggedValue> taggedValues = aElement.GetTaggedValues();
TaggedValue newTaggedValue = taggedValues.AddNew(aNewTaggedValueNameString, "something");
newTaggedValue.SetValue(aValueString);
newTaggedValue.SetNotes(aNotesString);
newTaggedValue.Update();
taggedValues.Refresh();

I fill the newTaggedValue object (a new object in aElement's tagged values collection) with the correct data but in EA I can't see anything in the aElement's tagged values.

Anyway, is there a way to process (read, modify, create) Tagged Value Types? I'd like to add some new via automation but can't find a way to access them.

Thanks in advance for any hint.
Title: Re: How to create new Tagged Values?
Post by: thomaskilian on July 13, 2007, 01:29:38 am
Never mind - were all stupid sometimes  ;)

It's fine to leave the correct solution here to help others later - when they were stupid.