Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: DavidM on May 01, 2017, 02:51:01 pm

Title: Adding Memos as a MDG
Post by: DavidM on May 01, 2017, 02:51:01 pm
Hello,
We have been using  an MDG script that I developed a couple of years ago to generate our own symbology for our own framework.

We have a large demand however for a Notes field in the element, similar to the one that comes up when you double-click any element, but for non-formal technical comments that we don't want to publish in the document generator.

Does anyone know if there is a way to do this in the MDG? it could be a tag for example that when you click on it, provides a memo object.
many thanks,
David

Title: Re: Adding Memos as a MDG
Post by: Paolo F Cantoni on May 01, 2017, 04:52:24 pm
Yes, David, that's one way to do it.

Paolo
Title: Re: Adding Memos as a MDG
Post by: Sunshine on May 02, 2017, 07:13:36 am
Here is how I do it.
1) Create tagged value type via config tab>Reference Data>UML Types like so
Name: MemoField
Details: Type=Memo; BaseStereotype=Class;

2) In your MDG stereotype add attribute with these details
Name:<MDG_ID>::MemoField
Type: MemoField

Where <MDG_ID> should be the ID you have for your MDG.
Note the the name has to match the UML Type name for this to work. The type doesn't seem to have any effect but I set it so I can figure out what it was.

3) When generating MDG select the UML Type MemoField to export into the MDG file.

Its a bit of a pain that you have to define a tagged value type for each attribute even though they may be all of type memo but that's how Sparx EA works. Hope that helps.
Title: Re: Adding Memos as a MDG
Post by: KP on May 02, 2017, 01:25:18 pm
There's a quicker way: add an attribute to your stereotype class with initial value set to '<memo>'.
Title: Re: Adding Memos as a MDG
Post by: Sunshine on May 02, 2017, 08:04:35 pm
@KP Now thats interesting to know. Does it work for dates too? For example just set the initial value to '<date>'
Title: Re: Adding Memos as a MDG
Post by: qwerty on May 02, 2017, 08:39:14 pm
No. That only works for <memo>. You can try it manually (type <memo> in the TV value).

q.
Title: Re: Adding Memos as a MDG
Post by: Sunshine on May 03, 2017, 09:21:45 am
No. That only works for <memo>. You can try it manually (type <memo> in the TV value).

q.

Well that's just typical inconsistency isn't it?

Shame that by setting the type on attribute in the stereotype in the MDG you can't specify date, memo, spin etc just to be consistent.
Title: Re: Adding Memos as a MDG
Post by: qwerty on May 03, 2017, 06:15:08 pm
It's EA, isn't it?

q.