Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: thomaskilian on May 25, 2007, 04:56:20 am

Title: Tagged values and filename from packages
Post by: thomaskilian on May 25, 2007, 04:56:20 am
EA's UI strikes again. It seems like it is not possible to access tagged values from the automation. Also the filename visible in the properties seems to hide also quite good. Has anybody managed to access them somehow?
Title: Re: Tagged values and filename from packages
Post by: «Midnight» on May 25, 2007, 07:21:00 am
I've been writing tagged values without problem - I even forgot that I'd updated to the beta when I ran the application, and nothing blew up.

I've not yet tried to retrieve a tagged value from a preexisting collection though.

David
Title: Re: Tagged values and filename from packages
Post by: thomaskilian on May 25, 2007, 10:02:36 am
I get a null value. Means that I even can't call Addnew.
Title: Re: Tagged values and filename from packages
Post by: «Midnight» on May 25, 2007, 10:14:26 am
You are definitely getting different behavior than I am Thomas. I've successfully added tagged values with AddNew(), and they show up as expected in the resulting model - I'm adding tags to stereotyped elements on BPMN diagrams, although the elements themselves are not added via the BPMN metatypes.

The elements change visibly as I trigger shape scripts, and the tagged values control which shape results. Since I'm getting the expected shapes, I know the values are showing up when I add them.

Are you doing this from Perl? I'm using VB.Net (2005).

David
Title: Re: Tagged values and filename from packages
Post by: thomaskilian on May 26, 2007, 05:19:17 am
Hi David, yes it's Perl. But I talk of Packages. Elements are just fine.
Title: Re: Tagged values and filename from packages
Post by: Eve on May 27, 2007, 01:06:44 pm
The filename property is Genfile.
Title: Re: Tagged values and filename from packages
Post by: thomaskilian on May 30, 2007, 12:00:20 pm
Thanks Simon. I think I found this meanwhile by hacking around. But still - what's going on with the Tags? I can't get a hold of them. :(
Title: Re: Tagged values and filename from packages
Post by: Eve on May 30, 2007, 01:02:29 pm
I haven't had any problems with tags.  Are you just using Element tags, or some other type?
Title: Re: Tagged values and filename from packages
Post by: thomaskilian on May 30, 2007, 09:31:39 pm
I use the following construct:
$ob = $rep->GetTreeSelectedObject();
Win32:MsgBox($ob->TaggedValues);
This returns an OLE Hash for selected classes, but always null for packages.
Title: Re: Tagged values and filename from packages
Post by: «Midnight» on May 31, 2007, 01:42:03 am
Just musing here, but perhaps the tagged value is always associated with the Package's Element() property. That is, the underlying element is what carries the tag for the package.

Try assigning a known tag to a package (MyPackage, say) and enumerating the tags from MyPackage.Element. See if your assignment shows up there.

David
Title: Re: Tagged values and filename from packages
Post by: thomaskilian on May 31, 2007, 01:58:56 am
You saved my day, David!

$pk->Element->TaggedValues holds them rather than $pk->TaggedValues where I tried to look.

Thanks a lot
:)
Title: Re: Tagged values and filename from packages
Post by: «Midnight» on May 31, 2007, 02:53:25 am
Another one for our side!

At least May did not pass without a win somewhere. [Ottawa's hockey team lost another game in the Stanley Cup series, but it ain't o'er yet. Just think back to your days in the Big Smoke and write in Senators where it says Leafs.]

Now we're ready for June I guess...

David