Type expressions

In XDE, all parameters, attributes, and association ends have a TypeExpression field, which is an arbitrary string used to hold the type of the element. For parameters and attributes, this string is displayed on diagrams. In the Rational® UML modeling products, parameters and properties (which are the UML 2.0 equivalent of both attributes and association ends) have a Type field. This field is not a string, it is a reference to a type element within a model. This difference between an arbitrary string and an element reference causes problems when you import models that make extensive use of the TypeExpression field in XDE.

Finding the correct element for the Type reference is a four-step process during the import process if the XDE element is a parameter or an attribute:

  1. If the TypeExpression field in the XDE model is empty, then the element has no type and the Type reference is left unset.
  2. If the TypeExpression field matches one of the built-in primitive types that are available in all Rational UML modeling product models, then the Type field is set to that primitive type. The built-in primitive types that are checked for are String, Integer, and Boolean.
  3. The string in the TypeExpression field is looked up within the current model and within any model to which the current model has an access relationship. If a model element that represents a type is found, the Type field is set to that element.
  4. If none of the previous steps succeeded, a primitive type element is created in the PrimitiveTypes package at the root of the current model. The name of the primitive type is set to be the same as the string in the TypeExpression field, and the Type field is set to this primitive type element.

In XDE, the TypeExpression field of an association end is completely independent from the target element of the association corresponding to that association end. In the Rational modeling products, the Type field of a property element that is also an association end must refer to the element that is the target of the association. It is not possible to set the Type field to point somewhere else without also redirecting the association itself. Therefore, it is not possible to use the information in the TypeExpression field of the XDE model to set the Type field in the imported model. Instead, a stereotype property is used to preserve the XDE TypeExpression string during import, though not in a way that is easily visible.

If the TypeExpression field for an association end is not empty, then the stereotype «XDE TypeExpression» is applied to the corresponding property element in the Rational modeling product, and the stereotype property TypeExpression is set to the value of the XDE TypeExpression field. This stereotype property is only visible on the Advanced page of the Properties window for the property model element.

Terms of use | Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.