The Apply Pattern wizard helps you create
a pattern instance and select argument values for the pattern's template parameters.
You can continue to add argument values to the pattern instance after using
the wizard.
To apply a pattern with the Apply Pattern wizard:
- In the Pattern Explorer view, right-click
a pattern and click Apply Pattern. The Apply
Pattern wizard opens, listing the open UML 2.0 models in your workspace.
- In the Select a model element as a pattern instance
target list, click the model element you want to contain the pattern
instance. Only the elements that can own the type of pattern you
are applying (collaboration, class, or package pattern) are available for
selection.
- Click OK. The Pattern
Parameters page of the Apply Pattern wizard opens.
- To specify an argument for a parameter, click the Value field
for the parameter and do one of the following steps:
- Click the browse button to open the Select Value window and
select an existing element.
- Type a name to create a new element of the same UML 2.0 type as the
template parameter
- Type the name of an existing element of the same UML 2.0 type as the
template parameter
- For UML 2.0 types that take a primitive value: Type a
value that matches the parameter type (for example, an integer, a string,
or unlimited natural number).
- For UML 2.0 types with value sets (or parameters designed to have
value sets), select an option from the drop-down list (for example, you select true or false for
a literal Boolean type)
- To add additional values to parameters (with multiplicity values
that allow multiple values), do the following steps:
- Click the Value field, and click the Add
Value button An additional row in the table is
added below the parameter.
- Perform one of the options in step 4.
- Repeat steps 4 and 5 as needed.
- Click Finish. You can see
the results of the pattern in your model or models. The pattern instance is
in the model you specified.
- To specify additional values for the pattern's parameters or modify
the selections you have made, in the Model Explorer view,
right-click the pattern instance and click
- Modify the values, and click OK.