Field Substitution Macros

The field substitution macros provide access to data in the model. In particular, they are used to access data fields from:

  • Packages
  • Classes
  • Attributes
  • Operations
  • Parameters.

Field substitution macros are named according to Camel casing. By convention, the macro is prefixed with an abbreviated form of the corresponding model element. For example, attribute-related macros begin with att, as in the %attName% macro, to access the name of the attribute in scope.

Macros that represent checkboxes return a value of T if the box is selected. Otherwise the value is empty.

The following table lists each of the field substitution macros with a description of the result.

Macro Name

Description

attAlias

Attributes dialog: Alias.

attAllowDuplicates

Attributes Detail dialog: Allow Duplicates checkbox.

attClassifierGUID

The unique GUID for the classifier of the current attribute.

attCollection

Attributes Detail dialog: Attribute is a Collection checkbox.

attConst

Attributes dialog: Const checkbox.

attContainerType

Attributes Detail dialog: Container Type.

attContainment

Attributes dialog: Containment.

attDerived

Attributes dialog: Derived checkbox.

attGUID

The unique GUID for the current attribute.

attInitial

Attributes dialog: Initial.

attIsEnumLiteral

Attributes dialog: Is Literal checkbox.

attLength

Column dialog: Length.

attLowerBound

Attributes Detail dialog: Lower Bound.

attName

Attributes dialog: Name.

attNotes

Attributes dialog: Notes.

attOrderedMultiplicity

Attributes Detail dialog: Ordered Multiplicity checkbox.

attProperty

Attributes dialog: Property checkbox.

attQualType

The attribute type qualified by the namespace path (if generating namespaces) and the classifier path (dot delimited). If the attribute classifier has not been set, is equivalent to the attType macro.

attScope

Attributes dialog: Scope.

attStatic

Attributes dialog: Static checkbox.

attStereotype

Attributes dialog: Stereotype.

attType

Attributes dialog: Type.

attUpperBound

Attributes Detail dialog: Upper Bound.

attVolatile

Attributes Detail dialog: Transient checkbox.

classAbstract

Class dialog: Abstract checkbox.

classAlias

Class dialog: Alias.

classArguments

Class Detail dialog: C++ Templates: Arguments.

classAuthor

Class dialog: Author.

classBaseName

Type Hierarchy dialog: Class Name (for use where no connector exists between child and base Classes).

classBaseScope

The scope of the inheritance as reverse engineered. (For use where no connector exists between child and base Classes.)

classBaseVirtual

The virtual property of the inheritance as reverse engineered. (For use where no connector exists between child and base Classes.)

classComplexity

Class dialog: Complexity.

classCreated

The date and time the Class was created.

classGUID

The unique GUID for the current Class.

classHasConstructor

Looks at the list of methods in the current object and, depending on the conventions of the current language, returns T if one is a default constructor. Typically used with the genOptGenConstructor macro.

classHasCopyConstructor

Looks at the list of methods in the current object and, depending on the conventions of the current language, returns T if one is a copy constructor. Typically used with the genOptGenCopyConstructor macro.

classHasDestructor

Looks at the list of methods in the current object and, depending on the conventions of the current language, returns T if one is a destructor. Typically used with the genOptGenDestructor macro.

classHasParent

True, if the Class in scope has one or more base Classes.

classImports

Code Gen dialog: Imports.

classIsActive

Class Advanced dialog: Is Active checkbox.

classIsInstantiated

True, if the Class is an instantiated template Class.

classIsLeaf

Class Advanced dialog: Is Leaf checkbox.

classIsRoot

Class Advanced dialog: Is Root checkbox.

classIsSpecification

Class Advanced dialog: Is Specification checkbox.

classKeywords

Class dialog: Keywords.

classLanguage

Class dialog: Language.

classMacros

A space separated list of macros defined for the Class.

classModified

The date and time the Class was last modified.

classMultiplicity

Class Advanced dialog: Multiplicity.

className

Class dialog: Name.

classNotes

Class dialog: Note.

classParamDefault

Class Detail dialog.

classParamName

Class Detail dialog.

classParamType

Class Detail dialog.

classPersistence

Class dialog: Persistence.

classPhase

Class dialog: Phase.

classQualName

The Class name prefixed by its outer Classes. Class names are separated by double colons (::).

classScope

Class dialog: Scope.

