Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: adepreter on May 10, 2018, 01:22:59 am
-
Hello,
In a template fragment I am selecting elements of a certain types in the current package using #PACKAGEID# (see select clause below).
I use that fragment only to be able to sort elements by a certain tagged value in a package.
The select clause collects notably the element Note.
The fragment also formats the resulting values in a table.
Problem: The generated Note field value, referred as {Note} in the document, shows the source HTML text including <LI> etc...
Any idea how to fix this problem?
Cheers,
Alain
SELECT
Perspective = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Perspective'),
Code = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Code'),
t_object.Name as Name, t_object.Note,
Implications = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Implications'),
Rationale = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Rationale')
FROM t_object
where t_object.stereotype = 'NMBS_Principle'
and t_object.package_id = #PACKAGEID#
order by Code
-
I guess you need something like t_object.not as notes.
q.
-
You have to mark it as formatted text.
Use t_object.Note-Formatted in the query and {Note.Formatted} in the template.
See https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/model_publishing/custom_sql_fragments.html (https://www.sparxsystems.com/enterprise_architect_user_guide/14.0/model_publishing/custom_sql_fragments.html)
Geert
-
That works fine. Thank you Geert!
Result is:
{Note.Formatted}
referring to the following query:
SELECT
Perspective = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Perspective'),
Code = (select tv.value from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Code'),
t_object.Name as Name, t_object.Note as "Note.Formatted",
Implications = (select tv.notes from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Implications'),
Rationale = (select tv.notes from t_objectproperties tv
where tv.Object_ID = t_object.Object_ID and tv.property = 'Rationale')
FROM t_object
where t_object.stereotype = 'NMBS_Principle'
and t_object.package_id = #PACKAGEID#
order by Code