In Sparx Enterprise Architect I am trying to document a class model containing classes and attributes. Some attribute have a simple type (e.g. Flag) and some have an enumeration type. All types (simple and enumeration) are modelled in separate data type classes. My goal is to generate a document that lists the following:
Class A
Attribute A1
Type A1 (simple data type or enum)
Attribute A2
Type A2 (simple data type or enum)
…
If the type is a simple data type, I need only the type’s name (e.g. FLAG)
If the type is an enumeration, I need the type’s name and enumeration details (= attributes of the data type class).
To solve this I created a Custom Template that refers a Custom Template Fragment with a Custom SQL query.
Custom Template “User Manual”
package >
element >
Class "{Element.Name}"
attribute >
Attribute "{Att.Name}"
Type: {Att.Type}
{Template - DataType}
< attribute
< element
< package
Template Fragment “DataType”
custom >
| Code | Column B |
| -------| ------------- |
| {Code} | {Description} |
< custom
SQL query in Template Fragment OptionsCustom QueryCustom SQL
SELECT e.[Default] as Code, e.[Notes] as Description
FROM
t_attribute a
INNER JOIN
t_object o ON a.classifier = o.object_id
INNER JOIN
t_attribute e ON o.object_id = e.object_id
WHERE
a.object_id = #OBJECTID#
The result I receive when I drag and drop a Class (“Holiday”) containing many Attributes into a document and apply the Custom Template “User Manual” from above:
Class "Holiday"
Attribute "{Att.Name}"
Type: {Att.Type}
Code Description
1 Full day
2 Morning
3 Afternoon
99 Other
It seems that the normal function of the Custom Template to get Attribute information breaks. No one of the many attribute of the Class “Holiday” is listed. Only the enumeration from the Template Fragment is shown for the one Attribute in Class “Holiday” that has data type = enumeration.
Any ideas what I am doing wrong here?
I tried a lot to make it work, and also searched here, in the EA Forum and in the EA Online Manual.
BAAM is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.