Book a Demo

Author Topic: Generate Documentation with certain Tagged Values of Operations  (Read 7809 times)

TM_RZy

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Hi,

i want to create a documentation of a part of my model in EA.

This part consists of an object of type interface. Within this interface I have attributes and operations.
Each operation has its paramters, notes, ... and certain tagged values, i've created.

My document should look like this for example. The italic parts should be replaced with concrete values.

Operation NameOperation 1
SyntaxType Name...
First certain Tagged ValueTagged Value 1
Second certain Tagged ValueTagged Value 2

My document template looks like this:

package >
element >
method >

Operaton Name{Meth.Name}
Syntax{Meth.Type} {Meth.Name} parameter > {MethParameter.Type} {MethParameter.Name} < parameter
First certain Tagged ValueSQL-Template
Second certain Tagged ValueSQL-Template
< method
< element
< package


The keyword {FeatTagVal.Value} in the tagged value > < tagged value environment gives a complete list of all tagged values assigned to a certain operation.
But i want to get access to only one tagged value.
So I have to use SQL-Templates to get access to one certain tagged value.

The problem i have, i can't get access to the currently processed operation with the SQL-Template. The placeholder #OPERATIONID# (like #OBJECTID# to get access to the currently processed object) doesn't exist.

I hope you understand my problem. :)

Many thanks,
Robert


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #1 on: April 08, 2017, 04:40:55 pm »
I'm afraid you'll have to create the whole operation section as a SQL or Script fragment as there is no way to figure out which operation you are dealing with.

Geert

TM_RZy

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #2 on: April 10, 2017, 10:41:24 pm »
Hi Geert,

thanks for the answer.

I'm not sure if I understood what you mean by your answer.
Maybe you could explain it. That would be nice.


Do you know a workaround for this problem?

I tried it with the report tool of MS Access.
But I don't know it very well. It seems that this tool is not a good one for my issue.

Now I want to try to get access to the data with python.
Maybe I get the solution with this approach.

Robert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #3 on: April 11, 2017, 02:48:48 am »
You now use the <method tag to show parts of the operation.
But because you cannot filter the tagged values in a fragment you'll have to create a fragment that generates the info for all operations.
I think in your case I would choose for an SQL fragment, where you use the #OBJECTID# to make sure you are only showing info for the operations of the current element.

I use a similar approach to report attributes in a fragment.
In that fragment I'm using this query:
Code: [Select]
select att.[Name], att.Notes AS Description, att.LowerBound, att.UpperBound ,
CASE WHEN x.[Description] is null THEN 'no' ELSE 'yes' END AS IsID,
  isnull(v.[Value], 'TBD') AS Versioned, isnull(ts.[Value], 'TBD')  AS Timesliced, att.TYPE AS Format
from (((t_attribute att
left outer join [t_attributetag] v on (v.[ElementID] = att.[ID]
                                and v.[Property] = 'Versioned'))
left outer join [t_attributetag] ts on (ts.[ElementID] = att.[ID]
                                and ts.[Property] = 'Timesliced'))
left outer join t_xref x on (x.[Client] = att.[ea_guid]
                      and x.Type = 'attribute property'
   and x.[Description] like '%@PROP=@NAME=isID@ENDNAME;@TYPE=Boolean@ENDTYPE;@VALU=1@ENDVALU;%'))     
where att.Object_ID = #OBJECTID#
order by att.[Pos]
The query for operations should be rather similar.

Geert

TM_RZy

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #4 on: April 11, 2017, 05:20:19 pm »
Thanks,

but unfortunately that is not what I need. With your approach I get one list of all tagged values within one object.
I need a table, which I showed in my first post, for each operation seperately.

I'm afraid I need to generate this document completely manually.  :'(

Nevertheless many thanks.
Maybe you'll have another idea.

Robert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #5 on: April 11, 2017, 09:57:56 pm »
You can create a table for each operation separately using an SQL fragment.

The table will be repeated for each row you return from your SQL query (if you choose to do it like that, you can also create one big table with all operations and their tagged values)

Geert

TM_RZy

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #6 on: April 11, 2017, 10:07:28 pm »
How can I do this?
With a SQL-Fragment I only get a list of all operations.

I don't know how to build a generic query without something like #OPERATIONID# to get only one operation, but with each execution the result has to be different.
I hope the sentence was understandable.

Robert
« Last Edit: April 11, 2017, 10:32:43 pm by TM_RZy »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #7 on: April 11, 2017, 10:29:55 pm »
How can I do this?
With a SQL-Fragment I only get a list of all operations.

Robert
If you join t_operationtag you can get the info from the tagged values you need as well.

Geert

TM_RZy

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #8 on: April 11, 2017, 11:27:08 pm »
Only to be sure that you understand what I want to reach.

Example.pdf

Maybe I don't get it. But even if I join t_operationtag similar to your example I still don't have access to only one tagged value.
The following example provides a list of tagged values.

Code: [Select]
SELECT t_operationtag.Property
FROM t_operation
LEFT JOIN t_operationtag ON t_operationtag.ElementID = t_operation.OperationID
WHERE t_operation.Object_ID = #OBJECTID#

Robert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #9 on: April 12, 2017, 12:11:36 am »
Robert,

Just like I did in the example with the attribute tags, you can join t_operationtag multiple times, each time with a different alias.

Geert

TM_RZy

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #10 on: April 12, 2017, 05:15:29 pm »
Thanks Geert,

Maybe we talk at cross purposes. All my operations have the same aliases. "Service ID" and "Reentrancy" for example.

The problem is not to get access to one or two specific tagged values of an known operation.
In fact I don't want to "hardcode" a distinct operation in my query.

The fragment should iterate through all operations in a object and provide the tagged values of the currently processed operation.
So that the generator generates a new table for each operation itself.

For example if I have a package with some objects in it.
It is possible to get the name of each contained object with the following query. And for each name I would get a new table.
The document generator executes this query multiple times. With each execution the result is only one name and not a list of all names.

Code: [Select]
SELECT t_object.Name
FROM t_object
WHERE t_object.Object_ID = #OBJECTID#

I need the same thing for the tagged values of each operation.
By the way we could also talk about the name of each operation instead of the tagged values.
The problem stays the same.

Robert
« Last Edit: April 12, 2017, 07:12:14 pm by TM_RZy »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate Documentation with certain Tagged Values of Operations
« Reply #11 on: April 12, 2017, 07:12:26 pm »
Robert,

I understand what you are after, and I'm telling you that it can be done using an SQL fragment that takes care of the whole methods section.
It is perfectly possible to create a fragment that creates a table for each operation of the element you are processing and prints all required fields, including name, parameters, tagged values etc..

Geert