Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Field substitution macros can be used in one of two ways:
This form directly substitutes the corresponding value of the element in scope into the output.
Where <macroName> can be any of the macros listed in the Field Substitution Macros tables.
This form of the macro enables alternative substitutions to be made depending on the macro's value.
Structure: %<macroName> (== "<text>") ? <subTrue> (: <subFalse>) %
- () denotes that values between the parentheses are optional
- <text> is a string representing a possible value for the macro
- <subTrue> and <subFalse> can be a combination of quoted strings and the keyword value; where the value is used, it is replaced with the macro's value in the output
Those three examples output nothing if the condition fails. In this case the False condition can be omitted, resulting in this usage:
- %classAbstract=="T" ? "pure"%
- %opStereotype=="operator" ? "operator"%
- %paramDefault != "" ? " = "value%
The third example of both blocks shows a comparison checking for a non-empty value or existence. This test can also be omitted.
- %paramDefault ? " = " value : ""%
- %paramDefault ? " = " value%
All of the above examples containing paramDefault are equivalent. If the parameter in scope had a default value of 10, the output from each of them would normally be: