Author Topic: Tagged Values in Documentation  (Read 6734 times)

Anna I

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Tagged Values in Documentation
« on: March 18, 2017, 01:12:09 am »
I have created a Documentation Template for UML Class Diagrams and have inserted tagged values in my RTF:

{ElementTagVal.Name}:{ElementTagVal.Value}

However, a number of tags are defined in an MDG, and for each element only SOME tags will be populated with values.

Is it possible to include a condition that checks if a tag has a value and if it is null, then the tag is not printed?

Thanks
Anna
« Last Edit: March 18, 2017, 01:25:15 am by aaing »

Robert Lelieveld

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: Tagged Values in Documentation
« Reply #1 on: March 23, 2017, 02:30:31 am »
Hi Anna,

While trying to create my own hyperlinks I found that for this you could:

1. Create a fragment
2. Use a SQL fragment
3. Add the fields to the custom section

In the template:
1. Add the fragment template

When the query of the SQL fragment return no records, no output is generated.

Kind regards,
Robert

Anna I

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Tagged Values in Documentation
« Reply #2 on: March 23, 2017, 08:34:17 pm »
Many thanks, Robert!  :D
Sounds like a solution which will solve the problem! :-)
Anna


Anna I

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Tagged Values in Documentation
« Reply #3 on: March 24, 2017, 08:54:24 pm »
It seems I require a bit more help ;-)

In the fragment document I now have:

custom >
{TAGName}:{TagVal}
< custom

I have created the beginning of a fragment with the following custom SQL query:

"SELECT TagValue as TagName, Notes as TagVal FROM t_taggedvalue WHERE Notes NOT LIKE '$ea_*'"

but how do I reference the current element and select just those tag/value pairs held by that element? (a join with what? using the #OBJECTID# tag in a where clause?)

Cheers,
Anna


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Tagged Values in Documentation
« Reply #4 on: March 24, 2017, 11:44:57 pm »
You don't need an SQL query for that (by the way you are querying the wrong table) you can use .start and .end bookmarks in your template to hide section in case a certain field is not filled in.

There is some explanation in the help about that.

Geert

Anna I

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Tagged Values in Documentation
« Reply #5 on: March 27, 2017, 06:52:39 pm »
Thanks Geert!
Had actually already (unsuccessfully) attempted to apply bookmarks, but I will delve further into the documentation now :-)
Anna

Anna I

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Tagged Values in Documentation
« Reply #6 on: March 27, 2017, 11:46:10 pm »
Update:

Have now successfully 'hidden' most of my tags without values. For instance, the 'versionInfo' tag:
PkgElement.valueOf(versionInfo).Start{PkgElement.valueOf(versionInfo)}PkgElement.valueOf(versionInfo).End
- oh, and what a shame that the bookmarks aren't shown in the editor - very un-userfriendly ;-)

Have encountered two issues though:
1) If my tag contains a whitespace (ex. label (da)), I cannot created a bookmark for it (it simply won't let me insert it - is there an escape function/joker for whitespaces? - or is there a naming convention (eg. lowerCamelCase) for tag definitions? Haven't yet found it in the UML standard)
2) If my tag has memo as datatype, it's description in Notes will wrongly be used as the 'value field' and thus always be shown.

Instead continuing with the SQL fragment solution, I seem to be getting closer with:
SELECT Property, Value FROM t_objectproperties WHERE Object_ID = #OBJECTID# AND Value NOT NULL AND Value NOT LIKE '<*'

« Last Edit: March 28, 2017, 09:50:47 am by Anna I »