Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: hoylet on February 05, 2024, 11:27:05 pm

Title: Code Transform and Attribute Tags
Post by: hoylet on February 05, 2024, 11:27:05 pm
Hi

I have created a Transform based upon the Java code transform.

Is there a way of outputting all the tags applied to an attribute

for a specific tag I can do this :-

Code: [Select]
%WRAP_COMMENT(attTag:"protobuf field min value",genOptWrapComment,"","// protobuf field min value ")%

but I would like to output all tags

Code: [Select]
%WRAP_COMMENT(attTag:"*",genOptWrapComment,"","// ")%
Do I need to use list or some form of loop

Any suggestions would be most welcome

Thanks
Title: Re: Code Transform and Attribute Tags
Post by: Eve on February 06, 2024, 01:34:30 pm
Is there a way of outputting all the tags applied to an attribute
Short answer. No.

Longer answer: Not within the templates themselves. You would need to call an add-in using EXEC_ADD_IN (https://sparxsystems.com/enterprise_architect_user_guide/16.1/modeling_domains/functionmacros.html)

I've done similar things in the past in some very complicated transforms using a model add-in (https://sparxsystems.com/enterprise_architect_user_guide/16.1/add-ins___scripting/modeladdins.html).
Title: Re: Code Transform and Attribute Tags
Post by: hoylet on February 06, 2024, 09:29:23 pm
Thank you Eve I will look into that