Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Marc on August 13, 2013, 05:22:37 pm

Title: Display selected tags on element in diagram
Post by: Marc on August 13, 2013, 05:22:37 pm
How do I display only selected tags/ attributes on an element in a diagram?

So for example, I have tagged values ID (e.g. REQ01) and Priority (e.g. M for medium) for a required called "Add Users". I would like to show elements on a diagram like this:

SEQ01 - M
Add Users
Title: Re: Display selected tags on element in diagram
Post by: qwerty on August 13, 2013, 07:18:21 pm
You will likely have to write a shape script.

q.
Title: Re: Display selected tags on element in diagram
Post by: Marc on August 13, 2013, 07:21:02 pm
How would that shape script get the data from the attributes/tags? I'm afraid I'm new to shape scripts. From what I know they only define graphics. Could you provide me a pointer to a starting point?
Title: Re: Display selected tags on element in diagram
Post by: qwerty on August 13, 2013, 07:24:03 pm
Open the help, search for "shape script", read the first entry.

q.
Title: Re: Display selected tags on element in diagram
Post by: Marc on August 13, 2013, 07:30:22 pm
Ah, I get it. Thanks!
Title: Re: Display selected tags on element in diagram
Post by: Marc on August 13, 2013, 09:11:07 pm
OK, I understand the concept of writing a shape script. I need to do that on the UML Types found under settings. However, the sterotypes listed there don't include the stereotypes from the MGD technologies (I happen to use a stereotype from TOGAF:Principle).

How would I apply my shape script on top of one of those stereotypes?
Title: Re: Display selected tags on element in diagram
Post by: qwerty on August 13, 2013, 09:18:34 pm
You could go these ways:
- Ask the copyright holder whether you may modify the MDG for local purposes (i.e. not for resale).
-- If granted you can RE the script from the MDG (I can't repeat that here since Sparx informed that it was some breach of copyright/license agreement; but it has been posted here before) and replace it with your own

- Create your own MDG as extension to the existing one

- Create your own MDG from scratch (with ideas from the existing one)


q.
Title: Re: Display selected tags on element in diagram
Post by: Marc on August 13, 2013, 09:22:24 pm
I don't want to get into any copyright issues (I'm using a Sparx provided MDG), so building my MDG as an extension sounds like a good idea, but won't I have the same problem then? The MDG stereotypes don't show up in the Setting/UML Types stereotypes list.
Title: Re: Display selected tags on element in diagram
Post by: qwerty on August 13, 2013, 09:38:56 pm
No. They are kept in the MDG. So you need to place the script therein. There is a _image attribute where you can supply the script.

q.
Title: Re: Display selected tags on element in diagram
Post by: Marc on August 13, 2013, 10:00:41 pm
I'm afraid I'm a bit lost here. How would I get "into" the MDG to store something in an _image attribute.
Title: Re: Display selected tags on element in diagram
Post by: qwerty on August 13, 2013, 10:15:14 pm
When you create a MDG (you likely need to RTFM) you can generalize your own stereotype from that of an existing MDG (there was a recent post about that). Then you need to invoke Tools/Generate MDG to actually gen your MDG file.

You might read here: http://community.sparxsystems.com/tutorials/552-24intro-to-creating-a-mdg-file

q.
Title: Re: Display selected tags on element in diagram
Post by: Marc on August 13, 2013, 10:59:23 pm
Thanks again. It seems that I'm going to spend some quality time to achieve the thing I want to do ;). But from a quick glance over the tutorial I get the idea. But I'll start with the fine manual on MDG.