Author Topic: Show tagged value of association ends  (Read 3142 times)

evdwaard

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Show tagged value of association ends
« on: January 23, 2008, 10:22:05 am »
Is it possible to show the tagged value of association ends in the diagram?
I tried to add a note, but i can't connect a note to an association end either it seams.


Thanks in advance!

thomaskilian

  • Guest
Re: Show tagged value of association ends
« Reply #1 on: January 23, 2008, 12:10:38 pm »
I guess you need to dig into Shape Scripts.

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Show tagged value of association ends
« Reply #2 on: January 24, 2008, 12:23:09 am »
Shape scripting it will have to be, but documentation is incomplete and faulty there.

I don't know how to print a tagged value defined on a role. But if you define it on the association itself, yout can print it this way:

Give your association a stereotype, e.g. "tagged" (you can define one of your own). Then give it a tagged value, e.g. "myTargetTag". In the stereotypes register of the Settings - UML dialog define a shape script for the "tagged" stereotype. In the shape script editor, enter something like

Code: [Select]

label righttoplabel
{

println("#target.name#");

println("myTargetTag=#TAG:myTargetTag#");
}


Then the label above the association on the target side will show not only the role name, but an additional line with the tagged value.

evdwaard

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Show tagged value of association ends
« Reply #3 on: January 24, 2008, 01:02:22 am »
Thanks thomas and frank!
I did not know that feature, that works great!

One last thing:
Is it possible to set these shape scripts on the default shapes, say without an stereotype?

Matt

  • EA User
  • **
  • Posts: 96
  • Karma: +0/-0
    • View Profile
    • Solutions Reality
Re: Show tagged value of association ends
« Reply #4 on: January 24, 2008, 04:41:31 pm »
Unfortunately you can't run a shapescript without a stereotype...

...that bit is in the manual...  ;D

Quote
Can I apply a Shapescript without using Stereotypes?

No.
(from the EA manual!)

evdwaard

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Show tagged value of association ends
« Reply #5 on: January 25, 2008, 12:10:12 am »
Ok thanks Matt!
I'll read in the manual next time. ::)