classStereotype

Class dialog: Stereotype.

classStatus

Class dialog: Status.

classVersion

Class dialog: Version.

connectorAlias

Connector Properties dialog: Alias.

connectorDestAccess

Connector Properties dialog, Target Role tab: Access.

connectorDestAggregation

Connector Properties dialog, Target Role tab: Aggregation.

connectorDestAlias

Connector Properties dialog, Target Role tab: Alias.

connectorDestAllowDuplicates

Connector Properties dialog, Target Role tab: Allow Duplicates checkbox.

connectorDestChangeable

Connector Properties dialog, Target Role tab: Changeable.

connectorDestConstraint

Connector Properties dialog, Target Role tab: Constraint(s).

connectorDestContainment

Connector Properties dialog, Target Role tab: Containment.

connectorDestDerived

Connector Properties dialog, Target Role tab: Derived checkbox.

connectorDestDerivedUnion

Connector Properties dialog, Target Role tab: DerivedUnion checkbox.

connectorDestElem*

A set of macros that access a property of the element at the target end of a connector. The * (asterisk) is a wildcard that corresponds to any class substitution macro in this list; for example: connectorDestElemAlias (classAlias), connectorDestElemAuthor (classAuthor).

connectorDestElemType

The element type of the connector destination element. (Separate from the connectorDestElem* macros because there is no classType substitution macro.)

connectorDestMemberType

Connector Properties dialog, Target Role tab: Member Type.

connectorDestMultiplicity

Connector Properties dialog, Target Role tab: Multiplicity.

connectorDestNavigability

Connector Properties dialog, Target Role tab: Navigability.

connectorDestNotes

Connector Properties dialog, Target Role tab: Role Notes.

connectorDestOrdered

Connector Properties dialog, Target Role tab: Ordered checkbox.

connectorDestOwned

Connector Properties dialog, Target Role tab: Owned checkbox.

connectorDestQualifier

Connector Properties dialog, Target Role tab: Qualifier(s).

connectorDestRole

Connector Properties dialog, Target Role tab: Role.

connectorDestScope

Connector Properties dialog, Target Role tab: Target Scope.

connectorDestStereotype

Connector Properties dialog, Target Role tab: Stereotype.

connectorDirection

Connector Properties: Direction.

connectorEffect

Transition Constraints dialog: Effect.

connectorGuard

Object Flow and Transition Constraints dialog: Guard.

connectorGUID

The unique GUID for the current connector.

connectorName

Connector Properties: Name.

connectorNotes

Connector Properties: Notes.

connectorSourceAccess

Connector Properties dialog, Source Role tab: Access.

connectorSourceAggregation

Connector Properties dialog, Source Role tab: Aggregation.

connectorSourceAlias

Connector Properties dialog, Source Role tab: Alias.

connectorSourceAllowDuplicates

Connector Properties dialog, Source Role tab: Allow Duplicates checkbox.

connectorSourceChangeable

Connector Properties dialog, Source Role tab: Changeable.

connectorSourceConstraint

Connector Properties dialog, Source Role tab: Constraint(s).

connectorSourceContainment

Connector Properties dialog, Source Role tab: Containment.

connectorSourceDerived

Connector Properties dialog, Source Role tab: Derived checkbox.

connectorSourceDerivedUnion

Connector Properties dialog, Source Role tab: DerivedUnion checkbox.

connectorSourceElem*

A set of macros that access a property of the element at the source end of a connector. The * (asterisk) is a wildcard that corresponds to any class substitution macro in this list; for example: connectorSourceElemAlias (classAlias), connectorSourceElemAuthor (classAuthor).

connectorSourceElemType

The element type of the connector source element. (Separate from the connectorSourceElem* macros because there is no classType substitution macro.)

connectorSourceMemberType

Connector Properties dialog, Source Role tab: Member Type.

connectorSourceMultiplicity

Connector Properties dialog, Source Role tab: Multiplicity.

connectorSourceNavigability

Connector Properties dialog, Source Role tab: Navigability.

connectorSourceNotes

Connector Properties dialog, Source Role tab: Role Notes.

connectorSourceOrdered

Connector Properties dialog, Source Role tab: Ordered checkbox.

connectorSourceOwned

Connector Properties dialog, Source Role tab: Owned checkbox.

connectorSourceQualifier

