Using the Apply Pattern wizard

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.

Create a UML model that contains a diagram editor before you do the following instructions.

To apply a pattern with the Apply Pattern wizard:

  1. 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.
  2. In the Location 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. The qualified name of the model element appears in the Selected location box.
  3. Accept the default diagram editor in the Create pattern instance on diagram box or specify another existing diagram editor.
  4. Click Next. The Pattern Parameters page of the Apply Pattern wizard opens.
  5. To specify an argument for a parameter, click the Value field for the parameter and do one of the following steps:
    Note: In the pattern design, the pattern author has the option to define a subset of allowable subtypes for appropriate UML 2.0 types. Parameter types such as Classifier can be limited to a subset of Activity, Class, Interface subtypes as possible arguments. To see the allowable types list, hover over the Value field.
    • Click the browse button to open the Select Value window and select an existing element.
    • Type a name to create a new element.
    • Type the name of an existing element of the same UML 2.0 type as the template parameter (if the definition does not include subtypes) or an allowable subtype.
    • 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)
  6. To add additional values to parameters (with multiplicity values that allow multiple values), do the following steps:
    1. Click the Value field, and click the Add Value button. An additional row in the table is added below the parameter.
    2. Perform one of the options in step 5.
  7. Repeat steps 5 and 6 as needed.
  8. Click Finish. You can see the results of the pattern in your model or models. The pattern instance is in the model of the element you specified.
  9. 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 Patterns > Parameters
  10. Modify the values, and click OK.
Related concepts
Pattern instantiation
Apply pattern process
Related tasks
Using drag and drop
Using the Apply Pattern wizard
Specifying arguments for pattern instances
Modifying pattern instances
Reviewing pattern information
Setting pattern preferences
Importing patterns
Related reference
Pattern icons
Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.