Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started 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:
-
You will likely have to write a shape script.
q.
-
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?
-
Open the help, search for "shape script", read the first entry.
q.
-
Ah, I get it. Thanks!
-
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?
-
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.
-
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.
-
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.
-
I'm afraid I'm a bit lost here. How would I get "into" the MDG to store something in an _image attribute.
-
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.
-
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.