Connector Properties dialog, Source Role tab: Qualifier(s).

connectorSourceRole

Connector Properties dialog, Source Role tab: Role.

connectorSourceScope

Connector Properties dialog, Source Role tab: Target Scope.

connectorSourceStereotype

Connector Properties dialog, Source Role tab: Stereotype.

connectorStereotype

Connector Properties dialog: Stereotype.

connectorTrigger

Transition Constraints dialog: Trigger.

connectorType

The connector type; for example, Association or Generalization.

connectorWeight

Object Flow Constraints dialog: Weight.

constraintName

Class dialog, Constraints tab: Name.

constraintNotes

Class dialog, Constraints tab: Notes.

constraintStatus

Class dialog, Constraints tab: Status.

constraintType

Class dialog, Constraints tab: Type.

constraintWeight

Class dialog, Constraints tab: ordering (hand up/down) keys.

eaDateTime

The current time with format: DD-MMM-YYYY HH:MM:SS AM/PM.

eaGUID

A unique GUID for this generation.

eaVersion

Program Version (Located in an Enterprise Architect dialog by selecting Help | About EA.).

effortName

Project Management window: Effort.

effortNotes

Project Management window: Notes (unlabelled).

effortTime

Project Management window: Time.

effortType

Project Management window: Type.

elemType

The element type: Interface or Class.

fileExtension

The file type extension of the file being generated.

fileName

The name of the file being generated.

fileNameImpl

The filename of the implementation file for this generation, if applicable.

fileHeaders

Code Gen dialog: Headers.

fileImports

Code Gen dialog: Imports. For supported languages this also includes dependencies derived from associations.

filePath

The full path of the file being generated.

filePathImpl

The full path of the implementation file for this generation, if applicable.

genOptActionScriptVersion

ActionScript Specifications dialog: Default Version.

genOptCDefaultAttributeType

C Specifications dialog: Default Attribute Type.

genOptCGenMethodNotesInBody

C Specifications dialog: Method Notes In Implementation.

genOptCGenMethodNotesInHeader

C Specifications dialog: Method Notes In Header.

genOptCSynchNotes

C Specifications dialog: Synchronize Notes in Generation.

genOptCSynchCFile

C Specifications dialog: Synchronise Implementation file in Generation.

genOptCDefaultSourceDirectory

C Specifications dialog: Default Source Directory.

genOptCNamespaceDelimiter

C Specifications dialog: Namespace Delimiter.

genOptCOperationRefParam

C Specifications dialog: Reference as Operation Parameter.

genOptCOperationRefParamStyle

C Specifications dialog: Reference Parameter Style.

genOptCOperationRefParamName

C Specifications dialog: Reference Parameter Name.

genOptCConstructorName

C Specifications dialog: Default Constructor Name.

genOptCDestructorName

C Specifications dialog: Default Destructor Name.

genOptCPPCommentStyle

C++ Specifications dialog: Comment Style.

genOptCPPDefaultAttributeType

C++ Specifications dialog: Default Attribute Type.

genOptCPPDefaultReferenceType

C++ Specifications dialog: Default Reference Type.

genOptCPPDefaultSourceDirectory

C++ Specifications dialog: Default Source Directory.

genOptCPPGenMethodNotesInHeader

C++ Specifications dialog: Method Notes In Header checkbox.

genOptCPPGenMethodNotesInBody

C++ Specifications dialog: Method Notes In Body checkbox.

genOptCPPGetPrefix

C++ Specifications dialog: Get Prefix.

genOptCPPHeaderExtension

C++ Specifications dialog: Header Extension.

genOptCPPSetPrefix

C++ Specifications dialog: Set Prefix.

genOptCPPSourceExtension

C++ Specifications dialog: Source Extension.

genOptCPPSynchCPPFile

C++ Specifications dialog: Synchronize Notes.

genOptCPPSynchNotes

C++ Specifications dialog: Synchronize CPP File.

genOptCSDefaultAttributeType

C# Specifications dialog: Default Attribute Type.

genOptCSSourceExtension

C# Specifications dialog: Default file extension.

genOptCSGenDispose

C# Specifications dialog: Generate Dispose.

genOptCSGenFinalizer

C# Specifications dialog: Generate Finalizer.

genOptCSGenNamespace

C# Specifications dialog: Generate Namespace.

genOptCSDefaultSourceDirectory

C# Specifications dialog: Default Source Directory.

genOptDefaultAssocAttName

Attribute Specifications dialog: Default name for associated attrib.

genOptDefaultConstructorScope

Object Lifetimes dialog: Default Constructor Visibility.

genOptDefaultCopyConstructorScope

Object Lifetimes dialog: Default Copy Constructor Visibility.

genOptDefaultDatabase

Code Editors dialog: Default Database.

genOptDefaultDestructorScope

Object Lifetimes dialog: Default Destructor Constructor Visibility.

genOptGenCapitalisedProperties

Source Code Engineering dialog: Capitalize Attribute Names for Properties checkbox.

genOptGenComments

Source Code Engineering dialog: Generate Comments checkbox.

genOptGenConstructor

Object Lifetimes dialog: Generate Constructor checkbox.

genOptGenConstructorInline

Object Lifetimes dialog: Constructor Inline checkbox.

genOptGenCopyConstructor

Object Lifetimes dialog: Generate Copy Constructor checkbox.

genOptGenCopyConstructorInline

Object Lifetimes dialog: Copy Constructor Inline checkbox.

genOptGenDestructor

Object Lifetimes dialog: Generate Destructor checkbox.

genOptGenDestructorInline

Object Lifetimes dialog: Destructor Inline checkbox.

genOptGenDestructorVirtual

Object Lifetimes dialog: Virtual Destructor checkbox.

genOptGenImplementedInterfaceOps

Attribute/Operations Specifications dialog: Generate methods for implemented interfaces checkbox.

genOptGenPrefixBoolProperties

Source Code Engineering dialog: Use is prefix for boolean property Get().

genOptGenRoleNames

Source Code Engineering dialog: Autogenerate role names when creating code.

genOptGenUnspecAssocDir

Source Code Engineering dialog: Do not generate members where Association direction is unspecified checkbox.

genOptJavaDefaultAttributeType

Java Specifications dialog: Default attribute type.

genOptJavaGetPrefix

Java Specifications dialog: Get Prefix.

genOptJavaDefaultSourceDirectory

Java Specifications dialog: Default Source Directory.

genOptJavaSetPrefix

Java Specifications dialog: Set Prefix.

genOptJavaSourceExtension

Java Specifications dialog: Source code extension.

genOptPHPDefaultSourceDirectory

PHP Specifications dialog: Default Source Directory.

genOptPHPGetPrefix

PHP Specifications dialog: Get Prefix.

genOptPHPSetPrefix

PHP Specifications dialog: Set Prefix.

genOptPHPSourceExtension

PHP Specifications dialog: Default file extension.

genOptPHPVersion

PHP Specifications dialog: PHP Version.

genOptPropertyPrefix

Source Code Engineering dialog: Remove prefixes when generating Get/Set properties.

genOptVBMultiUse

VB Specifications dialog: Multiuse checkbox.

genOptVBPersistable

VB Specifications dialog: Persistable checkbox.

genOptVBDataBindingBehavior

VB Specifications dialog: Data binding behavior checkbox.

genOptVBDataSourceBehavior

VB Specifications dialog: Data source behavior checkbox.

genOptVBGlobal

VB Specifications dialog: Global namespace checkbox.

genOptVBCreatable

VB Specifications dialog: Creatable checkbox.

genOptVBExposed

VB Specifications dialog: Exposed checkbox.

genOptVBMTS

VB Specifications dialog: MTS Transaction Mode.

genOptVBNetGenNamespace

VB.Net Specifications dialog: Generate Namespace.

genOptVBVersion

VB Specifications dialog: Default Version.

genOptWrapComment

Source Code Engineering dialog: Wrap length for comment lines.

importClassName

The name of the Class being imported.

importFileName

The filename of the Class being imported.

importFilePath

The full path of the Class being imported.

importFromAggregation

T if the Class has an Aggregation connector to a Class in this file, F otherwise.

importFromAssociation

T if the Class has an Association connector to a Class in this file, F otherwise.

importFromAtt

T if an attribute of a Class in the current file is of the type of this Class, F otherwise.

importFromDependency

T if the Class has a Dependency connector to a Class in this file, F otherwise.

importFromGeneralization

T if the Class has a Generalization connector to a Class in this file, F otherwise.

importFromMeth

T if a method return type of a Class in the current file is the type of this Class, Fotherwise.

importFromParam

T if an method parameter of a Class in the current file is of the type of this Class, Fotherwise.

importFromRealization

T if the Class has a Realization connector to a Class in this file, F otherwise.

importInFile

T if the Class is in the current file, F otherwise.

importPackagePath

The package path with a '.' separator of the Class being imported.

ImportRelativeFilePath

The relative file path of the Class being imported from the file path of the file being generated.

linkAttAccess

Association Properties Target Role dialog: Access.

linkAttCollectionClass

The collection appropriate for the linked attribute in scope.

linkAttContainment

Association Properties Target Role dialog: Containment.

linkAttName

Association Properties dialog: Target.

linkAttNotes

Association Properties Target Role dialog: Role Notes.

linkAttQualName

The Association target qualified by the namespace path (if generating namespaces) and the classifier path (dot delimited).

linkAttRole

Association Properties Target Role dialog: Role.

linkAttStereotype

Association Properties Target Role dialog: Stereotype.

linkAttTargetScope

Association Properties Target Role dialog: Target Scope.

linkCard

Link Properties Target Role dialog: Multiplicity.

linkedFileLastWrite

Class Properties dialog: Last Write.

linkedFileNotes

Class Properties dialog: Notes.

linkedFilePath

Class Properties dialog: File Path.

linkedFileSize

Class Properties dialog: Size.

linkedFileType

Class Properties dialog: Type.

linkGUID

The unique GUID for the current connector.

linkParentName

Generalization Properties dialog: Target.

linkParentQualName

The Generalization target qualified by the namespace path (if generating namespaces) and the classifier path (dot delimited).

linkStereotype

The stereotype of the current connector.

linkVirtualInheritance

Generalization Properties dialog: Virtual Inheritance.

metricName

Project Management dialog, Metrics tab: Metric field.

metricNotes

Project Management dialog, Metrics tab: (Notes) field.

metricType

Project Management dialog, Metrics tab: Type field.

metricWeight

Project Management dialog, Metrics tab: Weight field.

opAbstract

Operation dialog: Virtual checkbox.

opAlias

Operation dialog: Alias.

opBehavior

Operation Behavior dialog: Behavior.

opCode

Operation Behavior dialog: Initial Code.

opConcurrency

Operation dialog: Concurrency.

opConst

Operation dialog: Const checkbox.

opGUID

The unique GUID for the current operation.

opImplMacros

A space-separated list of macros defined in the implementation of this operation.

opIsQuery

Operation dialog: IsQuery checkbox.

opMacros

A space-separated list of macros defined in the declaration for this operation.

opName

Operation dialog: Name.

opNotes

Operation dialog: Notes.

opPure

Operation dialog: Pure checkbox.

opReturnArray

Operation dialog: Return Array checkbox.

opReturnClassifierGUID

The unique GUID for the classifier of the current operation.

opReturnQualType

The operation return type qualified by the namespace path (if generating namespaces) and the classifier path (dot delimited). If the return type classifier has not been set, is equivalent to the opReturnType macro.

opReturnType

Operation dialog: Return Type.

opScope

Operation dialog: Scope.

opStatic

Operation dialog: Static checkbox.

opStereotype

Operation dialog: Stereotype.

opSynchronized

Operation dialog: Synchronized checkbox.

packageAbstract

Package dialog: Abstract.

packageAlias

Package dialog: Alias.

packageAuthor

Package dialog: Author.

packageComplexity

Package dialog: Complexity.

packageGUID

The unique GUID for the current package.

packageKeywords

Package dialog: Keywords.

packageLanguage

Package dialog: Language.

packageName

Package dialog: Name.

packagePath

The string representing the hierarchy of packages, for the Class in scope. Each package name is separated by a dot (.).

packagePhase

Package dialog: Phase.

packageScope

Package dialog: Scope.

packageStatus

Package dialog: Status.

packageStereotype

Package dialog: Stereotype.

packageVersion

Package dialog: Version.

paramClassifierGUID

The unique GUID for the classifier of the current parameter.

paramDefault

Operation Parameters dialog: Default.

paramFixed

Operation Parameters dialog: Fixed checkbox.

paramGUID

The unique GUID for the current parameter.

paramIsEnum

True, if the parameter uses the enum keyword (C++).

paramKind

