Union

A Union Class is a Simple Type element that defines a collection of Simple Types. You can create it by dragging the Union icon from the XML Schema Toolbox and dropping it directly on a diagram.

Toolbox Icon

union_icon

Access     Drag icon onto diagram, or
Project Browser | Double-click on «XSDunion» stereotyped element, or
Diagram | right-click on «XSDunion» stereotyped element | Properties

Define Properties

Field/Button

Action

See also

Name

If you do not want to use the default name of the Union, overtype it with another name.

 

 

Member Types

Click on the Browse button (( ... )) to display the XSD Union Members dialog, and select built-in XSD datatypes and Simple Type elements to be members of the collection.

 

Field/Button

Action

Class Name

Either:

Type in an existing or proposed Class name or
Click on the down arrow and select an XSD data type
 

Select the Accept classifier even if not in model checkbox and click on the Add button.

These options are generally used to specify objects that are not in the same package as the Union element.

 

Choose

Instead of typing or selecting values in the Class Name field, click on this button to display the Select Classifier browser and locate and select a Simple Type element.

Click on the OK button to close the browser and immediately add the selected element to the Type Details list.

This option is generally used to specify objects that are in the same package as the Union element, but you can select objects in any other package also.

 

Add

Click on this button to add the data type or element specified in the Class Name field to the Type Details list.

 

Accept classifier even if not in model

Select this checkbox to include elements or data types that have been named but that are not present in the same model package as the Union element.

 

Type Details

Review the list of selected elements or data types.  If you intend to remove an object from the list, highlight it and click on the Delete Selected button (below).

 

Delete Selected

Click on this button to remove the currently-selected Classifier from the Type Details list.

 

Close

Click on this button to close the XSD Union Members dialog and to list the selected elements and data types in the Member Types field.

 

 

Simple Type

Annotation

(Optional) Type any notes you need for this element.

 

 

OK

Click on this button to save the attribute data entered and close the XSD union Properties dialog.

 

 

Cancel

Click on this button to discard the attribute data entered and close the XSD union Properties dialog.

 

 

Help

Click on this button to display this Help topic.

 

 

UML

This button is displayed when you are editing existing «XSDunion» element information.

Click on the button to open the UML element Properties dialog for the «XSDunion» element.

 

Properties

Notes

When you click on the Close button on the XSD union Properties dialog, a Generalization connector is added to the diagram from the XSD Union element to each of the member elements on the same diagram; any elements not on the same diagram are listed in the top right corner of the XSD Union element
If the Member Types that are not on the same diagram as the Union element are not listed, select Tools | Options | Diagram | Behavior and select the Show 'Hidden' Parents checkbox
A Union element:
Cannot contain any child Classes
Cannot contain any «XSDelement» or «XSDattribute» stereotyped UML attributes
Cannot be the source of an Association connector
Can be the target of an Association connector from a Complex Type element
Can be the target of a Generalization connector from a Simple Type element

Learn more