IBM Support

How to define an empty string as a default value of a stereotype's tagged value

Question & Answer


Question

In IBM® Rational® Software Architect (RSA), you might have a defined profile with several stereotypes. Each stereotype has tagged values with the type "String". If you want to define an empty string as the default value, you might try to use the "Literal String" value from the Advanced tab of the tagged-value. Doing so results in RSA's placing the <"null"> string into the default value field. However, when you apply the stereotype to a Unified Modeling Language (UML) element in a model, the tagged-value value becomes "null". "null" without the quotation marks. If you then use this model as input for a model-to-model transformation, it has the following consequence. RSA does not consider the tagged-value with such this "null" value as a null string. RSA rather considers this tagged-value as a string with a value equal to "null". Forcing the tagged value's value in the model to "null" does not change the result. Note the quotation marks, as they are present in the stereotype. This technote explains how you can define an empty string as a default value of a stereotype's tagged value. RSA in turn interprets the default value as an empty string in the context of the UML element to which it is applied.

[{"Product":{"code":"SSCLKU","label":"Rational Software Modeler"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Modeling","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.0.0.4;7.0.5;7.0.5.1","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}},{"Product":{"code":"SSJP3D","label":"Rational Systems Developer"},"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Component":"Modeling","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.0.0.4;7.0.5;7.0.5.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSYK2S","label":"Rational Software Architect Designer"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Modeling","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.0.0.4","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
10 September 2020

UID

swg21302723