Author Topic: ModelView (EAUML::ModelView) rendered in a custom PDF/DOCX document  (Read 1813 times)

flavius

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Got EA recently, Unified Edition, and I'm impressed.

However, I have a problem.

I got my ModelView nicely rendered as a table on a diagram, all good.

The problem is, how to add this element also in a new custom document I'm working on?

When I drag and drop, I select "dynamic content", but which template would work?

Ideally, it will be added as a regular msword-style table, but it doesn't have to be - it just has to be not horrible and include the headers.

There's also a slight problem, the column "Note" is not shown on the diagram, but the query works correctly if I query the DB with another sqlite3 client.

Code: [Select]
SELECT
t_object.ea_guid AS CLASSGUID,
t_object.Object_Type AS CLASSTYPE,
t_object.Name,
t_object.Note,
t_object.Stereotype,
op.Property,
op.Value
FROM
t_object
INNER JOIN (
t_diagram
INNER JOIN t_diagramobjects ON
t_diagram.Diagram_ID = t_diagramobjects.Diagram_ID) ON
t_object.Object_ID = t_diagramobjects.Object_ID
LEFT JOIN t_objectproperties op ON op.Object_ID = t_object.Object_ID
WHERE
t_diagram.ea_guid = '{06B8688C-1539-45d0-9270-218EDBED0B74}'
AND t_object.Object_Type = 'Actor'
AND t_object.Stereotype = 'Stakeholder'
ORDER BY
t_object.Object_Type,
t_object.Name

Thanks
« Last Edit: August 04, 2024, 05:09:11 am by flavius »

flavius

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: ModelView (EAUML::ModelView) rendered in a custom PDF/DOCX document
« Reply #1 on: August 04, 2024, 07:30:03 am »
I actually found now https://sparxsystems.com/enterprise_architect_user_guide/16.1/model_publishing/custom_sql_fragments.html

I got it to work, but the table looks broken.

Puzzle pieces:

1. the template fragment, defined as custom sql:

Code: [Select]
SELECT
t_object.ea_guid AS CLASSGUID,
t_object.Object_Type AS CLASSTYPE,
t_object.Name,
t_object.Note AS [Note],
t_object.Stereotype,
op.Property,
op.Value
FROM
t_object
INNER JOIN (
t_diagram
INNER JOIN t_diagramobjects ON
t_diagram.Diagram_ID = t_diagramobjects.Diagram_ID) ON
t_object.Object_ID = t_diagramobjects.Object_ID
LEFT JOIN t_objectproperties op ON op.Object_ID = t_object.Object_ID
WHERE
t_diagram.Package_ID = #Package#
AND t_object.Object_Type = 'Actor'
AND t_object.Stereotype = 'Stakeholder'
ORDER BY
t_object.Object_Type,
t_object.Name

2. The template visually:




3. The output:

As you can see, it outputs multiple tables. I've resized them so that it's visible, but that is possible because they're different: