Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: marku on October 22, 2024, 05:27:24 pm

Title: add list of relationships from diagram to template documentation
Post by: marku on October 22, 2024, 05:27:24 pm
Hi
EA 16.1
I want add to template documentation list of relationships but only from diagram elements
Such like this:
package >
Name:{Pkg.Name}
diagram >
{Diagram.DiagramImg}

connector >
{Connector.Name}
conveyed: {Connector.Conveyed}
type Connection: {Connector.Type}
Source: _{Connector.SourceColumns} -> Target:{Connector.TargetColumns} ___________________________________________
< connector

< diagram
< package

But "Source" and "Target" in document I have still empty.
How the template should look like - to show (only for relations visible in the diagram): name, source type and name, target type
Title: Re: add list of relationships from diagram to template documentation
Post by: Geert Bellekens on October 22, 2024, 06:26:20 pm
You probably need to resort to an SQL fragment to get this type of info into the document

Geert
Title: Re: add list of relationships from diagram to template documentation
Post by: marku on October 23, 2024, 03:39:29 am
oh, that's what I'm afraid of.
I tried to add it to the template in the "Document Options" -> "custom SQL" field but I did something wrong.
On the other hand, no one noticed that "selected information" for Diagram-> Connections doesn't work when building a template using "Checkboxes" in Section? Am I the only one using it?
Title: Re: add list of relationships from diagram to template documentation
Post by: Geert Bellekens on October 23, 2024, 04:29:30 pm
That's not how template fragments work. See https://sparxsystems.com/enterprise_architect_user_guide/17.0/model_publishing/custom_sql_fragments.html (https://sparxsystems.com/enterprise_architect_user_guide/17.0/model_publishing/custom_sql_fragments.html)

Geert
Title: Re: add list of relationships from diagram to template documentation
Post by: marku on November 19, 2024, 01:45:23 am
Thx Geert Bellekens - it's work. 
The only problem I have left is that I have to change the diagram name in the SQL content - it's inconvenient if the documentation is to be generated by different people
Title: Re: add list of relationships from diagram to template documentation
Post by: Geert Bellekens on November 19, 2024, 02:02:43 am
Thx Geert Bellekens - it's work. 
The only problem I have left is that I have to change the diagram name in the SQL content - it's inconvenient if the documentation is to be generated by different people
Why would you have the diagram name in the SQL content? You can use the diagram ID macro that is passed by the template engine.

Geert
Title: Re: add list of relationships from diagram to template documentation
Post by: marku on November 21, 2024, 09:49:35 pm
the solution I managed to do requires that the name of the diagram or its ID be provided in the SQL itself. Relying on the package indication mechanism in <<model document>> did not give anything
Title: Re: add list of relationships from diagram to template documentation
Post by: Geert Bellekens on November 21, 2024, 09:59:04 pm
the solution I managed to do requires that the name of the diagram or its ID be provided in the SQL itself. Relying on the package indication mechanism in <<model document>> did not give anything
Then you must have done something wrong. That is not how SQL fragments are supposed to work.

If you post the relevant code and descriptions we might be able to spot the error.

Geert