Antony Robert
Antony Robert

Reputation: 43

Documentation with Diagram "Hyperlinks" in Enterprise Architect?

I'm struggling to get all the required (and only the required) information into the documentation of my Enterprise Architect Project. Precisely: we have modelled various requirements and displayed the source "standards" for these requirements in our diagrams by using the "hyperlink"-element out of the common toolbox. (This allows us to capture a title, the website where the documentation is found and a description of this documentation).

Now this element is visible on the diagram, but not in the package-view of our model and it does not get generated in our word (docx) documentation.

I can see that it should be possible to get this in the documentation, because a "Model Report" which basically prints everything does print the hyperlinks. But I can't find what I have to select in my template (in the package-tree view, as a package field, element field or diagram field) in order to get this printed. I can't just use the model report since this basically dumps the whole database in the document and reverse-engineering this model report has proven too difficult for me. Actually I would expect this to be in some kind of documentation for EA, but could not find such a thing with this level of detail... is there, is there a reproducible way of finding such things out in further cases? (btw I'm using EA 11.0)

[sorry there were illustrations here, but I'm not allowed to upload them...]

Upvotes: 3

Views: 2561

Answers (3)

Antony Robert
Antony Robert

Reputation: 43

[Edited on 04.05.15 to reflect the comment by Uffe and provide a final solution]

Ok, based on Geerts answer, using the following custom query fragment in the diagram section:

select 
    t_object.ea_guid as CLASSGUID, 
    t_object.Object_Type as CLASSTYPE, 
    t_object.Object_Id as OBJECTID, 
    t_object.name as HL_Name,
    t_object.Stereotype as HL_Stereotype,
    t_object.object_type as HL_Type,
    t_object.Alias as HL_Alias,
    Note as Notes
    --,t_object.*
from t_object
  left join t_diagramobjects on (t_object.Object_ID = t_diagramobjects.Object_ID)
  left join t_diagram on (t_diagram.Diagram_ID = t_diagramobjects.Diagram_ID)
where t_diagram.Diagram_ID = '#DIAGRAMID#'
  and t_object.Object_Type='Text'

I was able to get a list of the hyperlinks following the diagram, this is the fragment:

custom >
{HL_Alias}: {HL_Name}
{Notes}
< custom

The "Notes" can be printed by getting the attribute directly out of the t_object table. Don't get confused as I was at first: the auto-completion on t_object and the results (t_object.*) DO NOT SHOW a Note-Attribute, but it does exist an when you write it into the query, it gets generated in the document.

Upvotes: 1

Uffe
Uffe

Reputation: 10514

As Geert has already noted, there is a difference between "proper" elements and diagram-only elements. This is actually reflected in the document template editor, where there is an "Element" section inside the "Diagram" section. This will produce output for all elements in the diagram, whether or not they are also in the project browser.

Here's an example of the information you can pull out of your hyperlinks. Given a diagram with a hyperlink:

Diagram

... and a template which outputs name, alias and hyperlink for each element in the diagram:

Template

... EA will generate a document will the following contents:

Document

So if you want the hyperlink to result in a hyperlink in the document, use the HyperlinkAlias field.

What might be a bit confusing is the fact that in addition to the Hyperlink element type in the Common diagram toolbox, EA allows you to create hyperlinks in regular elements (in the Element Properties dialog, Related tab: Files, which can be local files or web addresses).

In fact, I would recommend that you use those in your Requirement elements rather than diagram-only Hyperlinks if traceability is a priority in your model. The diagram-only Hyperlinks, on the other hand, give you a clearer visual.

Selecting a subset of the elements in a diagram ("only the required information") is a little more involved and depends on how your model is structured. Template fragments will get the job done, but you might be able to achieve your desired result by just using the filters in the document generation dialog.

Upvotes: 4

Geert Bellekens
Geert Bellekens

Reputation: 13784

The hyperlink is an element that is stored in the same package as the diagram it is used on, it is just not visible in the project browser (similar to a note element).

There's a good chance that it doesn't have a name, so make sure you don't omit nameless elements.

So if you print all the element of the package containing the diagram then you should be able to print the hyperlink as well.

In case that fails you might want to consider creating a template fragment based on an SQL query or a script. Those offer lots of flexibility to print whatever you need, even if it is located in a different package.

Upvotes: 1

Related Questions