Operation Parameters dialog: Kind.

paramName

Operation Parameters dialog: Name.

paramNotes

Operation Parameters dialog: Notes.

paramQualType

The parameter type qualified by the namespace path (if generating namespaces) and the classifier path (dot delimited). If the parameter classifier has not been set, is equivalent to the paramType macro.

paramType

Operation Parameters dialog: Type.

problemCompletedBy

Maintenance dialog, Element Issues tab: Completed by.

problemCompletedDate

Maintenance dialog, Element Issues tab: Completed.

problemHistory

Maintenance dialog, Element Issues tab: History.

problemName

Maintenance dialog, Element Issues tab: Name.

problemNotes

Maintenance dialog, Element Issues tab: Description.

problemPriority

Maintenance dialog, Element Issues tab: Priority.

problemRaisedBy

Maintenance dialog, Element Issues tab: Raised by.

problemRaisedDate

Maintenance dialog, Element Issues tab: Raised.

problemStatus

Maintenance dialog, Element Issues tab: Status.

problemVersion

Maintenance dialog, Element Issues tab: Version.

requirementDifficulty

Properties dialog: Require tab: Difficulty.

requirementLastUpdated

Properties dialog: Require tab: Last Update.

requirementName

Properties dialog: Require tab: Short Description.

requirementNotes

Properties dialog: Require tab: Notes.

requirementPriority

Properties dialog: Require tab: Priority.

requirementStatus

Properties dialog: Require tab: Status.

requirementType

Properties dialog: Require tab: Type.

resourceAllocatedTime

Project Management window, Resource Allocation tab: Allocated Time.

resourceEndDate

Project Management window, Resource Allocation tab: End Date.

resourceExpectedTime

Project Management window, Resource Allocation tab: Expected Time.

resourceExpendedTime

Project Management window, Resource Allocation tab: Time Expended.

resourceHistory

Project Management window, Resource Allocation tab: History.

resourceName

Project Management window, Resource Allocation tab: Resource.

resourceNotes

Project Management window, Resource Allocation tab: Description.

resourcePercentCompleted

Project Management window, Resource Allocation tab: Completed(%).

resourceRole

Project Management window, Resource Allocation tab: Role.

resourceStartDate

Project Management window, Resource Allocation tab: Start Date.

riskName

Project Management window, Risks tab: Risk.

riskNotes

Project Management window, Risks tab: (Notes).

riskType

Project Management window, Risks tab: Type.

riskWeight

Project Management window, Risks tab: Weight.

scenarioGUID

The unique ID for a scenario. Identifies the scenario unambiguously within a model.

scenarioName

Properties dialog, Scenario tab: Scenario.

scenarioNotes

Properties dialog, Scenario tab: (Notes).

scenarioType

Properties dialog, Scenario tab: Type.

testAcceptanceCriteria

Testing window: Acceptance Criteria.

testCheckedBy

Testing window: Checked By.

testDateRun

Testing window: Last Run.

testClass

The Testing window tab (the type of test defined): Unit, Integration, System, Acceptance, Scenario.

testInput

Testing window: Input.

testName

Testing window: Test.

testNotes

Testing window: Description.

testResults

Testing window: Results.

testRunBy

Testing window: Run By.

testStatus

Testing window: Status.

testType

Testing window: Type.

Field substitution macros can be used in one of two ways:

Use 1: Direct Substitution

This form directly substitutes the corresponding value of the element in scope into the output.

Structure: %<macroName>%

Where <macroName> can be any of the macros listed above.

Examples:

  • %className%
  • %opName%
  • %attName%

Use 2: Conditional Substitution

This form of the macro enables alternative substitutions to be made depending on the macro's value.

Structure: %<macroName> (  == "<test>" )  ? <subTrue> (  : <subFalse>  ) %

Where:

  • (  <text>  ) denotes that <text> is optional
  • <test> 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.

Examples:

  • %classAbstract=="T" ? "pure" : ""%
  • %opStereotype=="operator" ? "operator" : ""%
  • %paramDefault != "" ? " = " value : ""%

The above three examples output nothing if the condition fails.  In this case the false condition can be omitted, resulting in the following usage:.

Examples:

  • %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:

 = 10

Notes:

  • In a conditional substitution macro, any white space following <macroName> is ignored; if white space is required in the output, it should be included within the quoted substitution strings